Program #2 - Write a Python program that performs simple formulas for shapes. The code should contain
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: (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
Intermediate Accounting
ISBN: 978-1259548185
8th edition
Authors: David Spiceland, James Sepe, Mark Nelson, Wayne Thomas