Chapter 11 homework – Challenge Yourself - Geometry Calculator The Program – Python Only! Complete programming exercise 3 on page 592, 5th Ed. or 457, 4th Ed in the text. Modularize your code using...

1 answer below »
the assignment is in the file


Chapter 11 homework – Challenge Yourself - Geometry Calculator The Program – Python Only! Complete programming exercise 3 on page 592, 5th Ed. or 457, 4th Ed in the text. Modularize your code using procedures, as discussed in section 11.2. Use a loop to repeat the menu, as discussed in section 11.3. Validate the menu entry. Use the built in constant in the Math library for Pi (instead of putting the literal value in your code). Use defensive programming for this assignment. Your program should give the user an error and allow them to re-enter if they enter an unreasonable value (for example, a zero or negative radius for a circle, or an invalid menu choice). You may assume that the user will enter either an integer or floating point number, as appropriate. Half of your grade for this assignment will be for defensive programming. Make sure you implement all the required defensive programming. Screenshot Here's an example of what you program should look like: What To Turn In For this assignment you need to turn in: · Your working Python program file named Homework_11.py. · Screenshot of completed shell or pasted in Word file as HomeworkShell_11.doc or saved completed shell as HomeworkShell_11.py. Notes and Comments · All of your assignments must follow the coding standards we discussed in class. · I suggest your check your program against the check list before you turn it in. · Be sure to turn in your assignment via the Blackboard site before then end of class tonight for full credit. · No new items of code · Concept of menu driven - Very close to the metric menu driven example we had – follow that pattern · Has to be defensive at every level · Use a Floating point at every level
Answered Same DayMay 08, 2021

Answer To: Chapter 11 homework – Challenge Yourself - Geometry Calculator The Program – Python Only! Complete...

Mohd answered on May 13 2021
156 Votes
completed solution/Homework_11.py
import math
def menu():
ch = 0;
while(ch != 1):
print("1. Calculate the area of a Circle");
print("2. Calculate the area of a Rectangle");
print("3. Calculate the area of a Triangle");
print("4. Quit");
select = input("Enter your choice (1-4): ");
if select == "1":
circle();
ch = 0
elif select == "2":
rectangle();
ch = 0
elif select == "3":
triangle();
ch = 0
elif select == "4":
ch = 1;
else:
print("ERROR: Enter a valid number between 1 and 4");
ch = 0
def circle():
check =...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here