Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Programming Assignment 2 Ideal Projectile Motion In this project you will build a computer model of a projectile that is fired with an initial angle

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Programming Assignment 2 Ideal Projectile Motion In this project you will build a computer model of a projectile that is fired with an initial angle a and initial speed va. In this model you will assume air resistance is negligible and that the only external force acting on the projectile is the force of gravity. In this case the graph of the trajectory will be a parabola. The way you will represent the trajectory is with a display of X.y-coordinates of the position of the projectile. The x.y-coordinates will be generated from the time of flight of the projectile. For example, if at time 10 seconds the x-coordinate was 100 and the y-coordinate was 150 then the ordered pair (100,150) would be on the graph of the trajectory. You are to write this program as a C++ program. You should use the iostream include. Your program should use the cout for diplaying output and cin to accept as input the initial angle of elevation a, the initial speed vo and the gravity constant g (9.8 if initial speed is in meters per second or 32 if the initial speed is in feet per second). Your program should be structured as follows. 1. Your program should start by requesting from the user the initial firing angle, initial speed, and g. 2. The program should then call a void function that receives the initial speed, initial angle, and g and prints out the following header part of your report. Name: CSC-210 Programming Assignment-2 Ideal Projectile Motion Initial firing angle: ### Initial Speed: ####### Maximum height: ###########.## Flight Time: #######.## Range: ############### (Round to nearest whole number) Trajectory values Time in Seconds x-coordinate y-coordinate 3. The program should then start a loop on seconds from 0 to the nearest second of the time of flight. 4. On each iteration of the loop the program should call a void function called calculate TrajCoordinate passing, by value, the firing angle, the initial speed and the time in seconds, returning. by reference, the x-coordinate, and y-coordinate of the projectile at time t. 5. Once the function returns the x-coordinate and y-coordinate the program should print out the trajectory information as

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

Step: 3

blur-text-image

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

Students also viewed these Databases questions

Question

Discuss consumer-driven health plans.

Answered: 1 week ago