problem with my project

hello..i have problem with my project...when i compile its no error but have 1 warning...and when i want debug it, it become not responding...i dont know why..i have to finish it for my assignment and only left 4 day before submit it..hope u all can help me


#include<iostream.h>
void main ()
{
float data='y', menucode, quantity, price, total_price_per_order,
count_customer, gov_tax, ser_tax, charged;
int count=0;
int customer=0;
int actual_price=0;
int total_price=0;
int total=0;
while (data == 'y')
{
cout << " enter the menucode ";
cin >> menucode;
cout << " enter quantity ";
cin >> quantity;

if (menucode == 'k')
price = 7.50;
else if (menucode == 'r')
price = 16.40;
else
price = 28.90;
//endif
//endif

total_price_per_order = price*quantity;
count_customer = count++ ;
gov_tax = 0.05;
ser_tax = 0.10;
charged = ser_tax + gov_tax;
actual_price = charged + total_price_per_order;
total_price = actual_price*count_customer;
}
cout << " total price " << total << endl;
cout << " any customer?? (Y/N)" << customer << endl;
cout << " invalid menucode" ;
}

warning that i got

Warning ASGMT3(1.CPP 41: 'total_price' is assigned a value that is never used in function main()

Last edited on
It means exactly what it says. The variables total_price, total_priceM, total_priceR, and total_priceK are never used in the program. The warning is harmless, so you can choose to ignore it, but you are doing useless things.
*grumble*

Just so you know, main() should never be void. I'd change that because while some compilers let it slide, it is not (AFAIK) proper C++.

-Albatross
Topic archived. No new replies allowed.