1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Maurinko [17]
3 years ago
11

Write an application that reads the lengths of the sides of a triangle from the user. compute the area of the triangle using her

on's formula (below), in which s represents half of the perimeter of the triangle and a, b, and c represent the lengths of the three sides. print the area rounded to three decimal places.
Computers and Technology
1 answer:
zlopas [31]3 years ago
3 0

Here you go,


import java.util.Scanner;

import java.util.Random;

public class OrderCalculator{


public static void main(String[] args){  


float x, y, z, semi, area;

Scanner in = new Scanner(System.in);

System.out.print("Enter the 3 sides: ");

x = in.nextFloat();

y = in.nextFloat();

z = in.nextFloat();

semi = (float) ((x + y + z) / 2.0);

area = (float) Math.sqrt(semi * (semi - x) * (semi - y) * (semi - z));

System.out.printf("The area is: %.3f\n", area);


}

}

You might be interested in
You friends parents are worried about going over their budget for the month. Which expense would you suggest is NOT a need?
Lapatulllka [165]

Answer:

Anything that doesn't have to do with food (including water), shelter, or clothing.

For Example: Going to the pool is not a need, going on vacation is not a need etc. etc.

Hope this helps

Explanation:

8 0
3 years ago
In how many ways can the letters of the word APPROXIMATION be arranged?
ZanzabumX [31]

Answer:

2494800

Explanation:

A lot of math and time.

5 0
3 years ago
How did technology change the world
Crank

Answer:

Technology has changed the world for the better.

Explanation:

Without technology, many of the things we take for advantage, such as, credit cards, calling people from far distances, heck even being able to call to across the world from where you are right now. Technology has revolutionized many things we use commonly on a day-to-day basis.

3 0
3 years ago
Read 2 more answers
Write a program FindDuplicate.java that reads n integer arguments from the command line into an integer array of length n, where
kozerog [31]

Answer:

  1. public class FindDuplicate{
  2.    public static void main(String[] args) {
  3.        Scanner input = new Scanner(System.in);
  4.        int n = 5;
  5.        int arr[] = new int[n];
  6.        for(int i=0; i < arr.length; i++){
  7.            int inputNum = input.nextInt();
  8.            if(inputNum >=1 && inputNum <=n) {
  9.                arr[i] = inputNum;
  10.            }
  11.        }
  12.        for(int j =0; j < arr.length; j++){
  13.            for(int k = 0; k < arr.length; k++){
  14.                if(j == k){
  15.                    continue;
  16.                }else{
  17.                    if(arr[j] == arr[k]){
  18.                        System.out.println("True");
  19.                        return;
  20.                    }
  21.                }
  22.            }
  23.        }
  24.        System.out.println("False");
  25.    }
  26. }

Explanation:

Firstly, create a Scanner object to get user input (Line 4).

Next, create an array with n-size (Line 7) and then create a for-loop to get user repeatedly enter an integer and assign the input value to the array (Line 9 - 14).

Next, create a double layer for-loop to check the each element in the array against the other elements to see if there is any duplication detected and display "True" (Line 21 - 22). If duplication is found the program will display True and terminate the whole program using return (Line 23). The condition set in Line 18 is to ensure the comparison is not between the same element.

If all the elements in the array are unique the if block (Line 21 - 23) won't run and it will proceed to Line 28 to display message "False".

7 0
3 years ago
The United States Highway System is a _____________ in the United States numbered within a nationwide grid.
denpristay [2]
Roadway system would be the ebst choice
3 0
3 years ago
Other questions:
  • Which of the following is needed if a computer with the IP address 172.31.210.10/24 wants to communicate with a computer with th
    5·1 answer
  • Select the best answer for the question. 2. What is the simplest way to permanently get rid of an unwanted file?
    13·1 answer
  • Write a method called printRange that accepts two integers as arguments and prints the sequence of numbers between the two argum
    6·1 answer
  • Design and implement an application that reads a sequence of up to 25 pairs of names and postal (ZIP) codes for individuals. Sto
    9·1 answer
  • Which of the following statements is correct?
    11·1 answer
  • How does the post process alert the user if it detects a hardware problem during the post process?
    6·1 answer
  • Can someone help me with this project im confused
    14·1 answer
  • Management of software development consist of?
    15·1 answer
  • Modern Computers compared to earlier computers are
    10·1 answer
  • What is incorrect about the following code? Suggest a possible revision of the code to correct the error.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!