Question
Please write a c++ code for my pseudo code. I am take a class that is teaching me flow charts and pseudocode and I would
Please write a c++ code for my pseudo code. I am take a class that is teaching me flow charts and pseudocode and I would like to see the actual code so that I can start preparing myself for next semesters classes. Here is the pseudo code:
// main module
Module main()
// Local variables
Declare Real pennies = 1
Declare Integer numdays, count1
// Get number of days
Call getDays(numdays)
// Set earning
For count1= 2 to numdays
Call setPennies(pennies)
End For
// display values
Call showValues(numdays, pennies)
End Module
// The getDays module gets amount number of days
Module getDays(Integer Ref inputDays)
Display Enter number of days:
Input inputDays
End Module
// The setPennies module doubles current number of pennies
Module setPennies (Real Ref calcpennies)
Set calcpennies = calcpennies * 2
End Module
// The showValues module shows results of compound doubling
Module showValues(Real numdays, pennies)
Declare Real dollaramount
Set dollaramount = pennies / 100
Display In ,numdays, " a penny grows to $", dollaramount
End Module
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started