Question
1. Greet the user with the message, Welcome to our Class 2. Ask the user: What is your name? 3. Ask the user: What
1. Greet the user with the message, "Welcome to our Class"
2. Ask the user: "What is your name? "
3. Ask the user: "What is the length (inches) of the side of cake1 square layer? "
4. Ask the user: "What is the height (inches) of cake1 square layer? "
5. Ask the user: "What is the length (inches) of the side of cake1 hexagon layer? "
6. Ask the user: "What is the height (inches) of cake1 hexagon layer? "
7. Ask the user: "What is the diameter (inches) of cake1 circular layer? "
8. Ask the user: "What is the height (inches) of cake1 circular layer? "
9. Ask the user: "What is the diameter (inches) of cake2 bottom layer? "
You need this because the height of cake2 depends on this parameter (youll see when you do the math).
10.In order to calculate the amount of icing we need, compute the total surface area of cake1 (every surface that we must put icing on, including all sides of the layers). Display the result to the user in both square inches and square meters.
11.In order to calculate the amount of ingredients we need, compute the volume of cake1, and display it to the user in both cubic inches and cubic meters.
12. Compute and display to the user the ratio of the volume of each layer to the volume of cake1.
13. Compute and display to the user the height of cake2 in both inches and meters.
14. Compute and display to the user the total surface area of cake2 in both square inches and square meters.
15. Compute and display to the user the volume of cake2 in both cubic inches and cubic meters. If you got this correctly, the result should be the same as in #11 above.
16. Tell the user to enjoy their cake!
Allowed
Restrictions Allowed things: Any arithmetic operators are all fine to use, such as +, -, *, /, %, and, or, >=,
The following data types, and their casting functions: int, float, string, bool. No others. These functions: input(), print(), round()
Note: Not everything listed above is needed for the assignment.
restrictions
You may not import other modules (like math) or write your own functions. No data types omitted from the "Allowed things" section above may be used. You may not use string formatting operations and related functionality No branching (if statements), or loops (for/while), or any other feature we havent yet covered in class.
Example of finished code and how it needs to look (format) like at the end : answers are derived from inputted values:
Note some answers are inside a parenthesis with no space at the beginning followed by inches or meters
please stick to this demo example to verify validity of the code as this is how its supposed to look like after the program is executed, thanks .
Help to Write a python program Please note how an example of how its supposed to look like is shown at the end is shown Please note that some final answers highlighted in red are printed in between the parenthesess The first part of this assignment is to do some calculations in order to figure out the ingredients you'll need for the wedding cake depicted in Figure 1. You will ask the user to enter the dimensions of the cake, then you'll use Python to do some calculations, and last you're going to print the results. In the second part you're trying to answer the question "What if I use the same ingredients to make a different wedding cake?". Given the exact same amount of ingredients (i.e. volume) you just calculated for the first cake, you want to figure out the dimensions that the wedding cake in Figure 2 would have Figure 1 Figure 2 The first cake has three layers with each one having a different top view: the bottom is a square, the middle is a hexagon, and the top is a circle. The height of each layer may vary. The second cake has three layers with a top view of concentric circles. All three layers have the same height. The diameter of the middle layer is 20% larger than the top layer, and the diameter of the bottom layer is 25% larger than the middle layer. Cake decoration (flowers, engraving, etc.) doesn't count in our calculations for this assignment. Note some answers are inside a parenthesis with no space at the beginning followed by inches or meters Welcome to CS 112 What's your name? Random Name What is the length (inches) of the side of cake1 square layer? 20 What is the height (inches) of cake1 square layer? 7 What is the height (inches) of cake1 hexagon layer? 6 What is the diameter (inches) of cake1 circular layer? 11 What is the height (inches) of cake1 circular layer? 5 What is the diameter (inches) of cake2 bottom layer? 15 First cake * surface area: 1420.7875 sq. inches (0.9166 sq. meters). * volume: 4272.8268 cu. inches (0.07 cu. meters). * ratios: 0.6553 0.2335 0.1112 Second cake * total height: 34.7996 inches (0.8839 meters). * surface area: 1525.0691 sq. inches (0.9839 sq. meters). * volume: 4272.8268 cu. inches (0.07 cu. meters). Enjoy your cake Random Name Input Final answersStep 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