friday 2 - Declare ounces as integer Declare unit Price as...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
IT210 week 2 Day 5 Chapter 2 Programming Problem CheckPoint 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: 1. Display a program title. 2. Prompt for the item name. 3. Prompt for the price of the item. 4. Prompt for the weight in pounds. 5. Prompt for ounces. 6. Convert pounds to ounces and add it to the input ounces. 7. Divide total price by ounces. 8. Display the price per ounce. Input: Item Name (string: item Name) Item Price (real: price) Item Weight in pounds (integer: pounds) Fractional ounces (integer: ounces) Output: Unit price (real: unit Price) Design Main Module Declare item Name as String Declare price as real Declare pounds as integer
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Declare ounces as integer Declare unit Price 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 item Name Write "How much does the item cost?" Input price Write "What is the weight in pounds?" Input pounds Write "What are the fractional ounces?" Input ounces End Input Data Module Perform Calculations Module Set ounces = 16 * pounds + ounces Unit Price = price/ounces End Perform Calculations Module Output Results Module Write "The item is: item Name Write "The total price of the item is: $", price Write "The unit price of the item is: $", unit Price, "per ounce" End Output Results Module...
View Full Document

Page1 / 2

friday 2 - Declare ounces as integer Declare unit Price as...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online