#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int main () {
//initializing my variables
double mealcost;
float tax_percent, tip_percent, tax_total, tip_total, overall_total;
cout << "What is the cost of your meal?" << endl;
cin >> mealcost;
cout << "What percent tip would you like to leave?" << endl;
cin >> tip_percent;
cout << "What percent are you taxed?" << endl;
cin >> tax_percent;
tax_total = mealcost * (tax_percent/100);
tip_total = mealcost * (tip_percent/100);
overall_total = mealcost + tax_total + tip_total;
/*trying to take the overall total from the formula above and round it
to the nearest whole integer*/
round (overall_total);
cout << "What is the total cost of my meal? " << overall_total << endl;
return 0;
}
Whenever I run my code it compiles correctly and gives me the correct overall total, but the round function seems to not work. I input 12 dollars for the meal total, 8 percent tip, and 20 percent tax. The correct answer is $15.36, but I'd like to round it down to $15. Any help would be appreciated thanks.