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 Integer time

// loop on time(seconds

For time = 1 to 10

Call showFall(time)

End For

End Module

// The showFall module shows falling distance

Module showFall(Integer time)

Display "Falling distance is: ", fallingDistance(time), meters.

End Module

// The fallingDistance function returns distance fallen in n seconds

Function Integer fallingDistance (Integer time)

Declare Integer fall

Set fall = (9.8 * time * time) / 2

Return fall

End Function

Out put should look like below.

Seconds Meters 1.0 4.9 2.0 19.6 3.0 44.1 4.0 78.4 5.0 122.5 6.0 176.4 7.0 240.10000000000002 8.0 313.6 9.0 396.90000000000003 10.0 490.0

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

More Books

Students also viewed these Databases questions