Advertisement
Guest User

Untitled

a guest
Jun 25th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3.  
  4.  
  5. int main()
  6. {
  7. //define variables
  8. float item_price;
  9. float item_price2;
  10. float sales_tax_rate = 0.6;
  11. float sales_tax, total;
  12. float total_price;
  13.  
  14.  
  15.  
  16. cout<<"Enter the price item : " <<endl;
  17. cin>> item_price;
  18. cout<< "Enter the price item 2: "<<end1;
  19. cin>> item_price2;
  20. //calculations
  21.  
  22. total_price = ( item_price + item_price2);
  23. sales_tax = item_price * sales_tax_rate;
  24. total = total_price + sales_tax;
  25. //display the result;
  26. cout<< "The item Price is: " <<total_price<<endl;
  27. cout<< "The sales tax is: "<< sales_tax<<endl;
  28. cout<<" The total cost is "<<total<<endl;
  29.  
  30. system("pause");
  31. }
  32.  
  33.  
  34.  
  35. #include < iostream >
  36. using namespace std;
  37.  
  38. int main()
  39. {
  40. double length;
  41. double width;
  42. double area;
  43.  
  44. // inform user to enter data
  45. cout<< "Enter a value for length: " << endl;
  46. cin>>length;
  47. cout<<"Enter a value for width:" << endl;
  48. cin>>width;
  49. //calculations
  50. area= length * width;
  51. //display the results
  52. cout<<"The value of length is:" << length<<endl;
  53. cout<<"The value of width is:" << width<<endl;
  54. cout<<"The value of area is:" <<area<<endl;
  55.  
  56. system("pause");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement