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
NemiM [27]
4 years ago
11

Design a program that lets the user enter the total rainfall for each of 12 months into a list. The program should calculate and

display the total rainfall for the year, the average monthly rainfall, the months with the highest and lowest amounts.
Computers and Technology
1 answer:
aleksandrvk [35]4 years ago
8 0

Answer:

import java.util.Arrays;

import java.util.Scanner;

public class num1 {

   public static void main(String[] args) {

       Scanner in = new Scanner (System.in);

      int []monthlyRainfall = new int [12];

       System.out.println("Enter rainfall for January");

       monthlyRainfall[0]= in.nextInt();

      for(int i = 1; i<monthlyRainfall.length; i++){

          System.out.println("Enter rainfall for the next Month");

          monthlyRainfall[i]= in.nextInt();

      }

       System.out.println("The complete list is:");

       System.out.println(Arrays.toString(monthlyRainfall));

       //Calculating the total and average rainfall

       int totalRainfall =0;

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

           totalRainfall+=monthlyRainfall[i];

       }

       System.out.println("Total rainfall is "+ totalRainfall);

       System.out.println("Average rainfall is "+(totalRainfall/12));

       // finding the lowest rainfall

       int min = monthlyRainfall[0];

       int minMnth =0;

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

           if(min>monthlyRainfall[i]){

              min = monthlyRainfall[i];

               minMnth =i+1;

           }

       }

       System.out.println("The minimim rainfall is "+min);

       System.out.println("The month with the minimum rainfall is "+minMnth);

       // finding the highest rainfall

       int max = monthlyRainfall[0];

       int maxMnth =0;

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

           if(max<monthlyRainfall[i]){

               max = monthlyRainfall[i];

               maxMnth = i+1;

           }

       }

       System.out.println("The maximum rainfall is "+max);

       System.out.println("The month with the maximum rainfall is "+maxMnth);

   }

}

Explanation:

  • Create an array to hold the list of monthly rainfall from january to December int []monthlyRainfall = new int [12];
  • Prompt user to enter the values for the monthly rainfall and fill up the array with the values using a for loop
  • Print the populated List
  • Use a for loop to calculate the Total rainfall by adding elements from index 0-11
  • Calculate the average rainfall totalrainfal/12
  • Using a for loop, find the maximum and minimum values in the array
  • The index of the minimum value plus 1 Gives the month with the lowest rainfall
  • The index of the maximum value +1 gives the month with the highest value
You might be interested in
Who are the founders of video-sharing site Dailymotion?
Pavlova-9 [17]

In March 2005, Benjamin Bejbaum and Olivier Poitrey founded the Dailymotion website from the living room of Poitrey's apartment in Paris. Six individuals pooled together €6,000 ($9,271 USD) to start the business. In September 2006, Dailymotion raised funds in collaboration with Atlas Ventures and Partech International. They raised 7 million euros which was considered to be the most funds raised in 2006 from the French Web 2.0. In October 2009, the French government invested in Dailymotion through the Strategic Investment Fund. On 25 January 2011, Orange acquired a 49% stake in Dailymotion for €62 million, valuing the company at €120 million.[6]


4 0
3 years ago
F we are reduced to a set of computer algorithms, how do we differentiate ourselves from our programming or our connectome? is i
Goshia [24]

Answer:

Answer explained below

Explanation:

The surface biopsychology and the relatively new science of neuroinformatics are fascinating areas of study are the human brain is the most complex computer in existence. Understanding how it works has been a scientific endeavor for centuries combining the newest advances in computer programming with biochemistry computer modeling allows researchers to collect data and anticipate what may happen in a live brain helping them test and develop hypotheses that can be used in conjunction with experiments in the lab.

The reconstruction of neuronal morphology for simulation is difficult and time consuming, although recent advances in scientific software has somewhat simplified the process using the geometry preparation toolkit illustrates how the complex morphology of a neuron impacts the function of the cell Researchers are able to see the effects of the channels opening and the calcium being released both graphically and numerically.Adolescence involves sexual maturity in terms of hormones and physical development of the body.

The psychosocial context of adolescents is markedly different to that of children and adults Adolescents begin to assert more autonomous control over their decisions emotions and actions and start to disengage from parental control

  • Microchips are about the size of a grain of rice and coated with biocompatible glass upon implantation by syringe connective tissue should form to prevent migration.
  • The procedure is very low.

The current market for these devices includes livestock and laboratory animal industries though the technology is quite useful some problems have already surfaced although some of them tend to be identified with specific programs individuals or locations they are presented here as generic.he processes and methods that we use help determine the greater outcome of the venture,there is a unique quality about humans and that is the need for routine like animals humans too feel a sense of calm when falling into a pattern we are upended when we move to a new home or community when we transfer to a different school and when we change jobs even those who feel that they do not fit in as a quintessential member of society still experience the effects of routine.

That individual will have their process which contributes to the overall success of the group this also applies to education.One student may be inclined to study for seven hours before an exam and another may only study for two each possesses their routine.

  • Neuroinformatics leads us currently neuroscientists collect complex data in ever-increasing amounts fostering increased specialization with resultant challenges to integrate data between and across levels of interaction control and function the field should enhance its wealth of ever-increasing empirical data accumulated from its many disciplines and experimental approaches
  • The purpose of analyzing brain ultrastructure is to understand the normal synaptic communication pathway of neurons and supporting cellular elements and the alternations of such pathways and cellular elements caused by diseases.

6 0
3 years ago
given the numerical value 1010101.11, which of the following number systems is most likely represented.
nasty-shy [4]

Answer:

u have to give me more points

Explanation:

sorry

7 0
3 years ago
Hey yall! Its spoopy season! I am having a live stream on the Spoon app under the username teendragonqueen️‍ if yall wanna join!
Aleks [24]

Answer:

Ok sounds cool.

Explanation:

3 0
4 years ago
Read 2 more answers
"in program arrays12.java a swap method is called. does the swap method exchange parameter values x and y?"
horrorfan [7]
<h2>Yes the swap method exchange parameter values if passed by reference or the value gets changed inside the function.</h2>

Explanation:

Since the program is not given, I will try to guide you about the mode of parameters.

The meaning of swap is interchanging the values. It can be done by using temporary variable or without using it (if the values are integers).

While passing the parameters, there are two ways, call by value/pass by value and call by reference/ pass by reference.

If call by value, then the value gets swapped only inside the function and will not reflected in the calling portion. Call by reference is other way round.

6 0
3 years ago
Other questions:
  • The material chosen for your study group
    11·1 answer
  • Which devices are managed through device management?
    15·2 answers
  • All queries have an explicit location. true of false
    13·2 answers
  • According to the video, what education and experience do employers look for in Reporters and Correspondents? Check all that appl
    10·2 answers
  • Read first a user's given name followed by the user's age from standard input. Then use an ofstream object named outdata to writ
    6·1 answer
  • This is your data.
    11·2 answers
  • Please answer me fast ​
    6·2 answers
  • Write a python program that should determine from the range you choose to enter :
    9·1 answer
  • Heeeeeeeelp :)<br> thx<br> jfdyiusjmkdsuiho;dmcvrvho;j
    5·2 answers
  • What is the initial step to exploring solutions to a problem?
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!