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
LiRa [457]
2 years ago
10

Given class Triangle (in file Triangle.java), complete main() to read and set the base and height of triangle1 and of triangle2,

determine which triangle's area is larger, and output that triangle's info, making use of Triangle's relevant methods. Ex: If the input is: 3.0 4.0 4.0 5.0 where 3.0 is triangle1's base, 4.0 is triangle1's height, 4.0 is triangle2's base, and 5.0 is triangle2's height, the output is: Triangle with larger area: Base: 4.00 Height: 5.00 Area: 10.00
Computers and Technology
1 answer:
kodGreya [7K]2 years ago
8 0

Answer:

<em>The Triangle.java file is not provided; However, the program is as follows;</em>

<em>Comments are used for explanatory purpose</em>

<em>Also see attachment for Triangle.java program file</em>

<em />

import java.util.*;

public class triangle

{

public static void main(String [] args)

{

 Scanner input = new Scanner(System.in);

 //Declare variables

 double base1, height1, base2, height2;

 //Prompt user for inputs

 System.out.println("Provide values for the base and height of the two triangles");

 System.out.print("Base of Triangle 1: ");

 base1 = input.nextDouble();

 System.out.print("Height of Triangle 1: ");

 height1 = input.nextDouble();

 System.out.print("Base of Triangle 2: ");

 base2 = input.nextDouble();

 System.out.print("Height of Triangle 2: ");

 height2 = input.nextDouble();

 //Compare and Print Results

 if(0.5 *base1 * height1 > 0.5 * base2 * height2)

 {

  System.out.print("Triangle with larger area: Base: "+base1+" Height: "+height1+" Area: "+(0.5 * base1 * height1));

 }

 else

 {

  System.out.print("Triangle with larger area: Base: "+base2+" Height: "+height2+" Area: "+(0.5 * base2 * height2));

 }

}

}

Download java
You might be interested in
What is mendix about?
fenix001 [56]

Answer:

Mendix is another word for appendix.

Explanation:

3 0
3 years ago
What was one of the main purposes of the first computer systems?
wolverine [178]
<span>Financial transactions were one of the first purposes of computers. This is where "ticker tapes" came from; early computers were used to keep track of how stocks were performing. Computers in early days used large mainframe systems and punch cards to keep track of this type of data.</span>
6 0
3 years ago
Select a cybersecurity career that interests you. Describe the job duties and identify the skills required to excel in that care
kykrilka [37]

Answer:

it's business

Explanation:

business you started with small and work for it grow up.

3 0
3 years ago
How does accenture generate value for clients through agile and devops?
Tomtit [17]

Through quicker time to market, better quality products, and higher customer satisfaction Agile and DevOps are key components of Accenture's value creation for clients.

Accenture plc is a Dublin-based, Irish-American professional services firm with a focus on information technology (IT) services and consulting. It was listed on the Fortune Global 500 and recorded $61.6 billion in revenue in 2022. 91 of the Fortune Global 100 and more than 75 percent of the Fortune Global 500 are among Accenture's current clients.

When General Electric wanted to install a computer at Appliance Park in Louisville, Kentucky, in the early 1950s, Accenture conducted a feasibility study for the company. This study led to GE installing a UNIVAC I computer and printer, which is thought to be the first commercial use of a computer in the United States.  A post was held by Joseph Glickauf, a pioneer in computer consulting.

To know more about Accenture click here:

brainly.com/question/24302004

#SPJ4

4 0
1 year ago
1. Describe your Microsoft word skills that need to be improved upon the most. 2. Explain the Microsoft word skills you are most
Andrei [34K]

Answer:

The answer varies from person to person.

Explanation:

All kinds of people are using Word, so people would recognize if the answer if plagiarized. So, simply answer truthfully; no matter h1ow embarrasing.

7 0
3 years ago
Other questions:
  • PLEASE HELP Which of the following is considered a modern method of communication?
    6·2 answers
  • Write a converter program for temperatures. This program should prompt the user for a temperature in Celsius. It should then con
    10·1 answer
  • In modern computer memory, each location is normally composed of one byte.
    7·1 answer
  • The PICC team is scheduled to remove a PICC before client discharge. Assessment of the catheter indicates the PICC and determine
    7·1 answer
  • Given the three side lengths, how can you tell if a triangle<br>is a right triangle?​
    5·1 answer
  • This needs to be written in Java.
    11·1 answer
  • What dd command would you use to copy the contents of a partition named /dev/drive1 to another partition, called /dev/backup?
    6·1 answer
  • Which feature helps an edit-test-bug cycle work faster in the python programming language?
    15·2 answers
  • Collaboration, listening, and negotiating are considered __________ skills.
    11·1 answer
  • When a computer is infected by a virus, _______.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!