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
When it comes to saving money, what is a good rule of thumb?
Leviafan [203]
-Not to make impulse buys
-Open a savings account that directly adds a set amount of money into it from your paycheck monthly 
-The '50-30-20' rule(<span>50 percent of your income toward necessities, like housing and bills. Twenty percent should then go toward financial goals, like paying off debt or </span>saving<span> for retirement. Finally, thirty percent of your income can be allocated to wants, like dining or entertainment.)</span>
-Create a budget 
6 0
3 years ago
Read 2 more answers
Which one of these tasks is part of the pre-production phase of game development?
pickupchik [31]
[B], developing the art style guide and production plan.

It wouldn't be [A], because patches are released to consumers of the game, to fix bugs and add new content, which won't be done until post-production.

It wouldn't be [C] either, as it is also post-production, because you are sending the game to produced, packaged and shipped, meaning the game has already been pretty much fully developed.
7 0
3 years ago
Read 2 more answers
What are 3 websites that talk about density of different gases, density in air, behavior of different gases of earth, convection
Tanzania [10]
I don’t know if this supports all, but try lenntech, duckters, and I will add on later
6 0
2 years ago
What is metrical task system algorithm?? and can we use that in online shopping project??
jeyben [28]

Answer:

Metrical task system algorithm is the online algorithm that is used for organizing the online problems like k-server issues, paging issues etc.This task system works in the form of metrics to decrease the complete cost  experienced due to processing of the operation and analyzing the competition.

It can be used for the online shopping project for the analyzing the comparison between the performance on basis of online and offline trends and then optimization can take place according to the the results.

7 0
3 years ago
What is the reason for taking care of design a good computer human interface ​
anygoal [31]

Answer:

computer is one of the part of our technology so that let's take care of it and improve so that we can used for better and sufficient ly not maybe now but maybe soon.

3 0
3 years ago
Read 2 more answers
Other questions:
  • . When you create a template class, ___________.
    15·1 answer
  • On the 74ls74 d flip-flop, the clk input has a small triangle. the pr (preset) and clr (clear) inputs have a circle. what do the
    15·1 answer
  • Using Word, Maureen is writing an outline of a presentation she plans to give to her company. She will be showing a video during
    12·2 answers
  • What does it mean when system ui has stopped?
    9·1 answer
  • What are the ethical implications of online social media after someone has died
    8·2 answers
  • A form’s height is ______________________.<br><br> A property<br><br> A method<br><br> An event
    10·1 answer
  • An automated service that consolidates and distributes information from newsgroups, blogs, forums and news websites is called
    11·1 answer
  • For what purpose is keylogging software used? a. To automatically translate input to another language as the user enters data b.
    10·1 answer
  • What is modularity? Help asap
    9·1 answer
  • Which of the following is true of functions?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!