Lecture 1
Lecture 1
OBJECT ORIENTED
PROGRAMMING
MEHREEN TAHIR
BOOKS
1. 'Beginning C++17' by Ivor Horton and Peter Van Weert, ISBN 978-
1-4842-3366-5, March 2018
2. Object Oriented Programming in C++ by Robert Lafore, Fourth
Edition, Publication Date: December 19, 2001 | ISBN-10:
0672323087 | ISBN-13: 978-0672323089 | Edition: 4
3. C++ How To Program, Deitel & Deitel, Publication Date: March 25,
2011 | ISBN-10: 0132662361 | ISBN-13: 978-0132662369 |
Edition: 9/10
4. Problem solving abstraction and design using C++ by F.L.
Friedman. Addison Wesley, Fifth Edition, Publication Date: July 24,
2006 | ISBN-10: 0321433327 | ISBN-13: 978-0321433329 |
Edition: 5
5. Bruce Eckel, Thinking in C++: Introduction to Standard C++,
Volume 1, Second Edition, ISBN-13: 860-1300092737 ISBN-10:
0139798099, 25th March, 2000.
COURSE OUTLINE
GRADING
Assessments Details
•Theory: 75%
•Quizzes: 10%
•Assignments: 10%
•MSE: 30%
•ESE: 50%
•Total: 100%
GRADING
• Attendance • 75%
• Electrical Engineering and OOP
Programming Basics, C++
Environment, IO Stream
Lecture 1
Sample C++ Program
• Add 2 numbers and print the result
Explanation
• Preprocessor directives
– Give instructions to the compiler to preprocess the information before
actual compilation starts
• Namespace
– https://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a06689.html
– https://en.cppreference.com/w/cpp/header
• blocks
• Main
• Comments
More in C++
• Keywords
• Identifiers
• Whitespace characters
• Operators
=
Practice
int n1 = 1;
int n2 = ++n1;
int n3 = ++ ++n1;
int n4 = n1++;
IO Streams
• Stream operators
– Extraction
– Insertion
• https://cplusplus.com/reference/iostream/