P. 1
c++ report

c++ report

|Views: 16|Likes:
Published by Eileen Chai

More info:

Published by: Eileen Chai on Nov 03, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less

11/03/2011

pdf

text

original

#include <iostream>

#include <cmath>
#include <iomanip>
using namespace std;
int main()
{
//initialize the variable
int start,incre,end;
double alt=0,v=0,t=0,com=0,com!=0;
cout<<"#nter the starting time$ ";
cin>>start;
cout<<"#nter the increment time$ ";
cin>>incre;
cout<<"#nter the ending time$ ";
cin>>end;
//
//set% (&) used 'or preserve & slot 'or 'ollo%ing sentence
cout<<endl<<endl<<endl;
cout<<le't<<set% (&)<<"(eather";
cout<<set% (&)<<")allon";
cout<<set% (&)<<"*n'ormation"<<endl;
cout<<set% (&)<<"+ime";
cout<<set% (&)<<",eight";
cout<<set% (&)<<"-elocit."<<endl;
cout<<set% (&)<<"(hr)";
cout<<set% (&)<<"(m)";
cout<<set% (&)<<"(m/s)"<<endl<<endl;
'or(t=start;t<=end;t/=incre)
{
//calculations
alt=(001!2t2t2t2t)/(!2t2t2t)0(3402t2t)/(5002t)/!!0;
v=((001542t2t2t)/(362t2t)/(07602t)/500)/3600;
cout<<'i8ed<<setprecision(!)<<set% (&)<<t;
cout<<'i8ed<<setprecision(!)<<set% (&)<<alt;
cout<<'i8ed<<setprecision(6)<<set% (&)<<v<<endl;
//comparing the variables and stored them into another variable
i'(com<alt)
{
com!=t;
com=alt;
9
9
cout<<endl<<endl;
cout<<'i8ed<<setprecision(!)<<":a8imum ballon height is$ "<<com<<" m"<<endl;
cout<<'i8ed<<setprecision(!)<<"and it occured at$ "<<com!<<" hr"<<endl;
9

cout<<fixed<<setprecision(2)<<"and it occured at: "<<com2<<" hr"<<endl. cout<<fixed<<setprecision(2)<<"Maximum ballon height is: "<<com1<<" m"<<endl.cout<<endl<<endl. } .

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->