Question
basic python programming. No loops, if statements, list. 4.Write a program that reads in the radius and length of a cylinder and computes the area
basic python programming.
No loops, if statements, list.
4.Write a program that reads in the radius and length of a cylinder and computes the area and the volume using the following formulas (use PI = 3.141):
area = radius X radius X
volume = area X length
Here is a sample run
Enter the radius of a cylinder: 5.5
Enter the length of a cylinder: 12
The area is 95.01525
The volume is 1140.183
5.A company has determined that its annual profit is about 24 percent of total sales.
Write a program that asks the user to enter the projected amount of total sales, then displays the profit that will be made from that amount.
(hint: Use the value .24 to represent 24% profit margin)
Formula for profit = projected total sales X profit margin
Here is a sample run
Enter the projected total sales : 1250.00
The profit made from this amount : 300.00
6. A cookie recipe calls for these ingredients 1.5 cups of sugar 1 cup of butter 2.75 cups of flour
The recipe produces 48 cookies with this amount of the ingredients.
Write a program that asks the user how many cookies he or she wants to make, then displays the number of cups of each ingredient needed for the specified number of cookies.
See input/output below.(hint : constants)
Here is a sample run(blue user input):
Enter the number of cookies: 56
To make 56.0 cookies, you will need: #this is the output, run program 4 more times with
1.75 cups of sugar #different number of cookies as test cases
1.17 cups of butter
3.21 cups of flour >>>
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started