Page 1 of 1

Instructions Modify the program from Project 4 to compute the area of a triangle. triangle.py 1 # Edit the code below (f

Posted: Sun May 15, 2022 12:54 pm
by answerhappygod
Instructions Modify The Program From Project 4 To Compute The Area Of A Triangle Triangle Py 1 Edit The Code Below F 1
Instructions Modify The Program From Project 4 To Compute The Area Of A Triangle Triangle Py 1 Edit The Code Below F 1 (45.08 KiB) Viewed 87 times
Instructions Modify the program from Project 4 to compute the area of a triangle. triangle.py 1 # Edit the code below (from Project 4) 2 base = float(input("Enter the base:5 ")) 3 height = float(input("Enter the height:7 ")) 4 area = base 34* height 67 5 print("The area is", area, "square units.") 6 7 1. Issue the appropriate prompts for the triangle's base and height and change the name of the width variable to base. 2. Use the formula 0.5 * base height to compute the area. An example of the program input and output is shown below: Enter the base: 5 Enter the height: 7 The area is 17.5 square units. Grading When you have completed your program, click the Submit button to record your score.

+ Tasks + >_ Terminal Program produces correct output given input 0.00 out of 10.00 triangle.py 1 # Edit the code below (from Project 4) 2 base = float(input("Enter the base:5 ")) 3 height = float(input("Enter the height:7 ")) 4 area = base 34+ height 67 5 print("The area is", area, "square units.") 6 7 O out of 3 checks passed. Review the results below for more details. Checks > Test Case • Incomplete Test for base of 5. height of 7 > Test Case Incomplete Test for base of 34, height of 67 > Test Case Incomplete Test for base of 127. height of 15 Rename the width variable to base 10.00 10.00 2 out of 2 checks passed. Great work!