Advertisement
Guest User

EZ4Ence coding4Ever

a guest
May 23rd, 2019
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.36 KB | None | 0 0
  1. #include <iostream>
  2.  
  3.  
  4. using namespace std;
  5. /* Number 2i
  6. int main ()
  7. {
  8.  
  9. float priceOri,markupPrice, salesTax;
  10. float finalPrice, taxAmount, sellingPrice;
  11.  
  12. cout << "\nEnter the original price been sold ";
  13. cin >> priceOri;
  14.  
  15. cout << "\nEnter the percentage of mark-up price ";
  16. cin >> markupPrice;
  17.  
  18. cout << "\nEnter the percentage of sales tax rate ";
  19. cin >> salesTax;
  20.  
  21. sellingPrice = priceOri + (priceOri * markupPrice);
  22. taxAmount = sellingPrice * salesTax;
  23. finalPrice = taxAmount + salesTax;
  24.  
  25. cout << "Here We go\n"<<priceOri <<endl<<markupPrice<<endl<< salesTax;
  26. cout << "\n Selling Price : "<<sellingPrice;
  27. cout << "\n Tax Amount : "<<taxAmount;
  28. cout << "\nFinal Price : "<<finalPrice;
  29.  
  30.  
  31.  
  32. return 0;
  33. }
  34. */
  35.  
  36. /* Number 3
  37. int main ()
  38. {
  39. const float cost_liter = 0.38, pro_carton = 0.27;
  40.  
  41. int carton;
  42. float ttl_milk, cost, profit;
  43.  
  44. cout << " Enter the total amount of milk produced in the morning ";
  45. cin >> ttl_milk;
  46. carton = ttl_milk/3.78;
  47. cout << "\n Carton that needed to hold milk "<<carton;
  48. cost = ttl_milk * cost_liter;
  49. cout << "\n Cost of producing milk "<<cost;
  50. profit = carton * pro_carton;
  51. cout << "\n Profit of producing milk "<<profit;
  52.  
  53. return 0;
  54. }
  55. */
  56.  
  57. int main ()
  58.  
  59. {
  60. const int i = 1;
  61. int hrs1, hrs2, hrs3, hrs4, hrs5, hrs6, hrs7;
  62. float income1,income2, income3, income4,income5,income6,income7;
  63. float income_bef, income_after;
  64.  
  65.  
  66. cout << " Enter the number of hours work in week1 ";
  67. cin >> hrs1 ;
  68.  
  69. cout << " Enter the number of hours work in week2 ";
  70. cin >> hrs2 ;
  71.  
  72. cout << " Enter the number of hours work in week3 ";
  73. cin >> hrs3 ;
  74.  
  75. cout << " Enter the number of hours work in week4 ";
  76. cin >> hrs4 ;
  77.  
  78. cout << " Enter the number of hours work in week5 ";
  79. cin >> hrs5 ;
  80.  
  81. cout << " Enter the number of hours work in week6 ";
  82. cin >> hrs6 ;
  83.  
  84. cout << " Enter the number of hours work in week7 ";
  85. cin >> hrs7 ;
  86.  
  87. income1 = 15.50 * hrs1;
  88. income2 = 15.50 * hrs2;
  89. income3 = 15.50 * hrs3;
  90. income4 = 15.50 * hrs4;
  91. income5 = 15.50 * hrs5;
  92. income6 = 15.50 * hrs6;
  93. income7 = 15.50 * hrs7;
  94.  
  95. income_bef = income1+income2+income4+income5+income6+income7;
  96. cout << " Income Before Tax : RM" <<income_bef;
  97.  
  98. income_after = income_bef - (income_bef * (14/100 ));
  99. cout << "\n Income After Tax : RM" <<income_after;
  100.  
  101.  
  102. return 0;
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement