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
Strike441 [17]
3 years ago
11

Write a program to input value of three sides, to check triangle is triangle is possible to form of not​

Computers and Technology
1 answer:
NeTakaya3 years ago
3 0

Answer:

Explanation:

import java.util.Scanner;

public class KboatTriangleAngle

{

  public static void main(String args[]) {

      Scanner in = new Scanner(System.in);

      System.out.print("Enter first angle: ");

      int a1 = in.nextInt();

      System.out.print("Enter second angle: ");

      int a2 = in.nextInt();

      System.out.print("Enter third angle: ");

      int a3 = in.nextInt();

      int angleSum = a1 + a2 + a3;

       

      if (angleSum == 180 && a1 > 0 && a2 > 0 && a3 > 0) {

          if (a1 < 90 && a2 < 90 && a3 < 90) {

              System.out.println("Acute-angled Triangle");

          }

          else if (a1 == 90 || a2 == 90 || a3 == 90) {

              System.out.println("Right-angled Triangle");

          }

          else {

              System.out.println("Obtuse-angled Triangle");

          }

      }

      else {

          System.out.println("Triangle not possible");

      }

  }

}

OUTPUT:

You might be interested in
49 points!
Kaylis [27]

Explanation:

Roberto is a visual designer in a big publication house. For a project, he designs a flyer with several geometric shapes signifying the ...

7 0
3 years ago
Write a program that defines an interface having the following methods: addition, subtraction, multiplication, and division. Cre
Tatiana [17]

Hello, you haven't provided the programing language in which you need the code, I'll explain how to do it using Python, and you can follow the same logic to make a program in the programing language that you need.

Answer:

1. # -*- coding: utf-8 -*-

2. #Python  

3. class Calculator:

4.     def add(self):

5.         print(a + b)

6.     def sub(self):

7.         print(a - b)

8.     def mul(self):

9.         print(a * b)

10.     def div(self):

11.         print(a / b)

12.  

13. obj = Calculator()

14. choice = 1

15. while choice != 0:

16.     a = int(input("\nEnter first number: "))

17.     b = int(input("Enter first number: "))

18.      

19.     print("\n0. EXIT")

20.     print("1. DIVISION")

21.     print("2. ADDITION")

22.     print("3. SUBTRACTION")

23.     print("4. MULTIPLICATION")

24.      

25.     choice = int(input("\nEnter your choice: "))

26.     if choice == 1:

27.         obj.div()

28.     elif choice == 2:

29.         obj.add()

30.     elif choice == 3:

31.         obj.sub()

32.     elif choice == 4:

33.         obj.mul()

34.     else:

35.         break

Explanation:

  • From lines 1 to 12 we define the object with four methods, addition, subtraction, multiplication, and division. Each method contains the operation between two variables inside a print function
  • On line 13 we instantiate our class
  • On line 14 we declare the variable choice that is going to store the operation that the user wants to perform
  • On line 15 we declare a while loop, this is going to keep running the program until the user wants to exit
  • From line 16 to 18 we ask the user to enter two numbers
  • From line 19 to 24 we print the possible operation, assigning a number for each operation, this indicates to the user what number to press for what operation
  • On line 25 we ask the user for the operation
  • From lines 26 to 35 we check the user input an accordingly we call the corresponding method to performs the operation
7 0
3 years ago
You have a farm in the mountains. It is difficult for the power supply company to provide electricity at hilly areas. The area i
White raven [17]
D . a wind turbine power plant .
3 0
4 years ago
List any two characteristics of ASCC.​
ladessa [460]

Answer:

spirit of cooperation, collective responsibility

Explanation:

i had that question before

3 0
3 years ago
Read 2 more answers
Five advantages of Internet​
Debora [2.8K]

Answer:

1. Accessible to find information

2. Computer can store information you need

3. Communication world wide to connect with others

4. High tech learning

5. Many entertaining platforms and games  

Explanation:

Hope that helps

3 0
3 years ago
Other questions:
  • Which is NOT a type of SD card?
    8·2 answers
  • If a given router can connect to at most k networks, how many routers, r, are required to connect n networks? write an equation
    7·1 answer
  • Write a program that reads a number in feet, converts it to meters, and displays the result. One foot is 0.305 meters. INPUT and
    8·1 answer
  • The picture that graphically represents the items you use in windows is called a/an
    15·2 answers
  • Which of the following best meets the requirements of a strong password?
    5·2 answers
  • In a _______ format, the date line and the signature block are centered.
    6·1 answer
  • A local bank has just one branch. It sets up a peer-to-peer network for all devices on the system. The bank would like to be abl
    12·1 answer
  • Write code which takes a user input of a String and an integer. The code should print each letter of the String the number of ti
    12·1 answer
  • What is the general term for programs used to operate a computer
    15·1 answer
  • Which model allows designers to use a graphical tool to examine structures rather than describing them with text?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!