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
Ksju [112]
3 years ago
10

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 display a message similar to the following: The average rainfall for June, July, and August is 6.72 inches.
Computers and Technology
1 answer:
sergeinik [125]3 years ago
4 0

Answer:

// program in C++.

#include <bits/stdc++.h>

using namespace std;

// main function

int main()

{

   // string array

   string m[3];

   // array to store rainfall

   double rainfall[3];

   // variables

   double avg_rainfall,sum=0;

   

   for(int i=0;i<3;i++)

   {

       cout<<"Enter name of month "<<i+1<<" :";

       // read month name

       cin>>m[i];

       cout<<"Enter rainfall (inches)  in month "<<i+1<<" :";

       // read rainfall

       cin>>rainfall[i];

       // sum of rainfall

       sum+=rainfall[i];

   }

   // Average rainfall

   avg_rainfall=sum/3;

   // print Average rainfall

   cout<<"Average rainfall for "<<m[0]<<","<<m[1]<<","<<m[2]<<" is "<<avg_rainfall<<" inches."<<endl;

return 0;

}

Explanation:

Create string array "m" to store name of month and double array "rainfall" to store rainfall. Read name of 3 months and rainfall in that month.Find the sum of all the rainfall  and the average rainfall.Print the average rainfall of 3 months.

Output:

Enter rainfall (inches)  in month 2 :45                                                                                    

Enter name of month 3 :july                                                                                                

Enter rainfall (inches)  in month 3 :43                                                                                    

Average rainfall for may,june,july is 42.6667 inches.

You might be interested in
Suppose you have an int variable called number. What Java expression produces the second-to-last digit of the number (the 10s pl
Elden [556K]

Answer:

(number%100) / 10

(number%1000) / 100

Explanation:

5 0
3 years ago
Order the steps to use a logical argument as a rule type.
muminat

Answer:

Click home tab, click conditional formatting, click new rule, use formula to determine

6 0
2 years ago
Read 2 more answers
Which of the following examines the organizational resource of information and regulates its definitions, uses, value, and distr
hichkok12 [17]

Answer:C)Information management

Explanation: Information management is the technique through which the organization and handling of the the data/ information takes place.This technique is made for helping the organization and their business for the supporting the function and processes.

The facilities provided by the information management system is  development, management, designing, innovation etc.

Other options are incorrect because they are used for the coding process,technology and governing of the data, hence no management activity is done by them.Thus, the correct option is option(C).

4 0
3 years ago
What kinds of dogs are there
drek231 [11]
There are al types of dogs what specific breed are you looking for

5 0
3 years ago
Read 2 more answers
You are configuring a firewall to use NAT. In the configuration, you map a private IP address directly to a persistent public IP
Ivan

Answer:

Option B (Static NAT) would be the correct choice.

Explanation:

  • Static NAT seems to be a method of NAT methodology used to navigate as well as monitor internet usage from some kind of specific public IP address to something like a private IP address.
  • Everything always allows the provision of web access to technology, repositories including network equipment inside a protected LAN with an unauthorized IP address.

Some other decisions made aren't relevant to the situation in question. So the above alternative is indeed the right one.

8 0
2 years ago
Other questions:
  • Does Logarithms and Algorithms same things?
    6·1 answer
  • Wireless network devices use ________ to communicate with each other.
    9·2 answers
  • Write an expression that executes the loop body as long as the user enters a non-negative number. Note: If the submitted code ha
    14·1 answer
  • What was the first fully computer animated feature film?
    13·1 answer
  • Microprocessors can’t directly understand programming languages, so programs have to be converted into _____________ that corres
    15·1 answer
  • The architecture that the large paper company Mohawk adopted enables the company to scale technology services up and down instan
    14·1 answer
  • Use the drop-down menus to complete each sentence about the layers of the atmosphere.
    14·2 answers
  • What type of software testing is generally used in Software Maintenance?
    11·1 answer
  • How do I make someone "Brainiest". <br> First person to reply will get "Brainiest"
    8·2 answers
  • It's generally best to use what types of sites for factual internet research? Select all that apply from the choices below.
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!