Step 1: Create pseudocode for a program for the River Falls Homes Construction C
ID: 3670859 • Letter: S
Question
Step 1: Create pseudocode for a program for the River Falls Homes Construction Company. Design a program that prompts the user for a lot number in the River Falls subdivision and data about the home to be built there, including number of bedrooms, number of bathrooms, and the number of cars the garage holds. (You do not need to perform any error checking of user input for this program.)
Output is the price of the home, which is a $50,000 base price plus $17,000 for each bedroom, $12,500 for each bathroom, and $6,000 for each car the garage holds.
Use named constants for base price, bedroom price, bathroom price, and garage price.
Use the modular approach shown in Chapter 3. You should have 3 modules:
main() – program driver and main loop
housekeeping() – Display purpose of program
endOfJob() – terminate program
Use the Pseudocode template provided as the framework for your design.
Step 2: Desk check your design in a table
Use the following test data:
Case 1 Case 2 Case 3
Lot number: 1572 1600 1759
Number of bedrooms 3 4 2
Number of bathrooms 2 3 1
Number of cars per garage 2 2 0
Use a table like the following:
lotNbr
nbrBedrooms
nbrBaths
nbrGarage
totalCost
Case 1
1572
3
2
2
??
Case 2
1600
4
3
2
??
Case 3
1759
2
1
0
??
lotNbr
nbrBedrooms
nbrBaths
nbrGarage
totalCost
Case 1
1572
3
2
2
??
Case 2
1600
4
3
2
??
Case 3
1759
2
1
0
??
Explanation / Answer
Pseudocode:
start
Declarations
num jerseyNumber
num numBasesEarned
num numAtBats
num sluggingPercent
num numWalks
num numSacFlies
num onBasePercent
num gpa
string NUM_PROMPT = “Enter the player’s jersey number: ”
string BASES_PROMPT = “Enter the number of basesearned (hits): ”
string WALKS_PROMPT = “Enter the number of walks: ”
string BATS_PROMPT = “Enter the number of at bats: ”
string FLIES_PROMPT = “Enter the number of sacrificeflies: ”
string END_LINE = “End of job”
housekeeping()
while jerseyNumber <> 0
detailLoop()
endwhile
endOfJob()
stophousekeeping()
output NUM_PROMPT
input jerseyNumber
return
detailLoop()
output BASES_PROMPT
input numBasesEarned
output BATS_PROMPT
input numAtBats
output WALKS_PROMPT
input numWalks
output FLIES_PROMPT
input numSacFlies
sluggingPercent = numBasesEarned / numAtBats
output sluggingPercent
onBasePercent = (numBasesEarned + numWalks) /(numAtBats + numWalks + numSacFlies)
output onBasePercent
gpa = ((onBasePercent * 1.8) + sluggingPercent) / 4
output gpa
output NUM_PROMPT
input jerseyNumberreturnendOfJob()
output END_LINE
return
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.