Question
Use Basic/Beginner C++ skills, code in Visual Studio 2017
When a ball is thrown vertically upward from a reference location, it travels to a maximum height and then changes direction and experiences a fall. Ignoring the air resistance and a number of other tiny influences, the location of the ball (H) and its velocity (V) at time ) can be expressed by the following expressions: Here Vo is the initial upward velocity, g is the earth gravitational acceleration (9.81 m/s) and H is measured upward from the reference location. Using the above expressions one can find the time(tm) it takes for the ball to reach its maximum height(Hm) and the time it takes for the ball to return to its reference location (tr) as listed below: tr=210/g Write a program to: 1. read the initial velocity of the ball from the keyboard and calculate t, Hm, and r and then print their values with appropriate labels. Test the program for Vo-100 m/sec read a value for the time and calculate the corresponding velocity and the height of the ball and print their values with proper labels(use Vo 100); test the program for 1-15 sec 2.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

C++ Code for Program 1 :

#include<iostream>

using namespace std;

int main()

{

float H; // Height ( location of the ball )

float V; // Velocity

float t; // Time

float V0; // Initial Velocity

float g=9.81; // gravitaional Accelaration

cout<<"Enter initial velocity : ";

cin>>V0;

float tm = V0/g; // Calculating time taken

float Hm = (V0*V0)/2*g; // Calculating Maximum Height

float tr = (2*V0)/g; // Calculating returning time

cout<<"\nTime taken is : "<<tm<<"s\n";

cout<<"\nMaximum Height is : "<<Hm<<"m\n";

cout<<"\nReturning time is : "<<tr<<"s";

}

Output :

Enter initial velocity100 Time taken is 10.1937s Maximum Height is 49050m Returning tine is 20.3874s Process exited after 1.946 seconds with returnvalue 0 Press any key to continue - -

C++ Code for Program-2

#include<iostream>

using namespace std;

int main()

{

float H; // Height ( location of the ball )

float V; // Velocity

float t; // Time

float V0; // Initial Velocity

float g=9.81; // gravitaional Accelaration

cout<<"Enter initial velocity : ";

cin>>V0;

cout<<"Enter time : ";

cin>>t;

float tm = V0/g; // Calculating time taken

float Hm = (V0*V0)/2*g; // Calculating Maximum Height

float tr = (2*V0)/g; // Calculating returning time

V = V0-(g)*t; // Calculating Velocity at time t

H = (V0)*t-(g/2)*t*t; // Calculating Height at time t

cout<<"\nTime takenis : "<<tm<<"s\n";

cout<<"\nMaximum Height is : "<<Hm<<"m\n";

cout<<"\nReturning time is : "<<tr<<"s\n";

cout<<"\nVelocity "<<"after "<<t<<"sec is : "<<V<<"m/s\n";

cout<<"\nHeight is : "<<H<<"m";

}

Output :

Add a comment
Know the answer?
Add Answer to:
Use Basic/Beginner C++ skills, code in Visual Studio 2017 When a ball is thrown vertically upward...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Math 121 College Algebra Test F 7. A ball is thrown directly upward from a height...

    Math 121 College Algebra Test F 7. A ball is thrown directly upward from a height of 6 ft with an initial velocity of 20 fu/sec. a) Express the height s of the ball, in feet, seconds after it has been thrown. b) Determine the time at which the ball reaches its maximum height. Round the answer to two decimals c) Find the maximum height of the ball. Round the answer to two decimals

  • A ball is thrown vertically upward with an initial position of So = 10 m. The...

    A ball is thrown vertically upward with an initial position of So = 10 m. The maximum height reached by the ball is 30 m. a. Determine the initial velocity of the ball. b. Determine the time of flight when it returns to its initial position. c. Determine the time of flight when it hits the ground. d. Determine the velocity just before it hits the ground. Check your answer using a different equation. e. Plot v(t) and s(t) from...

  • Fill in the Blanks A golf ball is projected upward from ground level at an initial...

    Fill in the Blanks A golf ball is projected upward from ground level at an initial velocity of 112 ft/sec. The height of a projectile can be modeled by s(t) = -16t+ vot + So, where t is time in seconds, So is the initial height in feet, and Vo is the initial velocity in ft/sec. a. How high will the ball be after 2 sec? O feet b. What is the maximum height the ball reaches? O feet c....

  • Ba Example 2-16 Ball thrown upward A woman throws a ball upward into the air with...

    Ba Example 2-16 Ball thrown upward A woman throws a ball upward into the air with an initial velocity of 15.0 m/s. Calculate: (a) How high it goes (b) The time for the ball to reach its maximum height Ignore air resistance. 2-7 Freely Falling Objects Example 2-16 Ball thrown upward A woman throws a ball upward into the air with an initial velocity of 15.0 m/s. Calculate: (c) How long the ball is in the air before she catches...

  • Two Thrown Balls 1 2 3 45678 A blue ball is thrown upward with an initial...

    Two Thrown Balls 1 2 3 45678 A blue ball is thrown upward with an initial speed of 19.8 m/s, from a height of 0.6 meters above the ground. 2.4 seconds after the blue ball is thrown, a red ball is thrown down with an initial speed of 8.9 m/s from a height of 22.3 meters above the ground. The force of gravity due to the earth results in the bals each having a constant downward acceleration of 9.81 m/s2....

  • A 0.36-kg ball is thrown vertically upward with an initial speed of 12.5 m/s. What is...

    A 0.36-kg ball is thrown vertically upward with an initial speed of 12.5 m/s. What is the potential energy of the ball when it has travelled two-thirds of the distance to its maximum height? (Use the launch point to be the zero reference point of measurements of the heights)

  • Two throw A blue ball is thrown upward with an initial speed of 22.2 m/s, from...

    Two throw A blue ball is thrown upward with an initial speed of 22.2 m/s, from a height of 0.8 meters above the ground. 2.7 seconds after the blue ball is thrown, a red ball is thrown down with an initial speed of 9.2 m/s from a height of 27.8 meters above the ground. The force of grandly due to the earth results in the balls each having a constant downward acceleration of 9.81 m/s^2. What is the speed of...

  • a ball with mass 0.15 kg is thrown upward with initial velocity 20 m/sec from the roof of a building 30 m high

    a ball with mass 0.15 kg is thrown upward with initial velocity 20 m/sec from the roof of a building 30 m high. there is a force due to air resistance of |v|/30, where velocity v is measured in m/sec.a. find the maximum height above the ground the ball reaches.b. find the time the ball hits the ground.you cannot use the kinematic equations.

  • Use the worked example above to help you solve this problem. A ball is thrown from...

    Use the worked example above to help you solve this problem. A ball is thrown from the top of a building with an initial velocity of 21.0 m/s straight upward, at an initial height of 50.7 m above the ground. The ball just misses the edge of the roof on its way down, as shown in the figure. (a) Determine the time needed for the ball to reach its maximum height. s (b) Determine the maximum height. m (c) Determine...

  • Help 6. (18 pts.) A tennis ball is shot vertically upward with an initial speed of...

    Help 6. (18 pts.) A tennis ball is shot vertically upward with an initial speed of 20.0 m/s at time t0 S. (a) (6 pts.)Approximately how long does it take the tennis ball to reach its maximum height? (b) (6 pts.) How high does the ball rise? (c) (6pts.) Determine the velocity of the ball at t 3.00 seconds.

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT