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]
2 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]2 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
If you wish to install a new OS without disturbing the old one so that you can boot to either OS, what type of boot setup should
aleksley [76]

There are different kinds of installations of system software. If you wish to install a new OS, the type of boot setup that one should create a dual.

A dual boot, or multiboot when used, allows one to be able to install a new OS without hindering the activity of the old one, so that one can boot to either OS.

Multi-booting is simply known as the process whereby a person installs multiple operating systems on a single computer, and being able to choose which one to boot.

Dual-booting is a very common configuration that is known to all. It pertains to two operating systems.  

See full question below

If you wish to install a new OS without disturbing the old one so that you can boot to either OS, what type of boot setup should you create?

dual

cross

controlled

Learn more about dual boot from

brainly.com/question/13483046

7 0
2 years ago
Which element of the security policy framework requires approval from upper management and applies to the entire organization?A.
Sav [38]

Answer: A) Policy

Explanation:

Security policy framework is the regulations that are links the information security of an organization with the professionals and business .It maintains the responsibilities and documentation with security .

  • Policy is the document containing expectation,importance, requirement and scope of an organization about security .This security plan is high level document that need to be approved by higher management for implementation in company.
  • Other options are incorrect because standard principles, guidelines in form of regulation and procedure is the manner that is not required for to be permitted by higher management for being implemented on the business organization.
  • Thus the correct option is option(A).
8 0
3 years ago
A hard drive cannot be partitioned until the device <br> is set.
PilotLPTM [1.2K]
Yeah that true I asked my grandpa
3 0
2 years ago
What is the name of the first practical asymmetric cryptosystem that was created?
victus00 [196]

Answer:

I think the name is RSA

4 0
3 years ago
Assume there is a class AirConditioner that supports the following behaviors: turning the air conditioner on and off, and checki
vaieri [72.5K]

Answer:

yes?

Explanation:

8 0
2 years ago
Other questions:
  • What is a fragment shader? Question 5 (3 marks) What is trilinear filtering?
    8·1 answer
  • Once your hard drive is installed what needs to be done to the drive and what do these two tasks do
    12·1 answer
  • #Write a function called string_finder. string_finder should #take two parameters: a target string and a search string. #The fun
    14·1 answer
  • What is the difference between primary storage,secondary storage and offline storage what type of storage can be
    6·2 answers
  • You have dinner with your family and tell them that you have taken bcis. your mother tells you that she is proud of you and that
    9·1 answer
  • Is it necessary that every autonomous system use the same intra-AS routing algorithm? Why or why not?
    10·1 answer
  • Which of the following statements are true?
    13·1 answer
  • Activity
    7·1 answer
  • PLEASE HELP, Answer Correctly..Will give a bunch of brainlist points ​
    10·1 answer
  • Can someone please give me timetable managment system with data structures in java?
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!