Dear Student,
here is the complete Java code which perform the required task.
Please note that the below code has been compiled using javac compiler in ubuntu 16.04 system.
-------------------------------------------------------------------------------------------------------------------------------------
Program:
-------------------------------------------------------------------------------------------------------------------------------------
//import the required packages
import java.util.Scanner;
import java.lang.*;
//public class
public class Area
{
//main class
public static void main(String[] args)
{
//scanning input
Scanner input = new Scanner(System.in);
System.out.printf("Enter the length of side a: ");
int a = input.nextInt();
System.out.printf("Enter the length of side b: ");
int b = input.nextInt();
System.out.printf("Enter the length of side c: ");
int c = input.nextInt();
//calculating the seme-perimeter
double s = (a + b + c) /2;
//calculating the area
double A = Math.sqrt(s * (s - a) * (s - b) * (s - c));
//display the area
System.out.println("The area is: "+A);
}
}//end of the program
------------------------------------------------------------------------------------------------------------------------------------------
here i have attached the output of the program as a screen shot..
Output:
-----------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------
Kindly Check and Verify Thanks...!!!
Problem a (PA4a.java) Write a program to evaluate the area of a triangle given the lengths...
Java Please - Design and implement a class Triangle. A constructor should accept the lengths of a triangle’s 3 sides (as integers) and verify that the sum of any 2 sides is greater than the 3rd(i.e., that the 3 sides satisfy the triangle inequality). The constructor should mark the triangle as valid or invalid; do not throw an exception. Provide get and set methods for the 3 sides, and recheck for validity in the set methods. Provide a toString method...
10. Use Heron's formula to calculate the area of a triangle. In below formula, a, b, and c are the length of 3 sides of a triangle: s (a+b+c]/2 A Vs(s-a) (s-b) (s- e) Write a program to calculate area of triangle. Input a, b, e from console and display area.
Please help c++ Heron's Formula for the area of a triangle with sides a, b and c is given by the formula: area = S(S-a) (S-b) (S-c) where s = (a+b+c)/2 Write a complete program which in main asks the user for the sides a, b and c of a triangle. Use variables of type double. Pass a, b and c to a function called area. In area calculate s defining s as a local variable. Then use s, a,...
Must be java code Project 2b: CalculatePerimeter You are to write code for the application CalculatePerimeter where the computer calculates and displays the perimeter of a triangle, provided the three double values entered from keyboard input represent a triangle. If they don't, the computer should display the fact that (at least, in the case of non-positive input) one of the values does not form a valid triangle What makes a valid triangle? All sides must be positive and the sum...
The "for more practice part" using matlab If the lengths of two sides of a triangle and the angle between them are known, the length of the third side can be calculated. Given the lengths of two sides (b and c) of a triangle, and the angle between them alpha in degrees, the third side a is calculated as follows a^2 = b^2 + c^2 - 2b c cos(alpha) White a script thirdside that will prompt the user and read...
2. Write a program that prompts a user to enter the lengths of sides and angles for the two triangles described below. The program should calculate the length of the side of the triangle indicated below. Print the two answers to 3 decimal places onto the console screen Triangle 1 Read in the value of the angle, alpha, and the length, a, of the side indicated in the picture below. Calculate the length of the hypotenuse, c, of this right...
18. The area A of a of a triangle with sides of lengths a and b and with included angle is given by the formula: A=0 A= Rp2 A= √3(s - a)(sb) A=r0 A = sab sin() Question 18 of 29
Write a program to compute the area of a triangle using side-angle-side method and reports the area of that triangle (rounded to 2 decimal places). Side-angle-side formula: ???? = 1/ 2 ?? sin(?), where a and b are two sides of the triangle, and C is the included angle. Your program must meet the following criteria to receive full marks: • Randomly generate two values between 5 and 10 (inclusive) for two sides a and b of the triangle, respectively....
3. Write a program to calculate the area of a triangle. Your program will take the length of two sides and the included angle (in degrees), then prints the area based on the following formula. A = 1/2 ab sin C
Write a C++ program to analyze a variety of triangles. The program should determine all angles and all sides for a triangle for three different options (give the user a menu of choices): 1) Given two sides and the angle between 2) Given two angles and one side 3) Given three sides More details for each option is provided below. Option 1: Given two sides and the angle between First check to be sure that the three values entered are...