Question: Program 4: Create a program named hw1-4.py that asks the user to enter how many eggs a restaurant used in the previous month see sample

Program 4:

Create a program named hw1-4.py that asks the user to enter how many eggs a restaurant used in the previous month see sample run below. Based on this user input, calculate and display how many cartons of eggs the restaurant should order for next month assuming a dozen eggs are in a carton. Test the program with 100 eggs as user input. To show you the many ways in which programming languages have to and can handle numeric data and calculations, display the output three ways as shown in the sample run below. 8.333333333333334 was outputted raw with no formatting. The next line with the first 9 in it was outputted using a math built-in function. The last line of output with the second 9 in it was outputted without using the built-in math function, but instead using a formula.

Have the ability to Handle invalid input for the number of eggs used in the previous month (2 pts) Sample run:

How many eggs did the restaurant use last month? 100 Order 8.333333333333334 cartons of eggs next month. Order 9 cartons of eggs next month. Order 9 cartons of eggs next month.

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!