Question
Program #2 - Write a Python program that performs simple formulas for shapes. The code should contain the following: Function 1: Function Name: rectangle_perimeter Inputs:
Program #2 - Write a Python program that performs simple formulas for shapes. The code should contain the following:
Function 1: Function Name: rectangle_perimeter Inputs: (Parameters): • Determine the appropriate input(s) and write parameters for each Processing: Calculate the perimeter based on the algorithm Output: (Return): the perimeter
Function 2: Function Name: circle_perimeter Inputs: (Parameters): • Determine the appropriate input(s) and write parameters for each Processing: Calculate the perimeter based on the appropriate algorithm Output: (Return): the perimeter
Function 3: Function Name: triangle_perimeter Inputs: (Parameters): • Determine the appropriate input(s) and write parameters for each Processing: Calculate the perimeter based on the appropriate algorithm Output: (Return): the perimeter
Function 4: Function Name: rectangle_area Inputs: (Parameters): • Determine the appropriate input(s) and write parameters for each Processing: Calculate the area based on the algorithm Output: (Return): the area Function
5: Function Name: circle_area Inputs: (Parameters): • Determine the appropriate input(s) and write parameters for each Processing: Calculate the area based on the appropriate algorithm Output: (Return): the area Function
6: Function Name: triangle_area Inputs: (Parameters): • Determine the appropriate input(s) and write parameters for each Processing: Calculate the area based on the appropriate algorithm Output: (Return): the area
Function 7: Function Name: cube_volume Inputs: (Parameters): • Determine the appropriate input(s) and write parameters for each Processing: Calculate the volume based on the appropriate algorithm Output: (Return): the volume Function
8: Function Name: cylinder_volume Inputs: (Parameters): • Determine the appropriate input(s) and write parameters for each Processing: Calculate the volume based on the appropriate algorithm Output: (Return): the volume
The main area of the program that will:
• For each function:
o Ask the user for the appropriate inputs for the function
o Call the function
o Display the results with a user-friendly message
• Note that only the main area of the program should be asking for user inputs and displaying user outputs
• No loop is needed
Step by Step Solution
There are 3 Steps involved in it
Step: 1
usrbinpython function to measure perimeter of rectangle require its length and breadth def r...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