Question: dollar _ amount is read from input. Write multiple if statements: If dollar _ amount is greater than or equal to 1 1 , then

dollar_amount is read from input. Write multiple if statements:
If dollar_amount is greater than or equal to 11, then output 'Buy a hat.'
If dollar_amount is greater than or equal to 24, then output 'Buy a new coat.'
If dollar_amount is less than 2, then output 'Save money.'
Click here for examples
Ex 1: If the input is 13, then the output is:
Buy a hat.
Ex 2: If the input is 29, then the output is:
Buy a hat.
Buy a new coat.
Ex 3: If the input is 1, then the output is:
Save money.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!