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
Iteru [2.4K]
3 years ago
5

Write a program that calculates the average rainfall for three months. The program should ask the user to enter the name of each

month, such as June or July, and the amount of rain (in inches) that fell each month. The program should then display the average of the three rainfall amounts, rounded to 2 decimal places.
Computers and Technology
1 answer:
Eduardwww [97]3 years ago
8 0

Answer:

import java.util.Scanner;

public class ANot {

   public static void main(String[] args) {

   Scanner input = new Scanner(System.in);

       System.out.println("Enter the month name:");

       String month1 = input.next();

       System.out.println("Enter the amount of rain for "+month1);

       double month1Rain = input.nextDouble();

       System.out.println("Enter the second month: ");

       String month2 = input.next();

       System.out.println("Enter the amount of rain for "+month2);

       double month2Rain = input.nextDouble();

       System.out.println("Enter the Third month: ");

       String month3 = input.next();

       System.out.println("Enter the amount of rain for "+month3);

       double month3Rain = input.nextDouble();

       double averageRainfall = (month1Rain+month2Rain+month3Rain)/3;

       System.out.printf("Average Rainfall is: %,.2f  ", averageRainfall);

   }

}

Explanation:

This is written in Java Programming language

  1. Import  the scanner class to prompt user for the inputs (Months and amount of rainfall for each month)
  2. Find the average of the three rainfall amount by adding up and dividing by 3
  3. Output the average. Pay particular attention to the use of java's printf in order to print the average to 2 decimal places
You might be interested in
Technician A says that the excessive length of a heater hose is intended to protect the heater core from undue stress. Technicia
hammer [34]
It is both true that <span>Technician A says that the excessive length of a heater hose is intended to protect the heater core from undue stress. Technician B says that excessive wear adds to the length of a heater hose, and a replacement heater hose should be roughly three to four inches shorter than its predecessor.  So the asnwer is letter B.</span>
6 0
4 years ago
1. Give state diagrams of DFAs recognizing the following languages. The alphabet is {0, 1}. (a) {w | w is any string except 11 a
storchak [24]

Answer:

Explanation:

The first diagram shows the DFA that accepts that accepts any string except 11 and 111

The second diagram shows every odd position of w is 1

6 0
3 years ago
Session Hijacking refers to the exploitation of a valid computer session where an attacker takes over a session between two comp
noname [10]

Answer:Weak session ID generation algorithm

Explanation: Session hijacking is the hacking by disguising as the authenticated user and illegally exploit the particular computer session. IP packets are invoked by the disguised attacker into the active session between the legal computer user. It is also called session key.

It gives the hacker to use the data and services of the computer in an unauthorized manner. It arises due to the session of communication are not secure and strong,key used for session is weak etc.

5 0
3 years ago
Jasmine took many pictures at a photo shoot. She wants to transfer these pictures from her camera to her laptop for image enhanc
hoa [83]
The answer would more likely be A
If it’s not correct I’m very sorry
5 0
3 years ago
How can social media be used to find out about activities?
ICE Princess25 [194]
Hello RandomHacker


Using social media can inform you when events are happening near by. 

For example: Your favorite singer of band is going on tour and they are doing it near you, social media advertises this and you can find out in time to go.

Hope this helps
-Chris

3 0
3 years ago
Read 2 more answers
Other questions:
  • Adele’s mother owns a Daycare and she wants to learn all about this business, to help her mom and own it one day. Which CTSO sho
    9·1 answer
  • Shelly tells a friend that her computer needs to be fixed because it has been producing a lot of heat and is smoking. Where is t
    10·1 answer
  • According to company policy and administrator must logically keep the Human Resources department separated from the Accounting d
    5·1 answer
  • What are the classifications of computer
    9·1 answer
  • Including the word OR will make a search less specific.<br> O False<br> O True
    8·2 answers
  • What refers to a collection of small sections of code that are stored together to solve many everyday programs?
    11·2 answers
  • There are some games that cannot be described by a single--or even two-- genres. Can you think of any that should be invented?​
    6·1 answer
  • Explain in brief terms some of the technology and developments that were important in the history and development of the Interne
    9·1 answer
  • Both IT professionals and governments must apply ethical principles to certify that emerging technologies are to society.
    13·1 answer
  • While conducting routine maintenance, you discover a network server that needs to
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!