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
kati45 [8]
3 years ago
6

Brainliest to Best Answer!

Computers and Technology
1 answer:
Shtirlitz [24]3 years ago
8 0
ArrayIndexOutOfBoundsException
because it includes the extra info that you tried (and failed) to access an array
You might be interested in
Write a RainFall class that stores the total rainfall for each of 12 months into an array of doubles. The program should have me
RSB [31]

Answer:

Explanation:

The code provided worked for the most part, it had some gramatical errors in when printing out the information as well as repeated values. I fixed and reorganized the printed information so that it is well formatted. The only thing that was missing from the code was the input validation to make sure that no negative values were passed. I added this within the getMonths() method so that it repeats the question until the user inputs a valid value. The program was tested and the output can be seen in the attached image below.

import java.io.*;

import java.util.*;

class Rainfall

{

   Scanner in = new Scanner(System.in);

   private int month = 12;

   private double total = 0;

   private double average;

   private double standard_deviation;

   private double largest;

   private double smallest;

   private double months[];

   public Rainfall()

   {

       months = new double[12];

   }

   public void setMonths()

   {

       for(int n=1; n <= month; n++)

       {

           int answer = 0;

           while (true) {

               System.out.println("Enter the rainfall (in inches) for month #" + n + ":" );

               answer = in.nextInt();

               if (answer > 0) {

                   months[n-1] = answer;

                   break;

               }

           }

       }

   }

   public void getTotal()

   {

       total = 0;

       for(int i = 0; i < 12; i++)

       {

           total = total + months[i];

       }

       System.out.println("The total rainfall for the year is " + total);

   }

   public void getAverage()

   {

       average = total/12;

       System.out.println("The average monthly rainfall is " + average);

   }

   public void getLargest()

   {

       double largest = 0;

       int largeind = 0;

       for(int i = 0; i < 12; i++)

       {

           if (months[i] > largest)

           {

               largest = months[i];

               largeind = i;

           }

       }

       System.out.println("The largest amount of rainfall was " + largest +

               " inches in month " + (largeind + 1));

   }

   public void getSmallest()

   {

       double smallest = Double.MAX_VALUE;

       int smallind = 0;

       for(int n = 0; n < month; n++)

       {

           if (months[n] < smallest)

           {

               smallest = months[n];

               smallind = n;

           }

       }

       System.out.println("The smallest amount of rainfall was " + smallest +

               " inches in month " + (smallind + 1));

   }

   public static void main(String[] args)

   {

       Rainfall r = new Rainfall();

       r.setMonths();

       r.getTotal();

       r.getSmallest();

       r.getLargest();

       r.getAverage();

   }

}

8 0
3 years ago
ZigBee is an 802.15.4 specification intended to be simpler to implement, and to operate at lower data rates over unlicensed freq
never [62]

Answer:

True

Explanation:

Solution

ZigBee uses unlicensed frequency bands but operate at slower speed or data rates.

ZigBee: This communication is particular designed for control and sensor networks on IEEE 802.15.4 requirement for wireless personal area networks (WPANs), and it is a outcome from Zigbee alliance.

This communication level defines physical and  (MAC) which is refereed to as the Media Access Control layers to manage many devices at low-data rates.

6 0
4 years ago
Betty removed a web page from her website. Some users were browsing on her website. One of them clicked on a particular link and
Fittoniya [83]
To prevent users from seeing error pages and ensure that they have a pleasant experience in your application you can add the customErrors element to your Web.config file.  <span>Handling error codes and exceptions by the web.xml, you can configure </span>error-page elements<span> that act upon some error-code or exception-type.</span>
4 0
4 years ago
The appropriate software to use for creating research papers is ________ software. Select one: A. presentation B. word processin
Mademuasel [1]

Answer:

B. word processing

Explanation:

The appropriate software to use for creating research papers is word processing. This refers to any software that is designed with the main function of the production, storage, and manipulation of any kind of text document that is located on a computer or word processor. One of the most popular software example is Microsoft Studio's Word Processor from their Office Software Suite.

4 0
4 years ago
What country threatens Denmark at the beginning of Hamlet as evidenced in Marcellus’s question, "Why this same strict and most o
Ghella [55]

Answer: Norway is threatening Denmark

Explanation: Marcellus’s country is threatened with invasion by Norway as evidenced by Marcellus questions as to why Denmark is feverishly preparing for war.

6 0
4 years ago
Other questions:
  • Write a C++ program that reads students' names followed by their test scores. The program should output each students' name foll
    9·1 answer
  • What was the first<br> 1:search engine<br> 2:website<br> 3:time the internet started
    6·1 answer
  • To make sound decisions about information security, management must be informed about the various threats facing the organizatio
    10·1 answer
  • Which of the following is not a location where text can be entered​
    15·1 answer
  • What are some effects of the holocaust? She walked along the river until a policeman stopped her. It was one o'clock, he said. N
    8·1 answer
  • Using a process known as ____, network-based IDPSs look for attack patterns by comparing measured activity to known signatures i
    7·1 answer
  • What is the decrypted binary
    9·1 answer
  • 1.
    15·1 answer
  • Who is the host in super monkey ball?
    14·1 answer
  • 4. Arnold curates articles that feature trending lists for an online website. His department is responsible
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!