// Jeremy Huang CS1A Chapter 2, Pp. 81, #3
/*****************************************************************************
* COMPUTE TOTAL SALES TAX
* ____________________________________________________________________________
* This program calculates the amount of sales tax made on a purchase. The user
* inputs the cost of the item, the state sales tax, and the county sales tax
* in which the program takes those sales taxes and applies it to the item to
* determine the tax amounts. The program then sums the state tax and county
* tax to determine the total sales tax on the purchase.
* ___________________________________________________________________________
* INPUT
* cost : cost of the item
* stateTax : the states sales tax
* countyTax : the countys sales tax
*
* OUTPUT
* totalTax : sum of the state tax and the county tax on the purchase
*
* **************************************************************************/
#include <iostream>
using namespace std;
int main() {
//Declaring variables
int cost = 52;
float stateTax = 0.04;
float countyTax = 0.02;
//Computing total tax through sum of both taxes
float totalTax = (cost*stateTax)+(cost*countyTax);
//Output
cout<<"The total tax on the $"<<cost<<" purchase is $"<<totalTax<<".";
//End program
return 0;
}
Ly8gSmVyZW15IEh1YW5nICAgICAgICAgICAgICAgICAgQ1MxQSAgICAgICAgICAgICAgICBDaGFwdGVyIDIsIFBwLiA4MSwgIzMKIAovKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKICogQ09NUFVURSBUT1RBTCBTQUxFUyBUQVgKICogX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwogKiBUaGlzIHByb2dyYW0gY2FsY3VsYXRlcyB0aGUgYW1vdW50IG9mIHNhbGVzIHRheCBtYWRlIG9uIGEgcHVyY2hhc2UuIFRoZSB1c2VyCiAqIGlucHV0cyB0aGUgY29zdCBvZiB0aGUgaXRlbSwgdGhlIHN0YXRlIHNhbGVzIHRheCwgYW5kIHRoZSBjb3VudHkgc2FsZXMgdGF4CiAqIGluIHdoaWNoIHRoZSBwcm9ncmFtIHRha2VzIHRob3NlIHNhbGVzIHRheGVzIGFuZCBhcHBsaWVzIGl0IHRvIHRoZSBpdGVtIH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