Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Illuminated

Authors: Catherine Ricardo

2nd Edition

1449606008, 978-1449606008

Students also viewed these Databases questions

Question

=+) Predict the average age difference in 2020.

Answered: 1 week ago