This repository contains my practice code from the book "C++ How To Program" (Deitel). It covers the foundations of C++ programming through step-by-step examples and exercises.
- Evolution of C and C++
- BCPL (Martin Richards, 1967)
- B (Ken Thompson, 1970)
- C (Dennis Ritchie, Bell Labs, 1972)
- C++ (Bjarne Stroustrup, Bell Labs, 1979)
- Originally called "C with Classes" → renamed C++ in the 1980s
- Programs consist of classes and functions
- C++ systems consist of: program development environment, the language, and the C++ Standard Library
- Welcome
- Printing a line of text
- Arithmetic operations: sum, difference, product, quotient, modulus
- Comparing integers using
if
, relational and equality operators - Calculating sum, product, average, max, min of three integers
- Even / Odd check
- Checking if first integer is a multiple of second
- Introduction to class and object concepts
- Basic string usage
-
GradeBook
- Counter-controlled repetition
- Sentinel-controlled repetition
-
ExamResult
- Nested control statements
-
Increment
- Pre-incrementing and post-incrementing
-
Power
- Raise
x
to they
power
- Raise
-
ControlState
- While loop (counter-controlled repetition)
- For loop (counter-controlled repetition)
- Summing even integers from 2 to 20
- Do-while loop repetition
-
CompdInterest
- Compound-interest calculations
-
SwitchState
- Switch statement to count grades
-
BreakCont
break
statement exiting afor
loopcontinue
statement skipping iterations
-
LogicalOp
- Truth table for
&&
,||
,!
- Truth table for