Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a program (3 versions: C, Python and PHP) that calculates the area of a triangle given its three sides. The formula or algorithm used
Write a program (3 versions: C, Python and PHP) that calculates the area of a triangle given its three sides. The formula or algorithm used is: Area = (s(s - a)(s - b)(s - c)) Where: s= perimeter-(a+b+c)/2 and a, b & c are the sides of triangle. You should implement 2 method besides your main code: 1. Perimeter method that need the value of the 3 sides (a,b,c) to find the value of s 2. Area method that need the value of the 3 sides (a,b,c) and Perimeter(s) Notes: 1. In C, you can import math header file to be able use square root method (sqrt) 2. How you can only show 2 digit after the decimal point without using any format method in Python and PHP? 3. In C you can show 2 digit after the decimal point as in 'printf in java, how? 4. How you can find the square root in Python and PHP without using any special method? 5. Make sure to select suitable data types. Sample Output: Enter the values of a, b and c 12 10 8 Area of a triangle = 39.68
Step by Step Solution
There are 3 Steps involved in it
Step: 1
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