11. Cost is
300
Price is 30Cost is 300
Grade A costs
300
Chapter 2
Programming Warm-Up Exercises
1. Only one line needs to be changed. In the constant declaration
const int LBS = 10;
change 10 to 15.
3. cout << The moon << endl;
cout << is << endl;
cout << blue. << endl;
Chapter 2
Case Study Follow-Up
1. The named constants make the program easier to read and understand. Also, to change one of the constants, you only need to change one line (the constant declaration) instead of changing every occurrence of the literal constant throughout the program.
Chapter 3
Exam Preparation Exercises
1. a. Floating point: 13.3333 b. Integer: 2 c. Integer: 5 d. Floating point: 13.75 e. Integer: -4 f. Integer: 1 g. Illegal: 10.0 /is a floating point expression, but the % operator requires integer operands.
5. a. iostream.h b. stdlib.h c. math.h d. iostream.h e. iostream.h and iomanip.h