Question: num _ pears and my _ money are read from input. A pear costs 3 dollars. If num _ pears is less than 3 ,

num_pears and my_money are read from input. A pear costs 3 dollars.
If num_pears is less than 3, then output 'num_pears requires at least 3 to purchase.'
If num_pears is greater than or equal to 3, then assign total_cost with the product of num_pears and 3.
If total_cost is less than or equal to my_money, then output 'Successful purchase!'
Otherwise, output 'Need more money to purchase all.'
If num_pears is greater than 31, then output 'Restocking soon.'

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 Databases Questions!