c++ beginner
DiggBlinkRedditDeliciousTechnorati
question by darknapster | Easy
I'm working on a program for my c++ class and i keep getting errors that I cannot figure out.
The code is:
// This program calculates the tax and total of a food bill.
#include <iostream>
using namespace std;
int main ()
{
double cost, tax, x, y, taxrate, tiprate, total, tip;
// Get the food bill cost.
cout << "What is the total ammount of the bill?";
cin >> cost;
// Get the tax percent to be added to the bill.
cout << "What is the tax rate to be added to the ammount of the bill? (percent)";
cin >> tax;
// Calculate the taxrate.
taxrate = tax / 100;
// Calculate the tax.
x = cost * taxrate;
// Get the tip percent to be added to the bill.
cout << "What is the percent of the tip to be added to the bill? (percent)";
cin >> tip;
// Calculate the tipammount.
tiprate = tip / 100;
// Calculate the tip.
y = cost * tiprate;
// Calculate the total.
total = cost + x + y;
// Display the total.
cout >> "The total of the bill is $" << total << endl;
return 0;
}
Can i please have any suggestions of how to fix my program?
Post reply
Subscriptions
Got a C++ Question?
Just Sign Up and ask the top C++ experts!
|