This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Declare ounces as integer Declare unitPrice as real Write “Unit Price Program” Write “This program computes the unit price for an item” Call Input Data Module Call Perform Calculations Module Call Output Results Module End Program End Main Module Input Data Module Write “What is the item’s name?” Input itemName Write “How much does the item cost?” Input price Write “What is the weight in pounds (no fractions)?” Input pounds Write “What are the fractional ounces?” Input ounces End Input Data Module Perform Calculations Module Set ounces = 16 * pounds + ounces unitPrice = price/ounces End Perform Calculations Module Output Results Module Write “The item is: “, itemName Write “The total price of the item is: $“, price Write “The unit price of the item is: $”, unitPrice, “per ounce” End Output Results Module...
View
Full Document
 Spring '10
 JOSEPHPILLERA
 Ring, Imperial units, United States customary units, Avoirdupois, Input Data module

Click to edit the document details