Due Date: Monday Sept 21 @ 6am Uploaded to Canvas
A 4th grade teacher needs a an application for his students to use while they are practicing their area and perimeter formula calculations. You’ll write a program that will allow the user to enter characteristics of 4 different figures and will then output the perimeter/circumference and area of those figures.
While we haven’t covered the section of Zybooks yet that deals with conditionals (the
if block), we have talked about them in class on a few different occasions.
Please refer to those examples if you need help.
Write a Python Program that will:
- Greet the user with a Welcome Message that should include the purpose of the program.
- Ask the user to choose one of 4 options… display the options to the user of course. The options are 1. rectangle, 2. right triangle, 3. square, 4. circle.
- Based upon the choice, ask the user to then input important characteristics of the particular figure.
- Rectangle: ask for length and width
- Right Triangle: ask for the lengths of the non-hypotenuse sides
- Square: ask for the length of one side
- Circle: ask for the radius
- Based up on the dimensions entered, calculate the area and perimeter of each figure. (Check the internet for the formulas if you need a reminder)
- Display the calculated area and perimeter to the user (only 1 decimal place of precision when applicable)
- Thank the user for using the Geometry Helper.
You should place the code for this program in a Python file named
1340-pa02-<lastname>.py where you replace
<lastname> with your last name in all lowercase letters. For example, if I was writing this project, my file would be named
Your project (single Python file) should be submitted to Canvas in the appropriate PA02 location.
It will be graded according to the following rubric:
- Source Code Quality: 40%
- Proper use of vertical white space
- Proper use of horizontal white space
- Understandable variable names
- File header comments with your name, SMU ID, and a brief explanation of the project.
- Correctness: 30%
- Does your project produce the output for the given dimensions entered.
- User Interface: 30%
- Are the steps under Your Implementation followed?
- Are the prompts to the user helpful?
- Are the values printed correctly formatted (only 1 decimal place of precision)?
Note: The 2, 10, and 20 below are to be entered by the user.
Welcome to Geometry Helper This program will allow you to enter the dimensions of 4 different figures, and we will show you the perimeter and area based on those dimensions. Choose a figure type: 1. square 2. rectangle 3. circle 4. right triangle Enter 1, 2, 3, or 4: 2 Enter rectangle length: 10 Enter rectangle width: 20 Rectangle Perimeter: 60 Rectangle Area: 200 Thanks for using Geometry Helper!