fork download
  1. /**********************************************************************************
  2.  * PROGRAMMED BY : DAISY CONTRERAS
  3.  * CLASS : CSC 5
  4.  * SECTION : MW 2:20-5:30PM
  5.  * ASSIGNMENT : CHAPTER 2 QUESTION #3
  6.  *********************************************************************************/
  7.  
  8. #include <iostream>
  9. #include <string>
  10. using namespace std;
  11.  
  12. /**********************************************************************************
  13.  *
  14.  * COMPUTE A TOTAL AFTER SALES TAX
  15.  * ________________________________________________________________________________
  16.  * This program computes the total of county tax and sales tax and adds the result
  17.  * to a purchase. The end result is the total of a sale with taxes included.
  18.  * ________________________________________________________________________________
  19.  *
  20.  *INPUT
  21.  * state_sales_tax : The percentage of tax from the state
  22.  * county_sales_tax : The percentage of tax from the county
  23.  * total_sales_tax : The sum total from both the county tax and the state tax
  24.  * purchase : The purchase total from a sale transaction
  25.  * after_sales_tax : The total of a sale that is included with the state and
  26.  * county sales tax.
  27.  *
  28.  * OUTPUT
  29.  * after_sales_tax : The total of the purchase with taxes included
  30.  * *******************************************************************************/
  31.  
  32. int main()
  33. {
  34. float state_sales_tax; //INPUT - percent of the state's sales tax
  35. float county_sales_tax; //INPUT - percent of the county's sales tax
  36. float total_sales_tax; //INPUT - percent of both state and county sales tax added
  37. float purchase; //INPUT - total purchase without taxes
  38. float after_sales_tax; //INPUT - total purchase with taxes added
  39.  
  40. state_sales_tax = 0.04;
  41. county_sales_tax = 0.02;
  42. total_sales_tax = 0.06;
  43. purchase = 52;
  44. after_sales_tax = purchase + (purchase * total_sales_tax);
  45.  
  46. cout << after_sales_tax << endl;
  47. return 0;
  48. }
Success #stdin #stdout 0s 5328KB
stdin
Standard input is empty
stdout
55.12