How I Could make it a program.

Here::

Treyson Mobley want a program that calculates and display the amount he should tip a waiter at a restautant. The program should subtract any liquor change form the total bill and then calculate the tip <using a percentage > on the remainder.


please help me out of this simple exercise..
im a beginner and seeking for help..


pleas make a program and ill try to run and compile it on dev-C
Last edited on
pleas make a program and ill try to run and compile it on dev-C


1
2
3
4
5
#include <iostream>

int main(){
	std::cout << "check out http://www.cplusplus.com/reference/";
}
thankYou For the refferences.. but i dont really understand how to analyzed..the problem and solve it our instructor ask us to compile it and run using the problem given above.. im so shy joining this group only for seeking help. :)
There's no need to be shy about seeking help but we won't do your homework for you. YOu need to show some effort by posting your attempt and then you will get guidance to make it work if you have difficulties.

Psuedo-code:

Prompt for total bill and call it tot
Prompt for liquor charge and call it liqchrg
Prompt for tip percentage and call it tip
Calculate result res = (tot - liqchrg) * tip
Print result std::cout << res

study the tutorials here [http://www.cplusplus.com/doc/tutorial/], do what you can, and post your work if you can't make it work...
How about this?? is this correct???



#include<iostream>
using namespace std;

int main()
{
double tot,liqchng,tip,res;
cout<<"Enter Total Bill\n";
cin>>tot;
cout<<"Enter Liquor Change\n";
cin>>liqchng;
tip=tot-liqchng
cout<<"The Total Tip is:" <<tip <<endl;


res=(tot-liqchng)*tip
cout<<"The Result is:" <<res <<endl;
system("pause");
return 0;
}



But this two line has an error

line
12 and 14

cout<<"The Total Tip is:" <<tip <<endl;
cout<<"The Result is:" <<res <<endl;


^_^ hope some one would hep me^_^\

What do the errors say?
In line 11 and 15 semicolon is missing ;
tip=tot-liqchng res=(tot-liqchng)*tip
thankyou! Ive already solved the problem.
Topic archived. No new replies allowed.