Question

CSC1101 TakeHome Lab02 (1),docx - Compatibility Mode Saved to this PC s Review View Help ρ Search 3. [11] You have been hired
Welcome to Projectile 0bjects! The object is launched at an initial velocity of: 10 m/s The angle is: 300 Time that the objec

C++ should be used

C++ should be used
CSC1101 TakeHome Lab02 (1),docx - Compatibility Mode Saved to this PC s Review View Help ρ Search 3. [11] You have been hired by Projectile Objects to create a calculator for various equations from kinematics. Suppose someone shoots an object and it does projectile motion with an angle of 30, 45 and 60 degrees to the horizontal. Choose it's initial velocity (ex. 10 m/s) find the maximum height it can reach, horizontal displacement and total time required for this motion. Here are the four equations you will be using: Your program should include the following steps: a. Calculate real valued vertical and horizontal velocity from initial velocity (hint: xVelocity initialVelocity*cos(angle); yVelocity initialVelocity*sin(angle), make sure you convert angle from degree to radians like so angle - angle pi/180); b. In vertical, do the following: i. Calculate the real value for time (hint: V-Vo + a*t → 0- yVelocity-gravity time - time- yVelocity/gravity, but since this is the time for half of the vertical motion, the real total time is time 2-time) ii. Calculate the real value for maximum height (hint: maxHeight 5 gravity" (.5 time), here we have to halve time because we are only considering the vertical displacement, not total distance traveled) c. In horizontal, do the following: i. Calculate the horizontal displacement (hint: X-Xo + Vo*t → maxLength-0+xVelocity time Use constant value for GRAVITY- 9.8 m/s/s, PI 3.1415 and for degree symbol char DEG char(167) (if you are using xcode, you can copy and paste your degree symbol into place of char( 167)). Output your results like so:
Welcome to Projectile 0bjects! The object is launched at an initial velocity of: 10 m/s The angle is: 300 Time that the object is in air: 1.02038 t Maximum height reached: 1.27544 m Horizontal displacement: 8.83684 m Welcome to Projectile Objects! The object is launched at an initial velocity of 10 m/s The angle is: 45° Time that the object is in air: 1.44304 1t Maximum height reached: 2.5509 Horizontal displacement: 10.2041 m Welcome to Projectile Objects! The object is launched at an initial velocity of: 10 m/s angle is: 60° Time that the object is in air: 1.76737 t Maximum height reached: 3.82639 m Horizontal displacement: 8.83731 m your program code here] If possible, format your oode 11ke this Font "Courier New" Bold
0 0
Add a comment Improve this question Transcribed image text
Answer #1

#include<iostream>
#include<cmath>
using namespace std;

int main()
{
   const double GRAVITY = 9.8,PI=3.1415;
   char DEG = char(167);
   int angles[3]={30,45,60};
   double t, maxH,v0=10,range,vx,vy,angle;
   for(int i=0;i<3;i++)
   {
       cout<<"Welcom3 to Projectile Objects!\n";
       cout<<"===========================\n\n";
       angle = angles[i]*PI/180;
       cout<<"The object is launched at\n";
       cout<<"The initial velocity of: "<<v0<<endl;
       cout<<"The angle is: "<<angles[i]<<DEG<<endl;
       vx=v0*cos(angle);
       vy=v0*sin(angle);
       t=vy/GRAVITY;
       cout<<"Time that the object is in air: "<<2*t<<" t\n";
       maxH=.5*GRAVITY*t*t;
       range=vx*2*t;
       cout<<"Maximum height reached: "<<maxH<<" m\n";
       cout<<"Horizontal displacement: "<<range<<" m\n\n";
   }
   return 0;
  
}

Welcom3 to Projectile Objects! The object is launched at The initial velocity of: 10 The angle is: 309 Time that the object i

Add a comment
Know the answer?
Add Answer to:
C++ should be used C++ should be used CSC1101 TakeHome Lab02 (1),docx - Compatibility Mode Saved to this PC s Review View Help ρ Search 3. [11] You have been hired by Projectile Objects to cre...
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
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