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
Sav [38]
3 years ago
7

Questions 6 - 9 Refer to the following code: public class WhatsIt { private int[] values; private double average; public WhatsIt

() { values = new int[10]; findAvg(); } public WhatsIt (int[] n) { values = n; findAvg(); } public void findAvg () { double sum = 0; for (int i = 0; i < values.length; i++) { sum += values[i]; } average = 1.0 * sum / values.length; } public String toString() { return "Average: " + average + " Length: " + values.length; } } What does the line findAvg(); in the constructor do? Creates a reference to the average variable. Calls the method findAvg() so the variable average is updated correctly. Calls the constructor findAvg; so the object can be created in memory. This call should be removed. Checks to see if the average variable has been initialized
Computers and Technology
1 answer:
gavmur [86]3 years ago
4 0

Answer:

class WhatsIt

{

private static int [] values;

private double average;

public Double Average=average;

public WhatsIt () {values = new int [10]; findAvg(); }

public WhatsIt (int [] n) {values = n; findAvg(); }

public static void findAvg ()

{double sum = 0;

for (int i = 0; i < values.length; i++)

{sum += values[i]; }

average = 1.0 * sum / values.length;

System.out.println(Average);

System.out.println(average);

}

public static String ToString()

{

   System.out.println(average); System.out.println(values.length);

   return "Average: " + average + " Length: " + values.length;

}

public static void main(String[] args)  

{

    //WhatsIt();

    //ToString();

    findAvg();

}

}

The findAvg() calculates the average.

The reference to average is defined as below:

public double Average=average;

And when we call findAvg average is initialized, and Average is also initialized, which we can check through println statement.

Explanation:

Please check the answer section.

You might be interested in
_____ can be either software-based or deployed via hardware, such as a recording "dongle" that is plugged in between a keyboard
Monica [59]
<span>Keyloggers can be either software-based or deployed via hardware, such as a recording "dongle" that is plugged in between a keyboard and a PC.
</span><span>The keylogger is also called keystroke logger or system monitor. This technology used to monitor and record each keystroke typed on a specific computer's keyboard. </span>
6 0
3 years ago
30 POINTS Conduct Interviews
Kitty [74]

Answer:

still need help with this if so lmk so o can help ya asap:)9

5 0
3 years ago
Hich chip contains the information necessary to start the computer system?
Sindrei [870]
The BIOS contains the information.
7 0
3 years ago
Do you play combat kite ?
nevsk [136]

Answer:

nah

Explanation:

7 0
3 years ago
Aside from the smart cell phones used by a billion people, list and describe four
Pie
Gaming Computers- High processing speed and designed to be used for gaming.
Handheld Computers- The things that are being used by Billions of people. Firstly designed as an Internet Browser, now can be used in gaming and office purposes
Mainframe Computers- The large boxes (computers) that you see in server rooms. Designed to be used on processing large quantities of data on the same time.
Office Computers- The things you see in your office. Cheap computers that is undercut in processing speed, and designed to run Office applications.
that's​all I know. have a good day :)
5 0
3 years ago
Other questions:
  • While researching ideas for cutting energy costs is his company. Hector watches an online video in which a business expert says,
    6·2 answers
  • An advertiser who sells coffee beans adds the keyword "Java'" to an ad group. After two weeks, she runs a placement performance
    11·1 answer
  • Which description of the plain text file format is most accurate?
    10·1 answer
  • Write a function called printBackwards() that will work with a C string. The function will print any C string backwards. You don
    13·1 answer
  • Which option is considered a part of the document that is used to collect specific and predefined information?
    7·1 answer
  • A company has a website that has seen a large increase in visitors and they are concerned that if the trend continues, the web s
    13·1 answer
  • Which of these is an advantage of having multiple layers in a drawing and enables you to make changes to one part of an image wi
    14·1 answer
  • What makes a source credible?
    9·2 answers
  • The ________ is the easy way to insert a new slide between existing slides.
    8·1 answer
  • Drag each tile to the correct box. Arrange the statements in sequence to correctly explain what the field of science includes. a
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!