#include<iostream> using namespace std; int main () { itemOne = 12.95, itemTwo =
ID: 3609421 • Letter: #
Question
#include<iostream>
using namespace std;
int main ()
{
itemOne = 12.95, itemTwo = 24.95, itemThree = 6.95, itemFour= 14.95, itemFive = 3.95, SubTotal = 63.75, SalesTax = SubTotal*6%,Total = SubTotal + SalesTax ;
cout << "Item1 is $"<< itemOne << endl;
cout << "Item 2 is $"<< itemTwo <<endl;
cout << "Item 3 is $"<< itemThree <<endl;
cout << "Item 4 is $"<< itemFour <<endl;
cout << "Item 5 is $"<< itemFive <<endl;
cout <<"SubTotal $" << SubTotal << endl;
cout << SalesTax << endl;
cout << "Total$" << Total << endl;
return 0;
}
Explanation / Answer
Please rate - thanks 1-left out the doubles (in red). 2-the computer does the arithmetic not you (calculation ofSubTotal) 3-computer doesn't know %. it has to be changed to decimal 4-the compiler I'm using needs the system("pause"); to prevent theDOS window with the answer from closing. 5-one or 2 other minor things, but 1-3 were the biggies #include using namespace std; int main () { double itemOne = 12.95, itemTwo =24.95, itemThree = 6.95, itemFour = 14.95; double itemFive = 3.95, SubTotal,SalesTax, Total; SubTotal = itemOne+itemTwo+itemThree+itemFour; SalesTax =SubTotal*.06; Total = SubTotal + SalesTax ; coutRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.