Answered step by step
Verified Expert Solution
Question
1 Approved Answer
We are going to use our programming skills to compute the number of slices you can cut out of a cake of certain dimensions.
We are going to use our programming skills to compute the number of slices you can cut out of a cake of certain dimensions. Create your python file, following the instructions from the project basics file. Perform the following actions in your code (in exact order!), storing their answers as needed in variables. 1. Greet the user with the message, "Welcome to the Cake Slice Program! 2. Ask the user: "What kind of cake did you make? " 3. Ask the user: "How long is the cake in centimeters? " 4. Ask the user: "How wide is the cake in centimeters? " 5. Ask the user: "How long will you cut your slices in centimeters? " 6. Ask the user: "How wide will you cut your slices in centimeters? " 7. Compute the surface area of the cake, and display it to the user 8. Compute the number of pieces of cake that can be cut, and display it to the user. a. You should also determine the amount of cake area that the cake slices will consume, and display that as a percentage. 9. Compute the amount of cake that wasted by cutting it into slices, and display that to the user. a. You should also determine this number as a percentage of the total area of the cake, and display that to the user. 10. Compute the number of edge and center pieces in the cake, and display that to the user. a. Below, we assume that there will always be four edges of the sliced cake. Be sure that you don't double count the corner pieces! b. Ignore the wasted cake, and calculate edges/centers out of the rectangle of actual cake slices. 11. Tell the user to enjoy their cake! Assumptions In computer science exact formatting of input/output is like putting on socks with shoes, while people might not do it 100% of the time in their personal life, it is extremely unusual not to do it in a professional setting. Therefore, you will need to format your input/output exactly like the samples provided. As we are just starting to program, and don't even have if-else statements at our disposal, we will assume many things to make the project easier, though it makes the project slightly more artificial. You may assume the following: The user will always enter an integer when we ask for an integer, etc. Every number the user enters will be a positive number when testing this project. The length of a slice will be less than half the length of the cake. The width of a slice will be less than half the width of the cake. On "wasted cake:" For this project, assume that we start to cut the cake from one corner, and work our way down one side of the cake. When you reach the end of that side, you continue the same cutting process for the next row of cake. If you get to a point where there is a leftover amount of cake on any side (that is less than the size of the slice down that side) then you just throw away that leftover bit. If there is a leftover amount of cake on both sides, then you have to throw away the opposite corner of cake too! The number that you are figuring out for "wasted" cake is the total amount of cake that gets thrown away because it cannot be cut into a slice via this edge throwaway method. Restrictions You can ask for additional functionality to be allowed, but the chances are slim that we will approve it. The general theme is, the interesting parts of the assignment must be completed by the student, not built-in functions. Allowed things: Any arithmetic operators are all fine to use, such as +, -, *, /, %, and, or, >=, 95% that it's not allowed. 1
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Program welcome message printWelcome to the Cake Slice Program inputs type inputWhat kind of cake di...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