Question
Write all lines of your pseudo code as comments immediately after your name and SPC ID# comment. Add more comments as needed in each program
Write all lines of your pseudo code as comments immediately after your name and SPC ID# comment. Add more comments as needed in each program to explain what your code is doing. Choose descriptive variable names in all programs. Currency format. Use f-strings to generate currency outputs. Before submitting this assignment, refer to the grading rubric to maximize your earned grade points. When done, right-click on your chapter5 folder and select "Send to" --> "Compressed (zipped) folder". This will make chapter5.zip. Upload and submit chapter5.zip to this drop box. Type your collaboration statement in the drop box if you did not code by yourself. If you get help, make sure your helper is aware of these requirements. IMPORTANT In this assignment, and all following assignments, you should use "dunkers" notation as explained on page 281 and shown at the end of rectangle_2.py on page 282.
Program5_1.py this file is about rectangles. It requires a main function andthree custom functions,all of which take therectangle dimensions as arguments.
- A function thatreturns the areaof a rectangle.
- Avoidfunction that prints theperimeterof a rectangle.
- A function thatreturnsthe length of a rectangle'sdiagonal. This functionmust use a method of the math module.
Themainfunction shouldprompt the user for the rectangle dimensions(asfloats) and execute the custom functions. All calculations should be printed accurate tothree decimal places using f-strings. Sample Output
Program5_2.py this program shouldimport program5_1 as a module. Start by making acopy of program5_1.py. Then delete the three custom functions and adjust the code to demonstrate that you understandhow the dunkers workin Python. Refer topages 281-283in the textbook.
This is more about exercise program5_2 but its solution depend on program5_1 solution that is why I am attaching both of them
Step 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