Page 1 of 1

#include using namespace std; int main() { float meal, tax; cout << " Please insert the amount of your bill:

Posted: Wed Apr 27, 2022 4:59 pm
by answerhappygod
Include Iostream Using Namespace Std Int Main Float Meal Tax Cout Please Insert The Amount Of Your Bill 1
Include Iostream Using Namespace Std Int Main Float Meal Tax Cout Please Insert The Amount Of Your Bill 1 (43.55 KiB) Viewed 29 times
#include <iostream> using namespace std; int main() { float meal, tax; cout << " Please insert the amount of your bill: "; cin>> meal; if (meal >=50) { tax = 6*meal; meal=meal+tax; } cout <<" Your total meal charge is: RM" << meal<<endl; } Modify the program to tell the user if a negative value is inserted. Sample Output: Please insert the amount of your bill: -20 Invalid Output Press any key to continue . .