#include <iostream>
#include <string>
using namespace std;
int main()
{
double number;
cout<<"12.5:";
cin>> 12.5;
cout<<endl;
cout<< "The integer nearest to " << 12.5 << " = "
<< static_cast<int>(12.5 + 0.5); endl;
return 0;
}
#include <iostream>
#include <string>
using namespace std;
int main()
{
double originalprice;
double markeduppercentage;
double salestaxrate;
double sellingprice;
double salestax;
double finalprice;
cout<<"Enter the original price of the item: 12.00";
cin>> 12.00;
cout<<"Enter the marked up percentage: 100.0";
cin>> 100.0;
cout<<"Enter the sales tax rate: 8.0";
cin>> 8.0;
sellingprice = 12.00 + 12.00 * 100 / 100;
salestax = 24.00 * .8/ 100;
finalprice = 24.00 + .8;
cout<<"The original price = $12.00" << originalprice << endl;
cout<<"The price is marked up by" <<markeduppercentage
<<"100%" <<endl;
cout<<"The selling price = $24.00" <<sellingprice <<endl;
cout<<"The sales rate =8%" <<salestaxrate <<"%" <<endl;
cout<<"The sales tax = $0.80" <<salestax << endl;
cout<<"The final price = $24.80" <<finalprice <<endl;
return 0;
}
#include <iostream>
using namespace std;
int main ()
{
double test1, test2, test3, test4, test5;
double average;
cout<<"Enter five test scores: 60 85 100 100 100 ";
cin>> 60>> 85>> 100>> 100>> 100;
cout<< endl;
average = (60 + 85 + 100 + 100 + 100)/5.0;
cout<< "Average test score:89 " << average<< endl;
return 0;
}
This post has been edited by Karel-Lodewijk: 03 March 2012 - 03:34 PM
Reason for edit:: Added code tags, pls put yout code between [code] and [/code]

New Topic/Question
Reply



MultiQuote




|