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
What are the consequences of digital footprint ?
tekilochka [14]

Answer:

The digital footprint that is left behind can have repercussions in all areas of your teen's life, potentially resulting in missed job opportunities, public sharing of personal information, ruined relationships — or, in what is likely more relevant to them right now: Their parents finding out what they've been up to

Explanation:

8 0
2 years ago
Donna is a graphic designer working on a poster for a music concert. What is her objective?
Marina86 [1]

Answer:her objetive is to impress the public with the poster.

Explanation:

The poster have to be about the music. It is very important for the singer or the festival.

The objetive is going on with the festival, with the music and with the concert’s style.

It’s a personal design. But it have to be original for every design.

3 0
2 years ago
Read 2 more answers
Read carefully, is it a he or she?
Tasya [4]
I think there's a typo in the question, otherwise they probably meant a 'she', since the name is Maureen.

Also, the answer is Personal hygiene and grooming.
6 0
3 years ago
Read 2 more answers
Please help!! will fan and medal
levacccp [35]
So here are the answers that would best complete the given statements above.
1. <span>The standard resolution for graphics on the Web is 72 dpi.
2. </span> The larger the <span>resolution, the larger the file size.
3. </span>An Inline <span>image is an image that appears on a Web page.
4. File </span><span>size, download times, and the number of colors are factors that will help you decide which graphic format you should use.
5. </span> Adobe Photoshop <span>is an image editing program.
6. The IMG tag </span><span>s used to bring an image into a Web site. 
7. The PNG </span><span>format was the most recently developed popular graphic format. </span>
7 0
3 years ago
Read 2 more answers
What is the biggest danger when you reveal information such as your Social Security number?
Dima020 [189]

based off my knowledge im gonna to go with OPTION A because ur social security number holds information like your brith etc

6 0
2 years ago
Read 2 more answers
Other questions:
  • For local travel addresses and street names should be
    14·1 answer
  • Is a book considered technology?
    8·2 answers
  • A function may return a pointer, but the programmer must ensure that the pointer:
    14·1 answer
  • It is safe to interchange oxygen and fuel gas hoses. A. False B. True
    13·2 answers
  • Network topology is a direct representation of
    9·1 answer
  • I made Pico with a Ray Gun (Next is Dad/Tankman)<br><br> Opinons?
    11·2 answers
  • Learning in a digital environment is also called [blank] learning.
    11·2 answers
  • You hide three worksheets in a workbook and need to unhide them. How can you accomplish this?.
    11·1 answer
  • A site, a domain, or an organizational unit in active directory is referred to as a:____.
    6·1 answer
  • identify the difficulties with the k-nearest neighbor algorithm. a. both a and b b. calculate the distance of the test case from
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!