Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help coding this in python cant seem to figure it out 1. Set the console title: Program Name Your Name 2. Prompt the

I need help coding this in python cant seem to figure it out

1. Set the console title: "Program Name Your Name"

2. Prompt the user to enter the diameter of a pizza in inches. Pizza diameters can be entered as real numbers. Ensure that the user input is numeric using try except or other means.

3. When the user input is numeric, use a conditional statement to check if the diameter entered is within the range of 8" to 24" inclusive.

4. When the diameter entered is not numeric (i.e. cannot be parsed into a usable numeric value), display an error message indicating the problem.

5. When the diameter entered is numeric but outside of the allowable range, display an error message indicating that the input must be between 8" and 24".

6. Do not allow any processing to continue if the user input is not a valid diameter.

7. When the diameter entered is valid, determine the number of slices to cut the pizza in using an if elif else decision structure based on the following: A diameter of less than 12" cut in 6 slices. A diameter of 12" up to less than 14" cut in 8 slices. A diameter of 14" up to less than 16" cut in 10 slices. A diameter of 16" up to less than 20" cut in 12 slices. A diameter of 20" or over, cut in 16 slices.

8. Calculate the area of the pizza using this formula: = () 2 Hint: Import the math module by typing: import math and then get the value of by typing: math.pi

9. Calculate the area of each slice 10. Display the final result as a formatted string message including the original pizza diameter in inches and the number of slices, to be cut from that pizza as well as the area of the pizza and of each slice as a real number rounded to 2 decimal places. The format should match the example as closely as possible. (bonus marks opportunity if the angle of each slice of the pizza is also displayed more info) 11. Prompt the user to press Enter to end the application and end the application when the user presses Enter.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases And Information Systems 23rd European Conference Adbis 2019 Bled Slovenia September 8 11 2019 Proceedings Lncs 11695

Authors: Tatjana Welzer ,Johann Eder ,Vili Podgorelec ,Aida Kamisalic Latific

1st Edition

3030287297, 978-3030287290

More Books

Students also viewed these Databases questions