You are viewing a single comment's thread. Return to all comments →
my program runs and gives the correct output but it's said to be incorrect. i do not know what i am doing wrong,any suggestions?Thank you in advance
/* Enter your code here. Read input from STDIN. Print output to STDOUT */ double mealCost; int tipPercent, taxPercent; double tip, tax, totalCost;
cin>>mealCost>>tipPercent>>taxPercent; //calculate tip and tax amounts tip = mealCost * ((double)tipPercent/100); tax = mealCost * ((double)taxPercent/100); //calculate total meal price totalCost = mealCost + tip + tax; double cost = round(totalCost); //display total meal price cout<<"The total meal cost is "<<cost<<" dollars"<<endl; return 0;
}
Seems like cookies are disabled on this browser, please enable them to open this website
Day 2: Operators
You are viewing a single comment's thread. Return to all comments →
my program runs and gives the correct output but it's said to be incorrect. i do not know what i am doing wrong,any suggestions?Thank you in advance
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
double mealCost; int tipPercent, taxPercent; double tip, tax, totalCost;
}