Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Assignment1A

///*********************************************
///Assignment1:FortuneTellerProgram
///Author:SerenePhongpandecha
///Description:Thisprogrampromptstheuserfortheirage,calculateshow
///oldtheuserwouldbeinayear,anddisplaysitonthescreen
///Status:Complete
///Date:24August2015
///*********************************************

#include<iostream>
usingnamespacestd

intmain()
{
intage
intnew_age
cout<<"\nPleaseenteryourage:"<<endl
cin>>age
new_age=age+1
cout<<"Nextyearyouwillbe"<<new_age<<"yearsold.\n"
cout<<"Thankyouforusingmyprogram!"<<endl

return0
}

Assignment1B
///*********************************************
///Assignment1:FindingAverage
///Author:SerenePhongpandecha
///Description:Thisprogramfindsanaverageoffivenumbers.
///Status:Complete
///Date:24August2015
///*********************************************
#include<iostream>

usingnamespacestd

intmain()
{
doubleaverage
intsum
inta,b,c,d,e

a=28
b=32
c=37
d=24
e=33

sum=a+b+c+d+e
average=sum/5.0
cout<<"Theaverageis"<<average<<".\n"
return0
}

Assignment1C
///*********************************************
///Assignment1:FindBytesofDifferentDataTypes
///Author:SerenePhongpandecha
///Description:Thisprogramfindsbytesofdifferentdatatypes
///Status:Complete
///Date:26August2015
///*********************************************
#include<iostream>

usingnamespacestd

intmain()
{
cout<<"Thesizeofintegertypeonthiscomputeris:"<<endl
cout<<sizeof(int)<<"Bytes\n\n"<<endl
cout<<"Thesizeofcharactertypeonthiscomputeris:"<<endl
cout<<sizeof(char)<<"Bytes\n\n"<<endl
cout<<"Thesizeoffloattypeonthiscomputeris:"<<endl
cout<<sizeof(float)<<"Bytes\n\n"<<endl
cout<<"Thesizeofdoubletypeonthiscomputeris:"<<endl
cout<<sizeof(double)<<"Bytes\n\n"<<endl

return0
}

You might also like