It 210 Page 109 Questions

Submitted by: Submitted by

Views: 162

Words: 304

Pages: 2

Category: Science and Technology

Date Submitted: 03/09/2014 04:46 PM

Report This Essay

IT 210 Fundamentals of Programming With Algorithms and Logic

Question 2:

Problem: The manager of the Super SuperMarket would like to be able to compute the unit price for products sold there.

Process

1. Get Item Name

2. Get Item Price

3. Get Weight in pounds

4. Get Weight in Ounces

5. Divide Pound Price by 16

6. Multiply Pound Price by Pounds plus Ounces

7. Display Unit Price

8. Display Total Price

Input

1. Item Name

2. Item Price

3. Weight in pounds

4. Weight in ounces

Perform Calculation

1. Compute Unit Price

2. Compute Total Price

Output Results

1. Display Input Data

2. Display Unit Price

3. Display Total Cost of the Amount Purchased

------------------------------------------------------------------------------------------------------------

Input Data Module

Prompt for Item Name, Item Price, Weight in pounds, Weight in ounces

Input ItemName, PoundPrice, Weight in pounds, Weight in ounces

Perform Calculation Module

Set UnitPrice = PoundPrice/16

Set TotalPrice = PoundPrice * (Pounds + Ounces/16)

Output Results Module

Write “Item Name”

Write “Item Price”

Write “Pounds”

Write “Ounces”

Write “Unit Price”

Write “Total Price”

------------------------------------------------------------------------------------------------------------

Main Module

Declare ItemName (a String)

Declare PoundPrice ( a Float)

Declare Pounds (a Float)

Declare Ounces (a Float)

Write “Product Unit Price Program”

Write “This program computes the unit price of products sold”

Write “and total cost of amount purchased.”

Call Input Data Module

Call Perform Calculation Module

Call Output Results Module

End Program

Input Data Module

Write “What is the Item Name?”

Input ItemName

Write “What is the Item Price?”

Input PoundPrice

Write ‘How much does the Item weigh in pounds?”

Input Pounds

Write “How much does the Item weigh in ounces?”

Input Ounces...