Question: num _ chickens and num _ dollars are read from input. A chicken costs 1 0 dollars.If num _ chickens is less than 6 ,

num_chickens and num_dollars are read from input. A chicken costs 10 dollars.If num_chickens is less than 6, then output 'Please purchase at least 6.'If num_chickens is greater than or equal to 6, then assign total_cost with the product of num_chickens and 10.If total_cost is less than or equal to num_dollars, then output 'Successful purchase!'Otherwise, output 'Not all chickens purchased.'If num_dollars is greater than or equal to 10, then output 'At least one item was purchased.'Click here for examplesEx 1: If the input is:3,25then the output is:Please purchase at least 6.Ex 2: If the input is:21,215then the output is:Successful purchase!At least one item was purchased.Ex 3: If the input is:10,61 then the output is:Not all chickens purchased.At least one item was purchased.

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!