Name: Anonymous 2012-11-16 20:12
Use pseudocode to design a suitable program to solve it.
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. Then it should determine and display the unit price (the price per ounce) of that item and the total cost of the amount purchased.
You will need the following variables:
ItemName (a String) Pounds (a Float) Ounces (a Float)
PoundPrice (a Float) TotalPrice (a Float) UnitPrice (a Float)
You will need the following formulas:
UnitPrice = PoundPrice/16
TotalPrice = PoundPrice*(Pounds + Ounces/16)
Does this look right?
Input Data module
Write “What is the item’s name?”
Input ItemName
Write “What is the item’s weight in pounds?”
Input Pounds
Write “What is the cost per pound?”
Input PoundPrice
Perform Calculations module
Set UnitPrice = PoundPrice/16
Set TotalPrice = PoundPrice*(Pounds + Ounces/16)
Output Results module
Write “The item is:” + ItemNate
Write “The price per ounce is:” + UnitPrice
Write “The total price of the item is:” + TotalPrice
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. Then it should determine and display the unit price (the price per ounce) of that item and the total cost of the amount purchased.
You will need the following variables:
ItemName (a String) Pounds (a Float) Ounces (a Float)
PoundPrice (a Float) TotalPrice (a Float) UnitPrice (a Float)
You will need the following formulas:
UnitPrice = PoundPrice/16
TotalPrice = PoundPrice*(Pounds + Ounces/16)
Does this look right?
Input Data module
Write “What is the item’s name?”
Input ItemName
Write “What is the item’s weight in pounds?”
Input Pounds
Write “What is the cost per pound?”
Input PoundPrice
Perform Calculations module
Set UnitPrice = PoundPrice/16
Set TotalPrice = PoundPrice*(Pounds + Ounces/16)
Output Results module
Write “The item is:” + ItemNate
Write “The price per ounce is:” + UnitPrice
Write “The total price of the item is:” + TotalPrice