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
Which of the following best explains how the Internet is a fault-tolerant system?
IrinaK [193]

Answer:

A

Explanation:

The Internet is fault-tolerant because cybercriminals can conceal their actions, allowing them the ability to carry out faulty actions without leaving a trace.

This statement is actually the same question I had to answer when in my 2nd year 1st semester in itt.
<3 enjoy

8 0
2 years ago
Read 2 more answers
When you listen to a guitar duet and have trouble hearing the melody, which of the following would best explain the problem?
emmasim [6.3K]

Answer:

One of the guitarists is playing too loud.

Explanation:

My dad plays the guitar...?

I'm shocked it's not "not keeping a steady beat", so I'm certain this is it.

3 0
3 years ago
Read 2 more answers
Which of the following characters is acceptable to use in a filename
Rama09 [41]
You never stated the possible answer choices to your answer, but usually in a filename you can use all letters of the alphabet, but you cannot use any symbols. such as backslashes, percentage signs etc., but underscores you can use, since they can be used for spacing 2 seperate words.
4 0
3 years ago
Read 2 more answers
Describe the steps required for setting the date and time in Windows 7.​
Vinvika [58]

Answer:

Explanation:

   Click the displayed time in the taskbar and then click Change date and time settings.

   Figure : Date and time settings encircled in red

   Date and time settings encircled in red

   Figure : Date and Time window

   Date and Time window

   Click the Date and Time tab.

   Click Change time zone. Make sure the correct time zone is selected. Place a checkmark next to Automatically adjust clock for Daylight Saving Time if it is not already selected, and then click OK.

   Figure : Time Zone Settings

   Time Zone Settings

   Click Change date and time.

   Click the small left and right arrows in the calendar to select a month and year, and then click a day within the month.

   Figure : Date and Time Settings: Date

   Date selection in the Date and Time Settings window

   Change the time by entering the hour, minute, AM or PM, or by clicking the up and down arrow buttons. Click OK when the time matches the current time.

   Figure : Date and Time Settings: Time

   Time setting in the Date and Time Settings window

   The time zone, date, and time have been set.

Synchronizing time with Windows 7 internet time server

Windows can automatically synchronize the date and time with a time server to make sure the time displayed on your computer is accurate. Follow these steps to enable Internet Time:

   note: If your computer is part of a domain, the Internet Time feature is not available. Contact your System Administrator for clock synchronization information.

   Click the displayed time in the taskbar and then click Change date and time settings.

   Figure : Change date and time settings

   Change date and time settings

   Figure : Date and Time window

   Date and Time window

   Click the Internet Time tab, and then click Change settings.

   If you are prompted for an Administrator password or confirmation, type the password or provide confirmation.

   Figure : Internet Time tab

   Internet Time tab

   Make sure that Synchronize with an Internet time server is checked.

   Figure : Internet Time Settings

   Internet Time Settings

   Make sure the computer is connected to the Internet and click the Update Now button.

   The computer connects to an Internet server and updates the time on the computer.

       note: If the computer fails to receive an update from the selected Internet time server, a message opens stating that an error has occurred. Select a different server and try again.

   Click OK.

   Your computer's clock will now regularly syncronize via the Internet.

8 0
3 years ago
Evaluate the benefits of a graduated driver license program for teenagers
poizon [28]

so teens can drive themselves places plus it makes sure you know what you are doing

8 0
3 years ago
Other questions:
  • Information goes into a computer through _______ and comes our through _______
    6·2 answers
  • We have a user Sally Smith who we want to grant the ability to launch applications and browse folders. But we do not want her to
    15·1 answer
  • Differentiate the threat to a computer from electrical surges and spikes versus the threat from viruses
    10·2 answers
  • The more critical a component or service, the higher the level of availability required. True False
    5·1 answer
  • You are going to write a program for Computer test which will read 10 multiple choice questions from a file, order them randomly
    11·1 answer
  • Pressing the _____ key when entering title text in a placeholder creates a new paragraph. BACKSPACE SHIFT DELETE ENTER
    5·1 answer
  • When would you insert a merge field?
    10·2 answers
  • Advantages of a grain crush​
    9·1 answer
  • All banks follow the same guideline for determining if an applicant qualifies for a loan.
    13·1 answer
  • Some operating systems add the command interpreter to the kernel .what will be the justification for this design principle?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!