Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

In this assignment, you will write a C + + program that performs some basic physics calculations. You will prompt the user for the number

In this assignment, you will write a C++ program that performs some basic physics calculations. You will prompt the user for the number of seconds an object has been falling. You will then calculate the distance it has traveled in that time, and how fast it is moving. You will output these results.
Input specification
The program should prompt the user to enter the name of the object and the number of seconds an object has been falling. This should be a floating point number.
The program's formatting should appear exactly as shown in the sample interaction.
Output specification
After obtaining the number of seconds and performing the calculations, the program should display the results for each result: distance traveled and speed. The program's formatting should appear exactly as shown in the sample interaction.
User interaction specifications
The program should display a welcome message to the user.
Prompt the user to enter the name of the object.
Prompt the user to enter the number of seconds an object has been falling.
Calculate the results for distance traveled and instantaneous speed by using the following formulas:
Distance Traveled
d=12gt2
Instantaneous Speed
v=gt
Use the value of 9.807ms2 for the value of g. You should set this as a constant.
Display the results in the format shown in the sample interaction below.
Sample interaction
$ g++ $CXXFLAGS pa02b.cpp -0 pa02b
$.? pa02b
Welcome to the Falling Object Calculator!
What object is falling: ball
Enter the number of seconds the object has been falling: 3.5
In 3.5 seconds, the ball has fallen: 60.0679 meters The ball is traveling at a speed of: 34.3245 meters per second $
Note: The $ character represents your shell prompt and should not be printed by your program.
Specific program requirements
image text in transcribed

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_2

Step: 3

blur-text-image_3

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

Records And Database Management

Authors: Jeffrey R Stewart Ed D, Judith S Greene, Judith A Hickey

4th Edition

0070614741, 9780070614741

More Books

Students explore these related Databases questions

Question

To solve p + 3q = 5z + tan( y - 3x)

Answered: 3 weeks ago