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
rusak2 [61]
3 years ago
10

Write a static method named anglePairs that accepts three angles (integers), measured in degrees, as parameters and returns whet

her or not there exists both complementary and supplementary angles amongst the three angles passed. Two angles are complementary if their sum is exactly 90 degrees; two angles are supplementary if their sum is exactly 180 degrees. Therefore, the method should return true if any two of the three angles add up to 90 degrees and also any two of the three angles add up to 180 degrees; otherwise the method should return false. You may assume that each angle passed is non-negative.
Computers and Technology
1 answer:
padilas [110]3 years ago
8 0

Answer:

The java program for the scenario is given below.  

import java.util.*;

public class Test

{

// method returning sum of all digits in the integer parameter

static boolean anglePairs(int a1, int a2, int a3)

{

   // variable to hold sum of two complementary angles

   int comp=90;  

   // variable to hold sum of two supplementary angles

   int supp=180;

   // boolean variable to hold result

   boolean result = false;

   if( (a1+a2 == comp) || (a2+a3 == comp) || (a1+a3 == comp) )

   {

       if( (a1+a2 == supp) || (a2+a3 == supp) || (a1+a3 == supp) )

           result = true;

       else

           result = false;

   }    

           // return variable result

       return result;

}

public static void main(String[] args)

{

   // method is called by passing three positive angles

   System.out.println("The pair of angles have both complementary and supplementary angles " + anglePairs(100, 80, 90) );    

}

}

OUTPUT

The pair of angles have both complementary and supplementary angles false

Explanation:

The program works as described below.

1. The method, anglePairs(), is declared as static having return type as Boolean which takes three positive integer parameters.

static boolean anglePairs(int a1, int a2, int a3)

{

}

2. The integer variable, comp, is declared and initialized to 90.

3. The integer variable, supp, is declared and initialized to 180.

4. The Boolean variable, result, is declared and initialized to false.

5. Using if-else statements, sum of two angles are compared with the variables, comp and supp.

6. If the sum of any two angles match with both, comp and supp, variables, the Boolean variable, result is assigned value true. Otherwise, result is assigned value false.

7. The value of result is returned.

8. Inside main() method, the function anglePairs() is called and three positive numerical values are passed as parameters.  The output is displayed.

9. All the above code is written inside the class Test.

10. User input is not taken since it is not mentioned in the question.

You might be interested in
Michael is discussing various project needs with his team. Match Michael’s statement with the way project management can help th
Reika [66]

Answer:

get out there outside and get out and see what you do when you're ready for a workout or a day off and you're going through the

7 0
3 years ago
How does a Graphical User Interface (GUI) interact with a desktop or laptop computer?
Viefleur [7K]

Windows, icons, menus, and pointers does  a  graphical  user interface (GUI) interact with a  desktop or laptop computer.

  • Windows, icons, menus, and pointers

<u>Explanation:</u>

Graphics user interface (gui) made a big resolution on desktop or laptop or tablet or workstation industries. In olden days till  1994 still, people were using the black and white computer where a desktop consists of keyboard and printer and monitors where display color white and black.

If we open a picture it will display only in black and white so games are in black and white mode. After windows  3.1  we have seen color picture and mouse interface is used. Since technology developed and interface in GUI is also developed improved in windows icon menu and mouse pointer.

As technology developed we going back to a dark mode such as black and white mode.

4 0
3 years ago
Your database was damaged due to hardware failure. What can you use to restore it?
vesna_86 [32]
The only way is if you have backed up everything! Computers are amazing but they don't know that you need to back up your info. You should back up everything regularly! 
Hope this helped and have a nice day!

8 0
3 years ago
ก
Harrizon [31]

Answer:

Rubies are used in electronics.

 

Please select the best answer from the choices provided

T

Explanation:

6 0
3 years ago
Read 2 more answers
Write an if-else statement for the following:
Bogdan [553]

In python 3.8:

if user_tickets < 5:

   num_tickets = 1

else:

   num_tickets = user_tickets

For this code to work properly, you'll have to first declare user_tickets before the if-else statements.

5 0
2 years ago
Other questions:
  • Can someone pls explain this question??
    7·1 answer
  • How to determine if the function f(x) = x^2 + 3 from real numbers to real numbers is Injective, surjective, or bijective
    13·1 answer
  • Vector testGrades contains NUM_VALS test scores. Write a for loop that sets sumExtra to the total extra credit received. Full cr
    7·1 answer
  • Rewrite this if/else if code segment into a switch statement int num = 0; int a = 10, b = 20, c = 20, d = 30, x = 40; if (num &g
    13·1 answer
  • Explain the components of Information System?​
    13·1 answer
  • One common method of converting symbols into binary digits for computer processing is called ASCII​ (American Standard Code of I
    5·1 answer
  • Which is the best information to determine an athlete's abilities and needed areas of improvement?
    12·2 answers
  • A Chain of dry-cleaning outlets wants to improve its operations by using data from devices at individual locations to make real-
    14·1 answer
  • Network forensic analysis. A network forensic analyst is responsible for identifying worms, viruses, and infected nodes in the c
    14·1 answer
  • Passing an argument by ___ means that only a copy of the arguments value is passed into the parameter variable and not the addrt
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!