Requirements: Plan each program by writing pseudocode. Add more comments as needed in each program to explain what your code is doing. Choose descriptive variable names in all programs. Currency...




Requirements:



  • Plan each program by writing pseudocode.

  • Add more comments as needed in each program to explain what your code is doing.

  • Choose descriptive variable names in all programs.

  • Currency format. Usef-strings to generate currency outputs.




Python Question 5a:



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 area of a rectangle.

  • avoid function that prints theperimeter of a rectangle.

  • a function thatreturns the length of a rectangle'sdiagonal. This functionmust use a method of the math module.


Themain function 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

(See sample_image1.png)







Python Question 5b:



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 dunders work in Python.



Enter rectangle side 1 15.0<br>Enter rectangle side 2 8.0<br>The area is 120.000<br>The perimeter is 46.000<br>Rectangle diagonal is 17.000<br>

Extracted text: Enter rectangle side 1 15.0 Enter rectangle side 2 8.0 The area is 120.000 The perimeter is 46.000 Rectangle diagonal is 17.000

Jun 04, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here