Advertisement
night

Fag

Dec 3rd, 2011
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.26 KB | None | 0 0
  1. #include<iostream>
  2. #include<string>
  3. using namespace std;
  4. /* Name: totalpurchase.cpp
  5. Program that shows total purchase.
  6. NIGHT THE FAGGOT
  7. */
  8.  
  9. int main()
  10. {
  11.         float price1,price2,price3,price4,price5,subtotal,tax,total;
  12.         int salestax;
  13.         string Answer;
  14.         do
  15.         {
  16.             cout<<"Enter price of first item." <<endl;
  17.             cin>>price1;
  18.             cout<<"Enter price of second item." <<endl;
  19.             cin>>price2;
  20.             cout<<"Enter price of third item." <<endl;
  21.             cin>>price3;
  22.             cout<<"Enter price of fourth item." <<endl;
  23.             cin>>price4;
  24.             cout<<"Enter price of fifth item." <<endl;
  25.             cin>>price5;
  26.             subtotal = price1 + price2 + price3 + price4 + price5;
  27.             cout<<"Enter sales tax." <<endl;
  28.             cin>>salestax;
  29.             tax = (subtotal * salestax / 100);
  30.             total = subtotal + tax;
  31.             cout<<"Your total purchase is:" <<endl;
  32.             cout<<"Item 1 - $" <<price1 <<endl;
  33.             cout<<"Item 2 - $" <<price2 <<endl;
  34.             cout<<"Item 3 - $" <<price3 <<endl;
  35.             cout<<"Item 4 - $" <<price4 <<endl;
  36.             cout<<"Item 5 - $" <<price5 <<endl;
  37.             cout << endl;
  38.             cout <<"Subtotal - $" <<subtotal <<endl;
  39.             cout <<"Tax - $" <<tax <<endl;
  40.             cout <<"Total - $" <<total <<endl;
  41.             cout<<"Do you wish to continue?(y/n)"<<endl;
  42.             cin>>Answer;
  43.         } while ( Answer != "N" && Answer != "n");
  44.         return 0;
  45. }//end main
  46.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement