Learning objectives for chapter 4
Learn how to use built-in math functions in C++.
Learn how division with whole numbers works.
Learn how to use a whole number where a floating point number is required.
Learn how to round-off floating point numbers in console output.
Learn what are "code blocks" and how to use them to organize code.
  Learning objective(s) addressed
  12345
Exercises Right-click (or control-click on a Mac) the title to save its PDF to your system.  
4.1 A Simple Mortgage Calculator, v.1.0 PDF X  XX
4.2 About Lighthouses, v.1.0 PDF X  XX
4.3 My Savings Plan, v.1.0 PDF X  XX
4.4 Division With Whole Numbers PDF  X X 

 
Samples Right-click (or control-click on a Mac) the title to save its CPP file to your system.  
4.1 Using int Variables in Math Functions CPP X X  
4.2 Rounding To The Nearest Penny CPP X  X 
4.3 Rounding To The Nearest Whole Number CPP X  X 
4.4 Turning Floating Point Formatting On And Off CPP X  X 

 
Videos  
4.1 Click HERE for a YouTube-like video that shows how to use the built-in math function for square root. This video is 13 minutes long. It's programming example is done in both C++ and Java, on a Mac. XX XX

Code from the chapter in order of their appearance in the text
mort.cpp mort2.cpp unformatting.cpp

Chapter 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15