Skip to content
This repository was archived by the owner on Jan 15, 2023. It is now read-only.
/ CPP Public archive

C++ programming exercises from book "C++ Primer Plus", 6th Edition by Stephen Prata

Notifications You must be signed in to change notification settings

srgx/CPP

Repository files navigation

CPP

C++ programming exercises from book "C++ Primer Plus", 6th Edition by Stephen Prata

Table of Contents

Chapter 2: Setting Out to C++

  1. Display text message
  2. Convert miles to kilometers
  3. Simple functions
  4. Convert years to months
  5. Convert celsius to fahrenheit
  6. Convert light years to astronomical units
  7. Display time

Chapter 3: Dealing with Data

  1. Convert centimeters to feet and inches
  2. Calculate BMI
  3. Convert degrees, minutes, and seconds to degrees
  4. Convert seconds to days, hours, minutes and seconds
  5. Percentage of the world's population
  6. Gasoline consumption(liters per 100 kilometers)
  7. Gasoline consumption(miles per gallon)

Chapter 4: Compound Types

  1. User input and char arrays
  2. User input and strings
  3. Concatenate char arrays
  4. Concatenate strings
  5. Simple structure
  6. Array of structures
  7. Display structure
  8. Structures and dynamic memory allocation
  9. Dynamic array of structures
  10. Average score and std::array

Chapter 5: Loops and Relational Expressions

  1. Display integers in a range
  2. Factorials
  3. Sum of numbers
  4. Investments(Daphne and Cleo)
  5. Book sales(1 year)
  6. Book sales(3 years)
  7. Car catalog(simple structure and dynamic array)
  8. Count entered words(char array)
  9. Count entered words(string)
  10. Display pattern with stars and dots

Chapter 6: Branching Statements and Logical Operators

  1. Display non-numeric characters
  2. Average value of the donation
  3. Simple menu
  4. Display selected data from list
  5. Calculate tax value
  6. Enter and display sponsor names
  7. Count words
  8. Count characters in text file
  9. Read sponsor data from file

Chapter 7: Functions: C++’s Programming Modules

  1. Harmonic mean
  2. Average of golf scores
  3. Functions and structures
  4. Chance of winning lottery
  5. Recursive factorial
  6. Fill, show and reverse array
  7. Properties and pointers
  8. Calculate expenses
  9. Arrays, structures and students
  10. Function array

Chapter 8: Adventures in Functions

  1. Display text p times
  2. Set structure values
  3. Convert text to uppercase
  4. Set/Show structures and char arrays
  5. Find maximum of 5 values(templates)
  6. Find maximum of n values(templates)
  7. Various function templates

Chapter 9: Memory Models and Namespaces

  1. Multi-file golf
  2. Count entered characters
  3. Placement new operator
  4. Multi-file sales

Chapter 10: Objects and Classes

  1. Bank account
  2. Simple person objects
  3. Object oriented golf
  4. Object oriented sales
  5. Stack of customers
  6. Move class
  7. Betelgeuse plorg
  8. Linked list

Chapter 11: Working with Classes

  1. Vector random walk
  2. Modified vector class
  3. Random walk statistics
  4. Time class with friend functions
  5. Stones and pounds
  6. Compare Stonewt objects
  7. Imaginary numbers

Chapter 12: Classes and Dynamic Memory Allocation

  1. Cows
  2. String class
  3. Companies
  4. Stack
  5. Bank simulation(1 queue)
  6. Bank simulation(2 queues

Chapter 13: Class Inheritance

  1. Cds(arrays)
  2. Cds(dynamic memory allocation)
  3. Abstract class
  4. Wine collection

Chapter 14: Reusing Code in C++

  1. Wine(fields)
  2. Wine(private inheritance)
  3. Queue template
  4. Wild west
  5. Finks and managers

Chapter 15: Friends, Exceptions, and More

  1. Tv remote
  2. Exception inheritance(1 level)
  3. Exception inheritance(2 levels)
  4. Sales exceptions

Chapter 16: The string Class and the Standard Template Library

  1. Simple palindrome
  2. Advanced palindrome
  3. Hangman
  4. Sort array and remove duplicates(normal function)
  5. Sort array and remove duplicates(function template)
  6. Bank simulation with std::queue
  7. Lottery
  8. Birthday party
  9. Test std::list and std::vector
  10. Book reviews

Chapter 17: Input, Output, and Files

  1. Count input characters
  2. Copy data from keyboard to file
  3. Copy text file
  4. Merge 2 files
  5. Process birthday party data from file
  6. Finks, managers and files
  7. Save and load text file data

Chapter 18: Visiting with the New C++ Standard

  1. Initializer list
  2. Move semantics
  3. Variadic template
  4. Lambda expressions

About

C++ programming exercises from book "C++ Primer Plus", 6th Edition by Stephen Prata

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published