Write a static method named anglePairs that accepts three angles (integers), measured in degrees, as parameters and returns whether 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.

Answers

Answer 1
Answer:

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.


Related Questions

How do you add binary numbers?
A custom information field that helps users to find a specific document is calleda. taxonomy. record. database. template.
Spoofing is a. Gaining control of someone else's computer to carry out illicit activities b. Simultaneously sending the same unsolicited message to many people, often in an attempt to sell them something c. Unauthorized access, modification, or use of an electronic device of some element of a computer system d. Altering an electronic communication to look like someone else sent the communication in order to gain the trust of the recipient
Dynamic alliance networks work best in industries: a. that are mature and stable in nature. b. where the coordination of product and global diversity is critical. c. that are characterized by predictable market cycles and demand. d. characterized by frequent product innovations and short product life cycles
In a typical e-mail address, the "host" is a.CPU processor 2500 b.the computer that houses an Internet connection c. an account designated by a user name d. the receiver of an e-mail message.

The Bullets button is available on the Home tab of the Ribbon in the ____ group.

Answers

The word or words that is needed to complete this problem would be most probably and most likely to be the word paragraph.

The bullets button is available on the Home tab of the Ribbon in the paragraph group. This is for MS Word though. To check, you open the MS Word application. The default menu in the ribbon would be the home menu where all the generally used buttons are shown. In the paragraph group, you can see the bullets button and there you have it.

The BIOS feature that enables the computer to recognize certain devices without a separate device driver is known as what?a.) Plug and play
b. )IDE block mode
c.) Memory testing
d.) Quick boot

Answers

D. Quick Boot

I can't tell you the number of times I've had to use BIOS to fix something on my machine

Answer:

Quick Boot

Explanation:

Having a positive work ethic means acceptingconstructive criticism even though it may be
painful. You should: (select all that apply)
show a positive facial expression.
maintain eye contact
not interrupt or speak until you are sure the
other person is finished making a point
question the person frequently throughout the
conversation

Answers

Answer:

123 and the next one is all of them

Explanation:

Answer:

2 and 3 (1 is debatable)

Explanation:

__________ "is/are the technology used to transform inputs into outputs"

Answers

Answer:System process

A systemprocess is a technology used to transform inputs into outputs, basically torender products and services. In addition, the important internal factor withinthe system is the quality of the product. This system has four componentsnamely; inputs, transformation, outputs and feedback.

The answer is system process.  The technology used to transform inputs into outputs is system process.  The System process is a kernel mode process which runs system threads (the kernel and loaded device drivers) taking care of network i/o and/or disk i/o.  

Which is not a test Oracle Option 1: The existing system (For a benchmark) Option 2: The code Option 3: Individual’s knowledge Option 4: User manual

Answers

Explanation:

find out what reasons influenced the location of the settlement you are researching

Final answer:

Option 4: User manual

Explanation:

In software testing, a Test Oracle provides the expected outcome for a test case. Option 4: User manual is not a Test Oracle because it may not provide consistent or accurate expected outcomes for testing.

The Test Oracle is a concept in software testing that helps in determining whether a test has passed or failed. It provides the expected outcome of a test case. Given the options provided; the existing system (for benchmarking), the code, individual's knowledge, and user manual, Option 4: User manual is not a Test Oracle. While an individual's knowledge is valuable, it does not in itself serve as a benchmark for testing. Unlike the existing system, the code, or user manual, it may not provide consistent or accurate expected outcomes for testing due to inherent human variable factors.

Learn more about Test Oracle here:

brainly.com/question/36601250

#SPJ11

What tab on the ribbon do you click to open backstage view?

Answers

To open the Backstage view, you should click on the "File" tab on the Ribbon.

This will provide access to the Backstage view, where you can find various file-related functions such as saving, opening, printing, and sharing documents.

When you click on the File tab, you will be taken to the Backstage view, which provides access to various options and commands related to the file you are working on. The Backstage view is designed to help you manage your files, change settings, and perform other file-related tasks.

In theBackstage view, you can perform tasks such as opening, saving, and printing files, creating new files, setting file properties, checking for issues, and more. The options available in the Backstage view may vary depending on the application and the version of Microsoft Office you are using.

In summary, to open Backstage view in Microsoft Office applications, click on the File tab on the ribbon. This will take you to the Backstage view, where you can perform various file-related tasks and access different options and commands.

To learn more about Microsoft Office:

brainly.com/question/30362851

#SPJ11