- Published: January 25, 2022
- Updated: January 25, 2022
- Language: English
- Downloads: 48
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. 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) Process: 1. Display a Title of Program 2. Prompt for Item Name 3. Prompt for Item Price 4. Prompt for Weight in Pounds 5. Prompt for Ounces 6. Convert Pounds to Ounces and add to Input Ounces 7. Divide Total Price by Ounces 8. Display Price per Ounce Input: Item Name (string: ItemName) Item Price (Real: Price) Item Weight in Pounds (Integer: Pounds) Fraction of Ounces (Integer: Ounces) Output:
Unit Price (Real: UnitPrice) Design Main Module Declare itemName as String Declare price as real 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 items 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 = pounds/16 + 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
The paper "Week 2 chrchpoint essay" was written by a real student and voluntarily submitted to this database. You can use this work as a sample in order to gain inspiration or start the research for your own writing. You aren't allowed to use any part of this example without properly citing it first.
If you are the author of this paper and don't want it to be used on EduPony, contact us for its removal.Ask for Removal
Cite this Essay
EduPony. (2022) 'Week 2 chrchpoint essay'. 25 January.
EduPony. (2022, January 25). Week 2 chrchpoint essay. Retrieved from https://edupony.com/week-2-chrchpoint-essay/
EduPony. 2022. "Week 2 chrchpoint essay." January 25, 2022. https://edupony.com/week-2-chrchpoint-essay/.
1. EduPony. "Week 2 chrchpoint essay." January 25, 2022. https://edupony.com/week-2-chrchpoint-essay/.
EduPony. "Week 2 chrchpoint essay." January 25, 2022. https://edupony.com/week-2-chrchpoint-essay/.
"Week 2 chrchpoint essay." EduPony, 25 Jan. 2022, edupony.com/week-2-chrchpoint-essay/.
If you have any suggestions on how to improve Week 2 chrchpoint essay, please do not hesitate to contact us. We want to know more: [email protected]