Answer to Question #244316 in C++ for Urooj

Question #244316

Write a program that follows the below rules: Scenario 1:Your friend is going to be another 15 minutes or more

Result: If you have more than 5 AED in change, go buy a coffee, otherwise go for a walk around the town


Scenario 2: Your friend is going to with you in less than 15 minutes

Result: Sit in the food zone and wait


1
Expert's answer
2021-09-29T10:27:12-0400
#include <iostream>
using namespace std;


int main(){




	int minutes;
	float change;
	cout<<"Enter number of minutes: ";
	cin>>minutes;
	if(minutes>=15){
		cout<<"Enter change: ";
		cin>>change;
		if(change>=5){
			cout<<"Go buy a coffee\n";
		}else{
			cout<<"Go for a walk around the town\n";
		}
	}else{
		cout<<"Sit in the food zone and wait\n";
	}
	cin>>change;
	return 0;


}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS