Question: Design programs in Python to complete the following two tasks. Program 1 . Write a program that asks the user for the number of males

Design programs in Python to complete the following two tasks.
Program 1.Write a program that asks the user for the number of males and the number of females registered in a class. The program should display the percentage of males and females in the class.
Hint: Suppose there are 8 males and 12 females in the class. The percentage of male should be 8/(8+12)=0.4, and it should be displayed as 40%. And the percentage of female should be calculated and displayed as 60%.
Program 2.Ingredient Adjuster Program:A cookie recipe calls for the following ingredients:
1.5 cups of sugar
1 cup of butter
2.75 cups of flour
The recipe produces 48 cookies with these amounts of the ingredients. Design a program that asks user how many cookies he or she wants to make, and then displays the number of cups of each ingredient needed for the specifiednumber of cookies.
For example, if user wants to make 24 cookies, the user needs 0.75 cups of sugar, 0.5 cups of butter, and 1.375 cups of flour.

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!