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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

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

Post 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 28 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 . .
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply