Skip to content

Implementation of fundamental C++ concepts from the C++ How To Program (Deitel) book, covering applications, operators, classes, objects, control statements, loops, and logical operators.

Notifications You must be signed in to change notification settings

hafsamaryam08/Cpp-How-To-Program

Repository files navigation

💻 C++ How To Program – Practice Repository

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.


📌 Topics Covered

📖 Chapter 1: Introduction to Computers and C++

  • 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

📖 Chapter 2: Intro to C++ Programming; I/O and Operators

  1. 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

📖 Chapter 3: Intro to Classes, Objects and Strings

  • Introduction to class and object concepts
  • Basic string usage

📖 Chapter 4: Control Statements – Part 1 (Assignment, ++, -- Operators)

  1. GradeBook

    • Counter-controlled repetition
    • Sentinel-controlled repetition
  2. ExamResult

    • Nested control statements
  3. Increment

    • Pre-incrementing and post-incrementing
  4. Power

    • Raise x to the y power

📖 Chapter 5: Control Statements – Part 2 (Logical Operators)

  1. ControlState

    • While loop (counter-controlled repetition)
    • For loop (counter-controlled repetition)
    • Summing even integers from 2 to 20
    • Do-while loop repetition
  2. CompdInterest

    • Compound-interest calculations
  3. SwitchState

    • Switch statement to count grades
  4. BreakCont

    • break statement exiting a for loop
    • continue statement skipping iterations
  5. LogicalOp

    • Truth table for &&, ||, !

About

Implementation of fundamental C++ concepts from the C++ How To Program (Deitel) book, covering applications, operators, classes, objects, control statements, loops, and logical operators.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages