Programming Tasks in C
Programming Tasks in C
1. The manager of Fish Haven wants a program that displays the number of gallons of water
a rectangular aquarium holds, given the aquarium’s length, width, and height
measurements in inches. (Hint: there are 231 cubic inches in a gallon).
a.) Using the IPO Chart, enter the input, processing, and output items, as well as
the algorithm, in the first column.
b.) Enter the C++ instructions in the second column of the chart, and then desk-
check the program using the following values: 20.5, 10.5, and 12.5 as the length,
width, and height measurements.
2. The manager of Keystone Tile wants an application that displays the area of a rectangular
floor, given its measurements in feet. It should also display the total cost of tiling floor,
given the price per square foot of tile.
a.) Using the IPO Chart, enter the input, processing, and output items, as well as
the algorithm, in the first column.
b.) Enter the C++ instructions in the second column of the chart, and then desk-
check the program using your own sets of data.
3. Silvia’s Pizzeria sells four different sizes of pizzas: small, medium, large, and family. The
manager of the pizzeria wants a program that displays the total number of pizzas sold, as
well as the percentage of the total number contributed by each different size.
a.) Using the IPO Chart, enter the input, processing, and output items, as well as
the algorithm, in the first column.
b.) Enter the C++ instructions in the second column of the chart, and then desk-
check the program using 25, 50, 50, and 75 as numbers of small, medium, large,
and family pizzas. Record the percentages with two decimal place.