course of C++ programming language
C++ is a general purpose programming language. It is an object-oriented programming language created by Bjarne Stroustrup and released in 1985. It implements data abstraction using a concept called classes. C++ provides flexible and efficient facilities for defining new data types.
This course provides the knowledge required to understand, design and write computer programs in C++. The aim of the course is to lay a solid foundation of good software engineering and programming practice.
Requirements
Students should know:
- ANSI C programming language;
- basic data structures (arrays, lists, trees, graphs).
References
Books:
- Bjarne Stroustrup: The C++ programming language. Third edition. Addison-Wesley. 1997.
- Bruce Eckel: Thinking in C++. Second edition. Prentice Hall. 2000.
- Herbert Schildt: C++: the complete references. Third edition. McGraw-Hill. 1998.
- Nicholas Solter, Scott Kleper: Professional C++. Wiley Publishing. 2005.
Basic references:
Further references:
Internet:
Schedule
- Lecture: Monday 14-16, room 5
- Lab: Monday 16-18, room 110
Advertisements
- 2.06.2009
- The last 12th exercise has just been published.
- 21.03.2009
- The 3rd simple exercise will be published soon (today).
- 22.01.2009
- This is the place where important news will be published.
Lab
Rules
- general:
- At this site several simple programming tasks will be published. For each properly programmed task the student can score up to 10 points or up to 5 points for the task submitted within a week after the deadline.
- deadline:
- The deadline for each task is one week after its publication. Delays longer than a week are not acceptable. The only exceptions are: illness confirmed by a doctor, official matters confirmed by the appropirate authorities.
- presentation of solutions:
- Programs have to be presented during lab sessions, personally by the author (student). It is unacceptable to pass the solutions by colleagues. During the presentation the author should be prepared to answer questions about: the method, specific langauge constructions, technologies, etc. used in the proposed solution.
- programs:
- Presented programs have to be sent to me immediately after the lab sessions. I will collect your programs to the end of semester.
- evaluation:
- To receive the credit for this course, grade 3 (sufficient), the student has to collect minimum 50% of all the possible points; for grade 5 (very good) it is necessary to collect 90% of all the possible points; the rest of the intermediate grades are linearly dependent on the above border requirements.
Exercises
-
2.03.2009: no task
- 9.03.2009: roman numbers (ps/pdf)
- 16.03.2009: selection-sort (ps/pdf)
- 23.03.2009: data transformation to the string object (ps/pdf)
- 30.03.2009: time (ps/pdf)
- 06.04.2009: vectors (ps/pdf)
- 20.04.2009: binary search tree (ps/pdf) 27.04.2009: no task
- 4.05.2009: polynomial (ps/pdf)
- 11.05.2009: stack and queue (ps/pdf)
- 18.05.2009: expression tree (ps/pdf)
- 25.05.2009: reverse Polish notation (ps/pdf)
- 1.06.2009: manipulators (ps/pdf)
- 8.06.2009: XOR cipher (ps/pdf) 15.06.2009: no task
Ranking
- group of "C++": (html)
Lectures
- 2.03.2009 Making and using objects:
- What is C++?
- The first program
- The Standard Library
- Header files
- Namespaces
- The namespace std
- Standard input/output
- Writing data to output stream using operator <<
- Reading data from input stream using operator >>
- Strings
- Constants
- 9.03.2009 Pointers and references:
- What is reference?
- Reference parameters
- Returning reference
- Pointer reference
- Constant reference
- Restrictions to references
- 16.03.2009 Functions:
- Functions declarations and definitions
- Inline functions
- Static variables
- Argument passing
- Value return
- Overloaded function names
- Default arguments
- 23.03.2009 Classes and objects:
- Class is a new type
- Data members and function members
- Access controll
- Constructors
- Self-reference
- Copy-constructor
- 30.03.2009 Classes and objects:
- Guaranteed initialization with the constructor
- The default constructor
- The constructor initializer list
- Guaranteed cleanup with the destructor
- Constant data members in classes
- Constant member functions in classes
- In-class function definitions
- 6.04.2009 Free store:
- Static members
- Operators new and delete
- new and delete for arrays
- Something about exceptions
- 20.04.2009 Operator overloading:
- Friends
- Fundamentals of operators
- Syntax
- Binary and unary operators
- 27.04.2009 Operator overloading:
- Predefined meanings for operators
- Operators and user-defined types
- Overloading assignment
- Increment and decrement: operator++ and operator--
- Subscripting: operator[]
- Function call: operator()
- 4.05.2009 Inheritance:
- Inheritance and composition
- Syntax
- Granting access
- Order of constructor and destructor calls
- Member functions that don't automatically inherit
- Upcasting
- 11.05.2009 Polymorphism and virtual functions:
- Introduction
- Virtual functions
- Function call binding
- Abstract classes
- Virtual destructors
- 18.05.2009 Exception handling:
- Exception handling fundamentals
- Catching exceptions
- Grouping of exceptions
- Catching all exceptions
- Exception specifications
- Exception in constructors
- Exception in destructors
- Resource exhaustion
- Standard exceptions
- 25.05.2009 Streams:
- C++ streams
- Predefined streams
- Formating using the ios members
- Using width(), precision(), and fill()
- Overloading operator<< and operator>>
- Using manipulators to format I/O
- Creating your own manipulators
- 1.06.2009 Streams:
- Unformated I/O
- Stream state
- Exceptions in streams
- File streams
- String streams
- 8.06.2009 Templates:
- Introduction
- Generic functions
- Explicitly overloading a generic function
- Overloading a function template
- Default template parameters
- Source code organization
- 15.06.2009 Templates:
- Generic classes
- Template parameters
- Using default arguments with template classes
- Explicit class specializations