
Lesson 5-4: if-then-else Statements
114 | Chapter 5
Name __________________________________________ Date _______________________
Section _________________________________________
Exercise 1: Take program Pressure in Lesson 5-3 and change it so that it prints the message in
both Lesson 5-3, Exercise 1, and Lesson 5-3, Exercise 2. Run the program with the data set for
Lesson 5-3, Exercise 1.
“Warning!! Pressure reading above danger limit.” is printed ___________ times.
“Everything seems normal.” is printed __________ times.
Use program Calories for Exercises 2 through 4.
// Program Calories calculates a person's percentage of
// calories from fat and prints ...