Question: ME 4 0 0 - Computer Applications in Mechanical Engineering Exercise # 1 Instructions: Complete each of the following steps. When you have completed all

ME400- Computer Applications in Mechanical Engineering
Exercise #1
Instructions:
Complete each of the following steps. When you have completed all steps
assigned, upload the files associated with the exercise on Canvas. Make sure
the filenames you upload as part of your exercise submission have the exact
names specified in each steps of this exercise. If the filenames do not match
exactly, then you submission will not be graded.
Problem 1
Consider a ball of mass m that is thrown upward at time =0 with an initial velocity (0).
Assume that the velocity and height can be calculated using the following equations:
()=(0),
()=(0)2/2,
where =9.81/2 is the accelerations of gravity. Write a program, which meets the
requirements listed below, to calculate the velocity () and the height () at time .
Requirements
1. Create a sub directory named ex01a, and an associated C++ source file named
ex01a.cpp, in your CPP directory on the Z: drive.
2. Declare a variable as an integer, and variables ,0,, and as floats.
3. Assign a value of 9.81 to the variable .
4. Prompt the user to enter the initial velocity in meters/second. Capture the user
input using the stream object and store the resulting value in the variable 0.
5. Prompt the user to enter the time that has passed in seconds. Capture the user
input using the cin stream object and store the resulting value in the variable .
6. Calculate the velocity () after seconds and store the value in the variable .
7. Calculate the height () after seconds and store the value in the variable .
8. Using the cout stream object output the values of v(t) and h(t) in the following
format:
The velocity after time ### seconds is ###.# meters/s
The height after time ### seconds is ###.# meters\

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!