Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please make sure it works I\'ve been struggling with this and so far every answe

ID: 3783891 • Letter: P

Question

Please make sure it works I've been struggling with this and so far every answer I've got back is wrong. l. Input an integer value altitude and use a loop to write your own graphics program 'fall.cpp' that produces a graphic representation of falling object (e.g. circle). An object has initial downward velocity 0. Each second, it's velocity increases by 32 ft/sec Plot the descent of the falling object. Note that terminal velocity is 174 ft/sec so the object's velocity cannot exceed that speed. Now modify your program to read an integer variable secondstoopen to open a parachute after n seconds. Assume the velocity decreases by 100 ft/sec after the chute opens until the downward velocity hits 17 ft/sec. Note that outside the bottom of the loop is the code for where the chutist has landed put a message there. (use C++ code please)

Explanation / Answer

#include <cstdlib>
#include <iostream>

using namespace std;

void fuel(float & dist);
void distance(float dist, float & time, float & time2 );
void Altitude(float time, float time2, float altlevel);
void Climb_Descend(float altlevel);

int main(int argc, char *argv[])
{
float altlevel;
float dist;
int fuelcon;
float speed=300, altspeed;
char choice;
bool OK;




do
{

fuel(dist); //calls
distance(dist, speed, altspeed);
Altitude(speed, altspeed, altlevel);
Climb_Descend (altlevel);



cout <<"do you want to calaculate again?"<<endl;
cout<<"enter Y or N"<<endl;
cin>>choice;

if(choice=='Y' || choice=='y')
{
OK=true;
}
else
OK=false;

}
while (OK==true);



system("PAUSE");
return EXIT_SUCCESS;
}

void fuel (float & dist) //function
{
cout<<"Enter the distance of flight "<<endl;
cin>>dist;



}

void distance(float dist, float & time, float & time2)
{
time = dist/300; // Speed is constant 300mph
time2 = (time - 0.30)*60; //30 minutes is needed to get to the top level

cout<< " the flight will last "<<time<<" hours "<<endl; // output
}

void Altitude(float time, float time2, float altlevel) //function
{
float Level1,Level2,Level3,Level4,Level5,Level6,Level7,Level8,Level9; // each level goes from 0 to 40,000 feet,

float climb, descend, topFly;
int min;

min = 10;

Level1 = 12,5 * min;
Level2 = 11,33 * min;
Level3 = 10,25 * min;
Level4 = 9.08 * min;
Level5 = 7.91 * min;
Level6 = 6,83 * min;
Level7 = 5,66 * min;
Level8 = 4,5 * min;
Level9 = 3,33;

climb = (Level1 + Level2 + Level3 + Level4 + Level5 + Level6 + Level7 + Level8) * 1.4;
topFly = Level9*time2;

descend = (Level1 + Level2 + Level3 + Level4 + Level5 + Level6 + Level7 + Level8 ) * 0.9;

altlevel = climb + descend + topFly;


}

void Climb_Descend (float altlevel ) {
cout <<altlevel;

}