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
Ira Lisetskai [31]
2 years ago
11

True/False: If a function is legally prototyped to return an integer value, it can return a structure member that is an integer

data type.
Computers and Technology
1 answer:
sdas [7]2 years ago
5 0
#1) If a function is legally prototyped to return an integer value, it can return a structure member that is an integer data type.
Answer: True. Any method that is not declared void must contain a return statement with a corresponding return value. The data type of the return value must match the method's declared return type; you can't return an integer value from a method declared to return a boolean.
You might be interested in
Which if the following is an effect of intellectual property theft?
Leno4ka [110]
Record companies lose money because people download songs for free.
8 0
2 years ago
Read 2 more answers
Write a static method named anglePairs that accepts three angles (integers), measured in degrees, as parameters and returns whet
padilas [110]

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.

8 0
3 years ago
Consider the following class:
Pachacha [2.7K]

Answer:

c.return Integer.compare(value, otherTemp.value)

Explanation:

The compare() method as the name implies compares two integer values. If they are equal it returns 0, if the first number is smaller it returns -1, and if the first number is greater it returns 1.

It is an Integer class method that is why you need to type Integer.compare() to call the function.

For this example, the parameters that will be compared are <em>value</em>, and <em>otherTemp.value. </em>The type of compareTo method is an integer, we need to return the result.

3 0
2 years ago
How many 1000-Watt lights can be plugged into a standard 120-Volt, 15-Amp outlet? (Hint: W/V=A) *
Licemer1 [7]

Answer:

There are up to 12 lights and or plugs on that circuit. A 1000w HPS or Metal Halide light takes 9 amps at 120 volts so you can only run one on a wall outlet circuit. A standard dryer outlet is 220 volts and 30 amps so you can power up to six 1000 watt lights on that circuit.

5 0
3 years ago
Why Java Script uses the prefix Java in itsname?
kifflom [539]

Answer:

Java in JavaScript does not correspond to any relationship with Java programming language.

Explanation:

The prefix Java in Javascript is there for historical reasons.

The original internal name of Javascript when it was created by Brendan Eich at Netscape was Mocha. This was released to public as Livescript in 1995. The name Livescript was eventually changed to Javascript in Netscape Navigator 2.0 beta 3 release in December 1995 after Netscape entered into an agreement with Sun Microsystem. The primary purpose of change of name seemed to be as a marketing aid to benefit from the growing popularity of Java programming language at that time.

4 0
3 years ago
Other questions:
  • Which of the following consists of electronic components that store instructions?
    10·1 answer
  • How do you do this question
    11·1 answer
  • If you want to conserve ink or toner, you can instruct powerpoint to print ____ documents.
    6·1 answer
  • Write a program in c++ that plays a number guessing game with a Human user. The Human user will think of a number between 1 and
    7·2 answers
  • The company generates a lot of revenue and is rapidly growing. They're expecting to hire hundreds of new employees in the next y
    6·1 answer
  • The costs incurred when a firm buys on the marketplace what it cannot make itself are referred to as
    6·1 answer
  • The sequence's insert member function normally puts a new item before the current item. What should insert do if there is no cur
    9·1 answer
  • The most widely used computer device​
    6·2 answers
  • 1. Give one reason why data is represented in binary in a computer [1]
    10·1 answer
  • to provide for ecmascript compatibility in older browsers, you can use group of answer choices javascript shivs javascript shims
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!