#include using namespace std; int main() { float meal, tax; cout << " Please insert the amount of your bill:
-
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:
#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!