0
C++ Sales Tax HELP
Hello I am trying to find the TotalCost but the only answer it is giving me is 0 can anyone please help??? this is for C++ by the way //C++ Program Total Sales Tax //Gabriel Reyes January 7, 2022 CIS-5 #include <iostream> using namespace std; int main() { //declared variables double Purchase = 52.0; double StateTax = 0.07; double CountyTax = 0.02; double TotalCost = 0.0; //input section cout << "Total Sales Tax is" << TotalCost << endl; //processing section TotalCost = CountyTax * Purchase * StateTax; //output section }
4 Answers
0
#include <iostream>
using namespace std;
int main()
{
//declared variables
double Purchase = 0.0;
double StateTax = 0.0;
double CountyTax = 0.0;
double TotalCost = 0.0;
//input section
cin>>Purchase>>StateTax >>CountyTax;
//e.g 52.0>>0.07>>0.02
//processing section
TotalCost = CountyTax * Purchase * StateTax;
//output section
cout << "Total Sales Tax is " << TotalCost << endl;
}
// You did cout first before doing any processing
// This is the correct solution
0
I really didnt think i would get an answer right away thank you so much!!
0
would 0.0728 be the answer? I am trying to look for the total cost: 52 is cost and 0.07 and 0.02 are the tax
0
I think you should add Purchase, CountyTax and StateTax instead of multiplying.