Professional Documents
Culture Documents
Assignment 2
Assignment 2
IPROGRAMMING FUNDAMENTAL
#include <iostream>
int main()
{
int milesPerGallon, tankCapacity;
cout << "This mean that you can drive " << tankCapacity * milesPerGallon << "
miles on a full tank." << endl;
return 0;
}
Q#2.13
#include <iostream>
int main()
{
double originalPrice, salesTaxRate, totalPrice, markupPercentage, salesTaxPrice,
markupPrice;
int main()
{
double hddSpecifiedSize, hddRealSize;
cout << "Hard Drive is actually: " << hddRealSize << "GB" << endl;
return 0;
}
Q#2.16
#include <iostream>
using namespace std;
#include <iostream>
using namespace std;
return 0;
}
Q#2.24
#include <iostream>
return 0;
}
Q#2.26
#include <iostream>
int main()
{
double
area,area1,area2,area3,area4,lengthdoor,widthdoor,lengthwindow,widthwindow,le
ngthbook,widthbook,lengthroom,widthroom,heightroom;
cout<<"enter the length of door:";
cin>>lengthdoor;
cout<<"enter the width of door:";
cin>>widthdoor;
cout<<"enter the length of window:";
cin>>lengthwindow;
cout<<"enter the width of window:";
cin>>widthwindow;
cout<<"enter the length of book:";
cin>>lengthbook;
cout<<"enter the width of book:";
cin>>widthbook;
cout<<"enter the length of room:";
cin>>lengthroom;
cout<<"enter the width of room:";
cin>>widthroom;
cout<<"enter the height of room:";
cin>>heightroom;
area1=lengthdoor*widthdoor;
area2=lengthwindow*widthwindow;
area3=lengthbook*widthbook;
area4=lengthroom*widthroom*heightroom;
area=area1+area2+area3+area4;
cout<<"total area"<<area<<endl;
cout<<"the amout of paint gallons are "<<area/120<<endl;
return 0;
}