Resources: Review the example in Appendix E and the additional examples on pgs 80-83 of Prelude to Programming
Complete Programming Problem 2 on Page 109 of Chapter 2 of Prelude to Programming.
Side note; I had a very difficult time with this class in the first 3 weeks. However, I stumbled upon the Pseudocode Building Blocks tutorials on Youtube by Jack Lusby. They have helped me out tremendously.
IT/210
Hollie M. Strack
Week 2
CP 2
Jo Jones
Chapter 2 Programming Problem
Analysis
Process:
1. Get user input.
2. Get item weight in pounds and ounces
3. Determine price per unit
4. Calculate total cost
Input:
Weight in pounds and ounces
Price
Output:
Total_cost (real: > 0)
Design
Main Module
Declare ItemName As String
Declare Pounds As Float
Declare Ounces As Float
Declare PoundPrice As Float
Declare UnitPrice As Float
Declare TotalPrice As Float
Get user input
Find weight of item in pounds and ounces
Determine the number of units
Multiply units
Display total
End Main Module
Input Data Module
Write “What is the Item’s Name”
Input Item Name
Write “How Many Units are there”
Input Units
Write “What is the Price Per Unit”
Input Price
End Input Data Module
Perform Calculations Module
Declare Pounds As Float
Set TotalPrice = UnitPrice * (Pounds + Ounces/16)
Set UnitPrice = PoundPrice/16
End Perform Calculations Module
Output Results Module
Write “The item is “ + ItemName
Write “Number of Units”
Write “Price Per Unit”
Input Process Output
Price
Square feet per gallon
Width
Length
Height Get user input. Price
Square feet per gallon
Width
Length
Height
Length
Height
Width Find room area. Total area
Square feet per gallon
Total area Divide the area. Gallons needed
Gallons needed
Price
Multiply gallons. Total cost
Price
Square feet per gallon
Width
Length
Height
Total cost Display the total. Total cost
Associate Program Material