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
yuradex [85]
3 years ago
15

Modify the Rainfall Statistics program you wrote for Programming Challenge 2 of Chapter 7 . The program should display a list of

months, sorted in order of rainfall, from highest to lowest.
Engineering
1 answer:
rjkz [21]3 years ago
8 0

Answer:

#include<iostream>

#include <iomanip>

using namespace std;

const int NUM_MONTHS = 12;

double getTotal(double [], int);

double getAverage(double [], int);

double getLargest(double [], int, int &);

double getSmallest(double [], int, int &);

double getTotal(int rainFall,double NUM_MONTHS[])

{

double total = 0;

for (int count = 0; count < NUM_MONTH; count++)

total += NUM_MONTH[count];

return total;

}

double getAverage(int rainFall,double NUM_MONTH[])

{getTotal(rainFall,NUM_MONTH)

average= total/NUM_MONTHS;

return average;

}

double getHighest(int rainFall, double NUM_MONTHS[]) //I left out the subScript peice as I was not sure how to procede with that;

{

double largest;

largest = NUM_MONTHS[0];

for ( int month = 1; month <= NUM_MONTHS; month++ ){

                     if ( values[month] > largest ){

                 largest = values[month];

return largest;

          }

double getSmallest(int rainFall, double NUM_MONTHS[])

{

double smallest;

smallest = NUM_MONTHS[0];

for ( int month = 1; month <= NUM_MONTHS; month){

                     if ( values[month] < smallest ){

                 smallest = values[month];

return smallest;

          }

 

int main()

{

double rainFall[NUM_MONTHS];

 for (int month = 0; month < NUM_MONTHS; month++)

  {

     cout << "Enter the rainfall (in inches) for month #";

     cout << (month + 1) << ": ";

     cin >> rainFall[month];

 

     while (rainFall[month] < 0)

     {

      cout << "Rainfall must be 0 or more.\n"

             << "Please re-enter: ";

      cin >> rainFall[month];

     }

  }

  cout << fixed << showpoint << setprecision(2) << endl;

  cout << "The total rainfall for the year is ";

  cout << getTotal(rainFall, NUM_MONTHS)

      << " inches." << endl;

   cout << "The average rainfall for the year is ";

  cout << getAverage(rainFall, NUM_MONTHS)

      << " inches." << endl;

   int subScript;

cout << "The largest amount of rainfall was ";

  cout << getLargest(rainFall, NUM_MONTHS, subScript)

      << " inches in month ";

  cout << (subScript + 1) << "." << endl;

  cout << "The smallest amount of rainfall was ";

  cout << getSmallest(rainFall, NUM_MONTHS, subScript)

      << " inches in month ";

  cout << (subScript + 1) << "." << endl << endl;

  return 0;

}

You might be interested in
Which Finance jobs can someone pursue with only a high school diploma? Check all that apply.
Zolol [24]

Answer:

Teller, Loan Officer, and Tax Preparer

Explanation:

3 0
3 years ago
Read 2 more answers
PLEASE HELP!! Its easy!!!
Rina8888 [55]

Answer:

C is tire

F is cassette

D is hub

4 0
3 years ago
Read 2 more answers
The product life cycle defines the stages that new products move through as they enter, are established in, and ultimately leave
Bas_tet [7]

Answer:

The four marketing mix of every new business are:

1. Product

2. Place

3. Price

4. Promotion

For each of the stages of product life cycle, those 4p should be use appropriately.

Explanation:

The four marketing mix of every new business are:

1. Product

2. Place

3. Price

4. Promotion

the product life cycle are directly proportional to the 4p of marketing. the product life cycle stages are introduction, growth, maturity and decline.

For each of the stages of product life cycle, those 4p should be use appropriately.

Stages of product life cycle and how the 4p fit into it.

The introduction stage:

at this stage, a new product just want to be introduced to the consumers. the product stage has being developed. The place where the product will fit in will also be consider. the location of people who consume this product. Pricing strategy consider a low price at the introduction stage, the business owner may not get any profit at this stage. then, continuous advertisement to create awareness of the product to the environment.

The growth stage:

the product will continuing to be move to different locations. the standard of the product quality will be maintained. the Pricing will start increasing. then, continuous advertisement to create awareness of the product and working on improving the product to suit the consumer.

the Mature stage:

At this stage, the consumer are fully aware of the product. wide range of location are reach. the pricing has reach its peak. Profit have been maximized. And, competitors of the product are in the market. Corporate social responsibility (CSR) will be the promotional value at this stage.

The Declining stage:

The business product have fully grown to its peak, and its only constant promotional values like CSR, advertisement, bonuses, can sustain it in the market. At this stage also, price comparison with other competitor should be carefully look into.

4 0
3 years ago
*100 POINTS*
jenyasd209 [6]

Answer:

Depending on the size of the shrubs and the tress, will give you a general idea on how long they take to grow. Unless there are small plants that take forever to grow and or large plants that grow quickly. Hope this helps....

Explanation:

3 0
3 years ago
Read 2 more answers
What is a height gage?
Elena L [17]
The answer would be -62 because 62 x 1 equals 62 so that would be the answer.
6 0
3 years ago
Other questions:
  • Air is compressed in a piston-cylinder device. List three examples of irreversibilities that could occur
    13·1 answer
  • Consider a vortex filament of strength in the shape of a closed circular loop of radius R. Obtain an expression for the velocity
    10·1 answer
  • Write analgorithm and a C code to calculate the sum and average value of an array12elements.For example: Array_Temperaure=[10, 1
    6·1 answer
  • The water behind Hoover Dam in Nevada is 221 m higher than the Colorado River below it. At what rate must water pass through the
    6·1 answer
  • List three reasons for surfacing metals.
    8·2 answers
  • Define the Artist class in Artist.py with a constructor to initialize an artist's information. The constructor should by default
    7·1 answer
  • The housing for a certain machinery product is made of two components, both aluminum castings. The larger component has the shap
    10·1 answer
  • What car has autopilot?
    14·2 answers
  • que sabemos de la revolución industrial y como ese proceso impulso el uso de los controles eléctricos en las industrias
    6·1 answer
  • Which level of acceleration should you use when accelerating on a short highway entry ramp?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!