1. The program first asks for total number of triangles 'n' user wants to calculate area...
Fantastic news! We've Found the answer you've been seeking!
Question:
![1. The program first asks for total number of triangles 'n' user wants to calculate area of. 2. Then using a](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2023/10/651a92cf3463d_1696240332663.jpg)
Transcribed Image Text:
1. The program first asks for total number of triangles 'n' user wants to calculate area of. 2. Then using a loop, the program will ask to enter three sides for each triangle. The loop runs 'n' number of times. 3. Once three sides are provided for one triangle, the program calls a user defined function 'calculate_area' which calculates the 'area' and returns the value to the main function. 4. The main function prints the area of the triangle using str.format() and appends the 'area' to a list named 'areas'. 5. At the end of the program, it prints the largest area from the 'areas' list. max() is a built-in function which takes a list of numbers as parameter and returns the largest number from the list. 6. For this lab, you are expected to define two user-defined functions: a. calculate_area(): to calculate the area of the triangle. This function will take three sides of a triangle as parameter and returns the area of the triangle. To calculate the area of the triangle you use the following given formula. For area calculation you need to use exponential operator as x* *0.5 to calculate square root of x. b. main() function: This function organizes main functionality of the code. i. It will ask for total number of triangles 'n', ii. run a loop for 'n' number of times, iii. ask for three sides for each triangle, iv. call calculate_area() function, v. prints the 'area' returned by calculate_area(), vi. append the 'area' to 'areas' list and vii. then at the end of the program prints the largest area Heron's Formula S = A+B+C Area =S(S-A)(S-B) (S-C) C malwarehouse.com 1. The program first asks for total number of triangles 'n' user wants to calculate area of. 2. Then using a loop, the program will ask to enter three sides for each triangle. The loop runs 'n' number of times. 3. Once three sides are provided for one triangle, the program calls a user defined function 'calculate_area' which calculates the 'area' and returns the value to the main function. 4. The main function prints the area of the triangle using str.format() and appends the 'area' to a list named 'areas'. 5. At the end of the program, it prints the largest area from the 'areas' list. max() is a built-in function which takes a list of numbers as parameter and returns the largest number from the list. 6. For this lab, you are expected to define two user-defined functions: a. calculate_area(): to calculate the area of the triangle. This function will take three sides of a triangle as parameter and returns the area of the triangle. To calculate the area of the triangle you use the following given formula. For area calculation you need to use exponential operator as x* *0.5 to calculate square root of x. b. main() function: This function organizes main functionality of the code. i. It will ask for total number of triangles 'n', ii. run a loop for 'n' number of times, iii. ask for three sides for each triangle, iv. call calculate_area() function, v. prints the 'area' returned by calculate_area(), vi. append the 'area' to 'areas' list and vii. then at the end of the program prints the largest area Heron's Formula S = A+B+C Area =S(S-A)(S-B) (S-C) C malwarehouse.com
Expert Answer:
Answer rating: 100% (QA)
import math def calculateareaa b c Function that takes 3 sides of the triangle and calculates and re... View the full answer
Related Book For
Systems Analysis And Design
ISBN: 978-1119496489
7th Edition
Authors: Alan Dennis, Barbara Wixom, Roberta M. Roth
Posted Date:
Students also viewed these programming questions
-
For an ideal gas, what is the pressure in atm if the volume of the container is 5000 mL, the mol quantity is 0.812 mol, and the temperature is 28 degrees Celsius? PV = nRT (qu - A) (BA/MA + d) = nRT
-
Formulate a single python program that contains the following functions. Function 1: A function called frame_this which takes a list of words as a parameter (list_of_words) and then prints those...
-
You are required to write a Python program that will manage character (heroes and villain) information. Character (hero and villain) information will be stored in a text file that will be read in...
-
Consider a dynamic array where the capacity doubles when additional space is needed and shrinks by 50% when the size falls below 1/4 capacity. What will be the amortized big-O of an append()...
-
A child operating a radio-controlled model car on a dock accidentally steers it off the edge. The car's displacement 1.1 s after leaving the dock has a magnitude of 7.0 m. What is the car's speed at...
-
Five auditors participated in an experiment. Each was asked to identify errors or red flags in the financial statements of a fictitious company. The time that each of the five took to do the audit...
-
(Basic stock statistics) You invest $500 in a stock for which the return is determined by a coin flip. If the coin comes up heads, the stock returns 10%, and if it comes up tails, the investment...
-
The following section is taken from Paynter balance sheet at December 31, 2011. Current liabilities Interest payable ...............$ 40,000 Long-term liabilities Bonds payable (8%, due January 1,...
-
On January I, 2 0 X 3 , before acquiring Coyote, Acme Corporation acquired 1 0 0 % of Simbel Company for consideration transferred with a fair value of $ 1 2 6 , 0 0 0 . Acme is a U . S . - based...
-
What are the triads using roman numerals and figured bass numbers for this excerpt? 30-3. Use Roman numerals and figured bass numbers to identify triads in these works. a. Schubert, "Death and the...
-
You are managing HR at a Fortune 500 company. It has come to your attention that a large number of employees do not know the extent of their benefits with the company. How would you tell employees...
-
Performing inquiry and analytical procedures is the primary basis for an accountant to issue a (an) a. Compilation report on financial statements for a nonpublic entity in its first year of...
-
On March 12, 19X5, Brown & Brown, CPAs, completed the audit of the financial statements of Modern Museum, Inc., for the year ended December 31, 19X4. Modern Museum presents comparative financial...
-
Walter Kunitake, CPA, has been asked by the management of Russell Company, a nonpublic real estate agency, to compile a set of financial statements as of the companys year end, November 30, 19X4. a....
-
At the beginning of the fiscal year, a tenant signs a three-year lease to rent office space at the rate of \(\$ 1,000\) per month. The first six months are free. How much rent expense should be...
-
Define the following terms, as used in lease accounting standards: - Bargain purchase option (BPO). - Lease term. - Minimum net lease payments. - Contingent lease payments. - Bargain renewal term. -...
-
Solve the equation 2cos x+1=0 on the interval [0, 2). a.) 4 5 4T 3'3 b.) 2 4 3'3 O c.) 5 6'6 d.) 5 7 6'6
-
In Exercises, find the equation of the tangent line at the given point on each curve. 2y 2 - x = 4; (16, 2)
-
What is the purpose of the inputs and outputs section of the use case?
-
Suppose that you are the analyst charged with developing a new system for the university bookstore with which students can order books online and have them delivered to their dorms and off-campus...
-
Describe the principal steps in the implementation phase. What are the major deliverables?
-
Which of the following statements about basic assumptions is incorrect? a. Basic assumptions are the same as accounting principles. b. The economic entity assumption states that there should be a...
-
Performing services on account will have the following effects on the basic accounting equation: a. increase assets and decrease stockholders' equity. b. increase assets and increase stockholders'...
-
Which of the following is not a step in the accounting process? a. identification. b. verification. c. recording. d. communication.
Understanding Industrial Practices In Textiles Technology 1st Edition - ISBN: 0748790195 - Free Book
![Mobile App Logo](https://dsd5zvtm8ll6.cloudfront.net/includes/images/mobile/finalLogo.png)
Study smarter with the SolutionInn App