Each of the following problems can be solved by a program that performs
three basic tasks—Input Data, Process Data, and Output Results. For each problem, use pseudocode to design a suitable program for solving it.
2. The manager of the Super Supermarket would like to be able to
compute the unit price for products sold there. To do this, the program should input the name and price of an item and its weight in pounds and ounces. It should then determine and display the unit price (the price per ounce) of the item.
Analysis Process:
Get User Input
Input Unit Name Input Unit Price Input Weight in pounds Input Weight in ounces Determine Unit Price per ounce Display Unit Price per ounce of Unit Name
Input:
Unit price (real: 0-100)
Ounces (real: 0-1000) Pounds (real: 0-1000)
Output:
Unit Price Unit Price per ounce
-DESIGN-
Main Module:
Write “Supermarket Unit Pricing”
Write “This program is designed to computer Unit Price” Write “and display the Unit Price per Ounce.” Declare unit price as real Declare ounces as real Declare pounds as real
Get User Input
Input Unit Name Input Unit Price Input Weight in pounds Input Weight in ounces Display Unit Price in ounces