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
The computer stores a program while the program is running, as well as the data thatthe program is working with, in _____.
kenny6666 [7]

hard drive is wht the awnser is

8 0
3 years ago
What is number system?<br>​
MrMuchimi

Answer:

A numeral system is a writing system for expressing numbers; that is, a mathematical notation for representing numbers of a given set, using digits or other symbols in a consistent manner. The same sequence of symbols may represent different numbers in different numeral systems.

Explanation:

8 0
2 years ago
Cuando, Quien, Donde y Como empieza a funcionar Amazon?
vlabodo [156]

Answer:

It started working in July 16,1995. Mr Jeff Benzos was the founder of Amazon. An is located in 410 Terry Ave N, Seattle 98109,WA.

Explanation:

7 0
3 years ago
Create a float variable named circumference.
Likurg_2 [28]

Answer:

Float circumference; // Create a float variable

Explanation:

The float datatype is used for storing the decimal point values .The syntax  to declaring  any float variable is given below.

float variable-name;

float  circumference; // create a float variable

circumference=89.9007;; // store the value in circumference

Following are program in c++

#include <iostream> // header file

using namespace std; //namespace

int main() // main function

{

   float circumference; // creating variable float

   circumference=89.9007; // storing value

   cout<<circumference;  // display value circumference

   return 0;

}

Output:

89.9007

5 0
3 years ago
What is the very first tag you must enter into a new HTML Document?
podryga [215]

Answer:

<HTML> tag

Explanation:

The first tag in any HTML file is the <HTML> tag. This tells web browsers that the document is an HTML file

4 0
3 years ago
Read 2 more answers
Other questions:
  • The EPA requires the use of precise forms called ?
    14·1 answer
  • A job posting is the best way to find out what _____ are required for a position.A.aptitudes B.hard skills C.soft skills D.dress
    10·2 answers
  • Which of the following statements about the OSI is FALSE?A. The OSI model encourages modular design in networking.B. Each protoc
    8·1 answer
  • (Analyze scores) Write a program that reads an unspecified number of scores and determines how many scores are above or equal to
    10·1 answer
  • Asian-American men are often represented in the media as _____.
    8·2 answers
  • While software vendors generally provide evaluation or demonstration copies of their products, hardware vendors never provide ev
    15·1 answer
  • Identify a factor that is unlikely to influence the length of time people wait in the lunch line.
    8·2 answers
  • In c++ 11, the ________ tells the compiler to determine the variable's data type from the initialization value.
    6·1 answer
  • A trackerball is a pointing device
    9·1 answer
  • If a citation has a volume, title, and page numbers, it is a:
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!