Please use \" Cin\" and \"court \" I mean, this is Algorithm development. I mean
ID: 3619916 • Letter: P
Question
Please use " Cin" and "court "I mean, this is Algorithm development.
I mean I want to c++ program and I have use visusal C++/
Also, my text book is Engineering problem solving with C++
Question1
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=V(0) - (g)t
H=V(0)t-(g/2)t^2
Here Vo is the initial upward velocity, g is the earth gravitational
acceleration (9.81 m/s/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, the maximum height ( Hm ), and the time it takes
for the ball to return to its reference location ( tr ) as listed below:
tm=V(0)/g
Hm=V(0)^2/(2g)
tr=2V(0)/g
Write a program to:
read the initial velocity of the ball from the keyboard and calculate tm , Hm,
and tr and 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; test the program
for t = 15 sec.
Make sure to submit a flowchart with the print of the program and sample
(s) of the outputs
Question 2
Write a program to read the radius of a circle from the keyboard and to
compute the diameter, circumference, and area of the circle based on the
following expressions.
Diameter=2(Radius)
Circumference= pi(Diameter)
Area=pi (Radius)(Radius)=pi(Radius)^2
The program output should print the radius and the calculated properties of
the circle
to the screen as indicated below
(1) Properties of a circle with Radius XXXX.XXX:
(2)Circumference=XXXX.XXXX
(3)Area=XXXX.XXXX
sunmit a copy of the program file and a sample of its input/output data. Please use " Cin" and "court "
I mean, this is Algorithm development.
I mean I want to c++ program and I have use visusal C++/
Also, my text book is Engineering problem solving with C++
Question1
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=V(0) - (g)t
H=V(0)t-(g/2)t^2
Here Vo is the initial upward velocity, g is the earth gravitational
acceleration (9.81 m/s/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, the maximum height ( Hm ), and the time it takes
for the ball to return to its reference location ( tr ) as listed below:
tm=V(0)/g
Hm=V(0)^2/(2g)
tr=2V(0)/g
Write a program to:
read the initial velocity of the ball from the keyboard and calculate tm , Hm,
and tr and 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; test the program
for t = 15 sec.
Make sure to submit a flowchart with the print of the program and sample
(s) of the outputs
Question 2
Write a program to read the radius of a circle from the keyboard and to
compute the diameter, circumference, and area of the circle based on the
following expressions.
Diameter=2(Radius)
Circumference= pi(Diameter)
Area=pi (Radius)(Radius)=pi(Radius)^2
The program output should print the radius and the calculated properties of
the circle
to the screen as indicated below
(1) Properties of a circle with Radius XXXX.XXX:
(2)Circumference=XXXX.XXXX
(3)Area=XXXX.XXXX
sunmit a copy of the program file and a sample of its input/output data.
Explanation / Answer
//Program 1
#include<iostream.h>
int main()
{
float vo,g,v,h,t;
float hm,tm,tr;
v=h=vo=hm=tm=tr=t=0.0;
g=9.81;
cout<<" Enter initial velocity :";
cin>>vo;
tm=vo/g;
hm=(vo^2)/2g;
tr=2*tm;
cout<<"Maximum height :"<<hm;
cout<<"Time to reach Maximum height :"<<tm;
cout<<"Total time :"<<tr;
cout<<" Enter time :";
cin>>t;
v = vo - gt;
h = ((v^2) - (vo^2))/(2*g);
cout<<" Velocity at"<<t<<":"<<v;
cout<<" Height at"<<h<<":"<<v;
return 0;
}
//Program 2
#include<iostream.h>
#define PI 3.14
int main()
{
float radius,circumference,area;
cout<<" Enter radius";
cin>>radius;
circumference = radius*2*PI;
area = PI*(radius^2);
cout<<"Properties of a circle with radius :"<<radius;
cout<<" Circumference:"<<circumference;
cout<<" Area:"<<area;
return 0;
}
The program will run on any standard c++ compiler including visual c++, now for your outputs, run these programs with the sample input values, and once u get the output , press the PrntSc button to get a screen shot and paste it in paint or any iamge editor and save it.