1,212
16
Essay, 2 pages (300 words)

Week 2 chrchpoint essay

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

Thank's for Your Vote!
Week 2 chrchpoint essay. Page 1
Week 2 chrchpoint essay. Page 2
Week 2 chrchpoint essay. Page 3

This work, titled "Week 2 chrchpoint essay" was written and willingly shared by a fellow student. This sample can be utilized as a research and reference resource to aid in the writing of your own work. Any use of the work that does not include an appropriate citation is banned.

If you are the owner of this work and don’t want it to be published on AssignBuster, request its removal.

Request Removal
Cite this Essay

References

AssignBuster. (2022) 'Week 2 chrchpoint essay'. 30 September.

Reference

AssignBuster. (2022, September 30). Week 2 chrchpoint essay. Retrieved from https://assignbuster.com/week-2-chrchpoint-essay/

References

AssignBuster. 2022. "Week 2 chrchpoint essay." September 30, 2022. https://assignbuster.com/week-2-chrchpoint-essay/.

1. AssignBuster. "Week 2 chrchpoint essay." September 30, 2022. https://assignbuster.com/week-2-chrchpoint-essay/.


Bibliography


AssignBuster. "Week 2 chrchpoint essay." September 30, 2022. https://assignbuster.com/week-2-chrchpoint-essay/.

Work Cited

"Week 2 chrchpoint essay." AssignBuster, 30 Sept. 2022, assignbuster.com/week-2-chrchpoint-essay/.

Get in Touch

Please, let us know if you have any ideas on improving Week 2 chrchpoint essay, or our service. We will be happy to hear what you think: [email protected]