Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Data Mining Concepts And Techniques

Authors: Jiawei Han, Micheline Kamber, Jian Pei

3rd Edition

0123814790, 9780123814791

More Books

Students also viewed these Databases questions

Question

\f

Answered: 1 week ago

Question

What is the difference between Needs and GAP Analyses?

Answered: 1 week ago

Question

What are ERP suites? Are HCMSs part of ERPs?

Answered: 1 week ago