THE ZEPINT NETWORK

programmer assist

C++ C++ XML Feeds

C++ Questions C++ Solutions C++ Articles

C++ is an object-oriented programming (OOP) language that is viewed by many as the best language for creating large-scale applications. C++ is a superset of the C language. A related programming language, Java, is based on C++ but optimized for the distribution of program objects in a network such as the Internet. Java is somewhat simpler and easier to learn than C++ and has characteristics that give it other advantages over C++. However, both languages require a considerable amount of study.

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!

Search via Google

User Login

Email Address

Password

C++ Experts

Rank Expert Points
#1 Support@PA 500
This a list of the Top C++ experts, how many points do you have?

Leading Experts

Rank Expert Points
#1 frankzzsword 4600
#2 Bejaan 2900
#3 csfreak 1100
#4 Anurag 700
#5 keyvez 700
#6 nnarasimha 600
#7 Nakata 600
#8 martinig 600
#9 mastercomputers 400
#10 Huntress 150
#11 Adkron 150
#12 Yogesh 100
#13 lexxwern 100
#14 Mustan Khan 100
#15 poizn 100
This is a list of overall best performing experts, how many points do you have?