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
Vaselesa [24]
1 year ago
3

write a rainfall program that stores the total rainfall for each 12 months into an array of doubles. the program should have met

hods that return the following:
Computers and Technology
1 answer:
Troyanec [42]1 year ago
3 0

The severity of the rainfall event is assessed statistically for particular return intervals. The program for the same is written below.

import java.util.Scanner;

import java.io.*;

public class apples{

      public static void main (String[] args){

   Scanner kenny = new Scanner(System.in);

   double rain[]=new double[13];

   double sum = 0;

   double avg =0;

   double most =0;

   double least =0;

   System.out.println("Your local weather man here getting paid to tell you the wrong weather!!");

   System.out.println("");

   System.out.println("Please enter in the following rainfall for the months ahead: ");

   System.out.println("Month\tRainfall (In inches)");

   System.out.print("January: ");

   rain [0] = kenny.nextDouble();

   System.out.print("February: ");

   rain [1] = kenny.nextDouble();

   System.out.print("March: ");

   rain [2] = kenny.nextDouble();

   System.out.print("April: ");

   rain [4] = kenny.nextDouble();  

   System.out.print("May: ");

   rain [5] = kenny.nextDouble();  

   System.out.print("June: ");

   rain [6] = kenny.nextDouble();  

   System.out.print("July: ");

   rain [7] = kenny.nextDouble();  

   System.out.print("August: ");

   rain [8] = kenny.nextDouble();  

   System.out.print("September: ");

   rain [9] = kenny.nextDouble();  

   System.out.print("October: ");

   rain [10] = kenny.nextDouble();

   System.out.print("November: ");

   rain [11] = kenny.nextDouble();

   System.out.print("December: ");

   rain [12] = kenny.nextDouble();

   //(Or rain[] = 1,2,3,4,5,6,7,8,9,10,11,12);

   sum = rain[0] + rain[1] + rain[2] + rain[3] + rain[4] + rain[5] + rain[6] + rain[6] + rain[7] + rain[8] + rain[9] + rain[10] + rain[11] + rain[12] ;

   avg = (rain[0] + rain[1] + rain[2] + rain[3] + rain[4] + rain[5] + rain[6] + rain[6] + rain[7] + rain[8] + rain[9] + rain[10] + rain[11] + rain[12]) / 12;

   System.out.println("The sum of all the rain is: " + sum);

   System.out.println("The average rainfall was:" + avg + " inches");

   System.out.print("The month with the most rain was: ");

      }

   private static void getMaxValue(double[] rain) {

   getMaxValue(rain);

   System.out.println(getMaxValue(rain));

   System.out.println("The month with the least rain was: ");

   }

   private static void getMinValue(double[] rain) {

   getMinValue(rain);

   System.out.println(getMaxValue(rain));    

      }}

Learn more about Scanner here-

brainly.com/question/17102287

#SPJ4

You might be interested in
Given an integer variable i and a floating-point variable f, that have already been given values, write a statement that writes
Tju [1.3M]

Answer:

System.out.println("i = " + i + " f = " + f);

Explanation:

The code above has been written using Java's syntax.

To print or display statements to the console, one of the methods to use is the System.out.println() method.

According to the question, the statement to output is i=value-of-i f=value-of-f which is a string of texts.

Note that value-of-i and value-of-f are already stored in variables i and f respectively. Therefore to print them as part of the string text statement, it is important to concatenate them using the "+" operator as follows:

"i = " + i + " f = " + f

If the value of i is 25 and the value of f is 12.34 then the above statement, after successful concatenation reads:

"i = 25 f = 12.34"

which can then be shown on the console using System.out.println() method as follows:

System.out.println("i = " + i + " f = " + f);

Hope this helps!

8 0
3 years ago
Think of the silliest problem the problem solving process could help with.
arlik [135]

Answer:

if 4 slinkies were put down a set of stairs at different times but reached the bottom at the same time. whats the difference?          

Explanation:

5 0
3 years ago
Read 2 more answers
Ray has to type an invoice using the QWERTY keyboard. Along with letters and numbers, he also has to insert the dollar sign. Whi
olganol [36]

Answer:

Shift and 4 at the same time, or hold shift and press 4.

4 0
3 years ago
1. Do you agree that Facebook is the best social media platform to use for interpersonal communication? Why or why not?
anzhelika [568]
Nah I don't there is a BUNCH of creeps on Facebook so no!
4 0
4 years ago
Read 2 more answers
Mary is writing an article about the animal kingdom she wants to place a image below the text which menu should Mary choose for
umka21 [38]

Answer:

we any

Explanation:

it doesn't really matter

6 0
3 years ago
Other questions:
  • A(n) _______________ supplies one of the most critical aspects of docking stations, but in a smaller, more portable format: supp
    15·1 answer
  • The entrance facility is the place where the connection to a WAN is located. It is basically the point where the LAN begins and
    9·1 answer
  • In c++
    9·1 answer
  • Look at the simple circuit illustrated in the figure above. What will happen when only switch S1 is closed?
    11·2 answers
  • _________ mode is similar to Cipher Feedback, except that the input to the encryption algorithm is the preceding DES output. A.
    11·1 answer
  • Which of the following is a strategy used to enhance communication in a presentation?
    14·1 answer
  • Select the best answer that completes the following sentences. Wireless technology changed the workday to
    6·2 answers
  • Gaming applications allow users to play solo games as well as play with friends and/or other players
    11·1 answer
  • What is the purpose of a computer network needs assessment? to evaluate how to move from the current status to the desired goal
    15·1 answer
  • How did the invention of the printing press affect society?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!