#include <cstdlib>
#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
/*
*
*/
int main(int argc, char** argv) {
double meal_one;
double tip;
double tip_dol;
double total_meal;
double calc_tip;
double expen;
while(meal_one>=0)
{
cout << "Enter cost of meal: $";
cin >>meal_one;
if(meal_one>=0)
{
cout <<"Enter tip percentage: ";
cin>>tip;cout<<"percent"<<endl;
tip_dol=(tip/100)*meal_one;
cout << fixed <<setprecision(2)<< "Calculated Tip = $"<< tip_dol<<endl;
expen=meal_one+tip_dol;
cout<< fixed <<setprecision(2)<<"Total expenditure = $"<< expen << endl;
cout<<endl;
}
else{
cout << "Thank you for visiting the Zatoichi Sushi Hut!"<<endl;
}
}
return 0;
}
I need to write code so that when the user enters the tip amount, the system will assign a % symbol right after it. I have included my code the line that i am asking about is the first two right after the if statement.
Thank you!