Question
Hello I need a flowchart for this assignment. Thanks. Assignment Code: #include using namespace std; int main() { double H; // Height ( location of
Hello I need a flowchart for this assignment. Thanks.
Assignment
Code:
#include
using namespace std;
int main()
{ double H; // Height ( location of the ball ) double V; // Velocity double t; // Time double V0; // Initial Velocity double g = 9.81; // gravitational Accelaration in Earth
cout > V0;
cout > t;
V = V0 - (g)*t; // Calculating the Velocity at time t H = (V0)*t - (g / 2) * t * t; // Calculating Height at time t double tm = V0 / g; // Calculating the time taken for the ball double Hm = V0 * V0 / (2 * g); // Calculating Maximum Height double tr = 2 * V0 / g; // Calculating returning time
cout
cout
cout
cout
cout 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 (t) can be expressed by the following expressions: V =VO -(g) H =(VO) -(g/2)t? Here Vo is the initial upward velocity, g is the earth gravitational acceleration (9.81 m/s2) 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: tm =Volg Hm =Vo? (29) tr = 2V0/g Write a program to: 1. read the initial velocity of the ball from the keyboard and calculate tm, Hm, and tr and then print their values with appropriate labels. Test the program for Vo= 100 m/sec. 2. 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 t= 15 sec
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started