MODULE SPECIFICATION UNDERGRADUATE PROGRAMMES KEY FACTS Module name Programming in C++ Module code IN2029 School Mathematics, Computer Science and Engineering Department or equivalent Department of Computing UK credits 15 ECTS 7.5 Level 5 Delivery location (partnership programmes only) MODULE SUMMARY Module outline and aims The C++ language is one of the most widely used in industry, for a wide variety of applications; home consumer (PC application) usage, finance sector, and government systems, database and scientific driven applications, internet and entertainment solutions (such as games, music players, home media devices) and the majority of the world s mobile and embedded technologies. When learning C++, it is helpful to remember that it is four languages in one: A better C, i.e., a procedural language but more type-safe than C. That is why, for example, the Linux kernel is compiled with a C++ compiler, although it is plain C code; C++ s stronger type-safety helps catch more bugs at compile time. A language for data abstraction. A language for object-orientation. A language for generic programming (using templates, as in the STL library). It is also helpful to remember that, unlike Java, C++ was meant to be as close as possible to C and as fast as possible. The latter means that one has access to low-level mechanisms and that the language provides more than one ways of doing things. Programmers choose among the alternatives based on how abstract (or how fast) they want their code to be. So, C++ can be used both for writing programs which follow all the principles of well structured object-oriented / generic-programming / data-abstraction programs and for writing programs which break almost all of the rules to get maximum speed. C++ s complexity stems from these two points: its 4-in-1 nature and the fact that it gives you absolute control of the machine, without attempting to safeguard you from a number of unsafe mechanisms, as these are usually the ones needed for low-level systems programming. This is in contrast to Java that places safety first and was partly developed to make programming safer for non-expert programmers. The complexity and power of C++ makes it difficult to write large programs without a careful introduction to some of its
base aspects; the early draft of the forthcoming C++ language standard (N2800=08-0310) is 1314 pages long. The module focuses on introducing some basic aspects of the C++ language in a gradual manner so as to allow students to use it with confidence in follow-up modules (e.g., Games Development) and in their professional career. We follow a comparative approach, contrasting the features of C++ and their behaviour with those of Java, with which students are already familiar, so as to make the differences and their importance easier to understand and appreciate. The module covers the following topics (not necessarily in this order): Content outline Introduction to C++ for Java programmers. Parameter passing by value and reference. Classes in C++. Polymorphism: Method and Operator Overloading. More on I/O in C++. Polymorphism: Generic Programming. Introducing the standard template library (STL) Containers. Access to Memory: Pointers and Arrays; Container Iterators in the STL. Polymorphism: Class (Single) Inheritance and Dynamic Binding in C++. Genericity, pointers and inheritance. Multiple Inheritance. Memory management: static, stack, dynamic. Construction and destruction of objects. Implementing a container class. Program structure, separate compilation, header files. Resource management and exceptions. Pre-requisite Modules IN1007 Programming in Java Students with a mark lower than 60-65% in IN1007 may find the module to be challenging. WHAT WILL I BE EXPECTED TO ACHIEVE? On successful completion of this module, you will be expected to be able to: Knowledge and understanding: Demonstrate a good working knowledge of the core features of C++. Explain the uses and pitfalls of multiple inheritance in object-oriented languages. Choose between different memory management techniques, balancing efficiency against maintainability. Identify common design patterns appropriate to the solution of specific programming problems Explain generic typing systems.
Skills: Read and modify substantial well-written C++ programs. Create classes and small programs in C++ that are correct, robust and capable of being understood, reused and modified by others. Make use of various object-oriented features, including inheritance, multiple inheritance and genericity, to enhance software quality. Appreciate C++ libraries and make use of them in solving tasks. Values and attitudes: NOT STATED HOW WILL I LEARN? Teaching pattern: Teaching component Teaching type Contact Selfdirected study Placement Lectures Lecture 20 50 0 70 Lab-based Tutorials Practical classes and workshops 10 70 0 80 Totals 30 120 0 150 Total student learning WHAT TYPES OF ASSESSMENT AND FEEDBACK CAN I EXPECT? Assessments Assessment pattern: Assessment component C++ Programming Exercises Examination Assessment type Written assignment, Programming Written exam (unseen) Weighting Minimum qualifying mark Pass/Fail? 30 N/A N/A 70 N/A N/A
Assessment criteria Assessment Criteria and Grade-Related Criteria for module assessments will be made available to students prior to an assessment taking place. More information will be made available from the module leader. Feedback on assessment Following an assessment, students will be given their marks and feedback in line with the Assessment Regulations and Policy. More information on the timing and type of feedback that will be provided for each assessment will be available from the module leader. Assessment Regulations The Pass mark for the module is 40%. Any minimum qualifying marks for specific assessments are listed in the table above. The weighting of the different components can also be found above. The Programme Specification contains information on what happens if you fail an assessment component or the module. INDICATIVE READING LIST Walter Savitch: Absolute C++, Addison Wesley, 2002. Bjarne Stroustrup: The C++ Programming Language, 3 rd ed, Addison Wesley, 1997. Cay Horstmann: Computing Concepts with C++ Essentials, 3 rd ed, Wiley, 2003. Walter Savitch: Problem Solving with C++, 4 th ed, Addison Wesley, 2003. Bruce Eckel: Thinking in C++, 2 nd ed. also available on-line at the author s website: http://www.mindview.net/books/ticpp/thinkingincpp2e.html/ The most authoritative book is Stroustrup s, since he is the author of the C++ language. For example, in the Further reading section of Absolute C++, Savitch states that if you should buy a single book on C++, Stroustrup should be your choice. Savitch also refers the reader to other, more advanced, books at certain occasions. However note that you may find Stroustrup s book difficult to understand, as it was written for professional programmers. So consult first these books in the library or a bookstore, comparing a chapter or two, to see which one you feel more comfortable with. Tools you will need for this module: g++ (C++ compiler) cpp (part of g++ - the C Pre-Processor) ld (part of g++ - the Link editor, used for producing executables and libraries) nm (extracts symbol names from a binary file, so that you can inspect its contents) c++filt (pretty-prints C++ symbol names extracted by nm) make (used for automating the compilation of programs)
gdb (a debugger) emacs (a very powerful editor for programmers) cvs / svn / git (programs for keeping different versions of your source code) More information about these tools can be obtained by consulting their respective manual pages and info pages - here is how you can learn more on how to use these: man man info info If you are using MS Windows, try cygwin.com for a set of Unix tools (better install the full thing, to make sure you did not miss something). A better alternative is to install Linux (e.g., Ubuntu) on a new partition of your hard drive or as a virtual machine. Exposure to Linux (and other operating systems) is paramount if you wish to become a professional programmer. Version: 2.0 Version date: September 2014 For use from: 2014-15 Appendix: see http://www.hesa.ac.uk/content/view/1805/296/ for the full list of JACS codes and descriptions CODES HESA Code Description Price Group 121 IT, Systems Sciences and Computer Software Engineering C JACS Code Description Percentage (%) I320 Concerned with the conversion of designs into computer instruction sets in order to satisfy the requirements of specific operational problems. 100