IT210 week 2 Day 5 CheckPoint

IT210 week 2 Day 5 CheckPoint - Declare pounds as integer...

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: itemName) Item Price (real: price) Item Weight in pounds (integer: pounds) Fractional ounces (integer: ounces) Output: Unit price (real: unitPrice) Design Main Module Declare itemName as String Declare price as real
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 pounds as integer 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?" 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

This note was uploaded on 04/11/2011 for the course IT 210 taught by Professor Stephanwelborn during the Spring '11 term at A.T. Still University.

Page1 / 2

IT210 week 2 Day 5 CheckPoint - Declare pounds as integer...

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