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
The difference between Return key and word Wrap
saveliy_v [14]
The enter key is used when we want to go directly to the next line while writing whereas through word wrap the cursor automatically shifts to the next line when the word limit for a particular line is exceeded
3 0
3 years ago
Isa wants to find out if his co-worker Alexis is available for an event on Wednesday, February 10th. Which calendar
Elena-2011 [213]
Appoint view
Hope this helps
7 0
3 years ago
I have a message for anyone reading this
uysha [10]

Answer:zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz

Explanation:

4 0
3 years ago
What can help prevent issues related to downloading content from the internet?
vodka [1.7K]

Answer:

D)

Explanation:

3 0
3 years ago
Freya has queued up some transactions to email to customers and others to print. What steps should she take to select all the sa
il63 [147K]

Considering the situation described above, the steps Freya should take to select all the sales transactions to email is "<u>Filter the sales transaction list using Delivery Method set to Email, and then click the checkbox to the left of the table header row</u>."

<h3>The Process of Filter to batch print or email</h3>

This process follows the steps below:

  • From the Delivery method dropdown menu, select Send later or Print later, then Apply.

  • Select the checkboxes for the transactions to email or print.

  • Select the checkbox at the top of the list to mark all.

Hence, in this case, it is concluded that there is a process to follow QuickBooks to carry out Filter to batch print or email.

Learn more about QuickBooks use here: brainly.com/question/25592743

7 0
2 years ago
Other questions:
  • Suppose you have two arrays of ints, arr1 and arr2, each containing ints that are sorted in ascending order. Write a static meth
    7·1 answer
  • What is the maximum number of hosts you can have on a network if the first decimal value of the ip address is between 192 and 22
    10·1 answer
  • In this question, we give two implementations for the function: def intersection_list(lst1, lst2) This function is given two lis
    15·1 answer
  • What process improves the life of a computer
    11·1 answer
  • WHEN COPYING EXISTING SPREADSHEET DATA TO A WORD DOCUMENT YOU NEED TO SELECT?
    12·1 answer
  • A Silicon Valley billionaire purchases 3 new cars for his collection at the end of every month. Let a_n denote the number of car
    8·1 answer
  • Boardman College maintains two files—one for Sociology majors and another for Anthropology majors. Each file contains students'
    5·1 answer
  • A technician has been given a PC that is not powering up. After brief troubleshooting, the technician comes to the conclusion th
    14·1 answer
  • What would a bar graph best be used for? State why and give 2-3 examples of things you could demonstrate with a bar graph
    5·1 answer
  • Write a loop that continually asks the user what pets the user has until the user enters stop, in which case the loop ends. It s
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!