Chapter 2 Pg 45 Exercise 1
The principal of a local school wants a program that displays the average
number of students per teacher at the school. The principal will enter the
number of students enrolled and the number of teachers employed. Complete an
IPO chart for this problem. Plan the algorithm using a flowchart. Also
complete a desk-check table for your algorithm. For the first desk-check, use
1200 and 60 as the number of students and number of teachers, respectively.
Then use 2500 and 100. (The answers to TRY THIS Exercises are located at the
end of the chapter.)
Input: Processing: Output:
Numbers of Students Processing items: none Average
Number of Teachers
Sales Tax Price Algorithm
• Enter the number
of students
enrolled and
number of
teachers
employed.
• Calculate the
average by
dividing number
of students and
number of
teachers.
• Display the
total due.
Number of students Number of Teachers Average
1200 60 20
2500 100 25
Chapter 2 Pg. 45 Exercise 5
Norbert Catering is famous for its roast beef sandwiches. The store’s owner
wants a program that he can use to estimate the number of pounds of roast beef
a customer should purchase, given the desired number of sandwiches and the
amount of meat per sandwich. Typically, one sandwich requires two to three
ounces of meat, but some customers prefer four or five ounces per sandwich.
Complete an IPO chart for this problem. Desk-check the algorithm using 50 as
the number of sandwiches and 4 ounces as the amount of meat per sandwich. Then
desk-check it using 224 and 2 ounces.
Input: Processing: Output:
Numbers of Sandwiches Processing items: none Average
Number of meats per
sandwich in ounces Algorithm
• Enter the number
of sandwiches and
amount of meat per
sandwich in
ounces.
• Calculate the
number of ounces
of roast beef by
multiplying the
number of
sandwiches and
amount of meat per
sandwich in
ounces.
• Calculate the
number of pounds
of roast beef a
customer should
purchase by
dividing by 16 the
number of ounces
in a pound.
• Display the total
number of pounds
of roast beef a
customer should
purchase.
Number of sandwiches Amount of meat per a Number of pounds of
sandwich in ounces roast beef a customer
should purchase
50 4 12.5
224 2 28
Chapter 2 Pg 46 Exercise 8
Each time Tania visits the dentist, her dental insurance requires her to pay a
$20 co-pay and 15% of the remaining charge. She wants a program that displays
the total amount she needs to pay, as well as the total amount the insurance
should pay. Complete an IPO chart for this problem. You can assume that the
dental charge will always be at least $20. Desk-check the algorithm using $110
as the dental charge. Then desk-check it using your own data.
Input: Processing: Output:
Dental charge Processing items: none Average
Remaining charge
Algorithm
• Enter the dental
charge and
remaining change.
• Calculate the
total amount pay
by multiplying
dental charge by
remaining charge.
• Display the total
insurance pay.
Dental Charge Remaining Charge Total Amount Pay Total Insurance
Pay
$20 15% $3 $17
$110 15% $16.50 $93.50