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
A rectangular channel 2 m wide carries 3 m3 /s of water at a depth of 1.2 m. If an obstruction 40 cm wide is placed in the middl
Marta_Voda [28]

harden you could either me or leave

harden you could either me or leave

Xharden you could either me or leave

harden you could either me or leave

BBB

harden you could either me or leave

GO WATCH AFTER OUT NOW RADDED RB

harden you could either me or leave

harden you could either me or leave

harden you could either me or leave

harden you could either me or leave

GO WATCH AFTER OUT NOW RADDED R

harden you could either me or leave

GO WATCH AFTER OUT NOW RADDED R

harden you could either me or leave

harden you could either me or leave

GO WATCH AFTER OUT NOW RADDED R

8 0
3 years ago
A Si sample contains 1016 cm-3 In acceptor atoms and a certain number of shallow donors, the In acceptor level is 0.16 eV above
creativ13 [48]

Answer:

6.5 × 10¹⁵/ cm³

Explanation:

Thinking process:

The relation N_{o} = N_{i} * \frac{E_{f}-E_{i}  }{KT}

With the expression Ef - Ei = 0.36 × 1.6 × 10⁻¹⁹

and ni = 1.5 × 10¹⁰

Temperature, T = 300 K

K = 1.38 × 10⁻²³

This generates N₀ = 1.654 × 10¹⁶ per cube

Now, there are 10¹⁶ per cubic centimeter

Hence, N_{d}  = 1.65*10^{16}  - 10^{16} \\           = 6.5 * 10^{15} per cm cube

5 0
3 years ago
Read 2 more answers
Some of our modern kitchen cookware is made of ceramic materials. (a) List at least three important characteristics required of
Alisiya [41]

Answer:

A)

It should be Non- toxic

It should possess high Thermal conductivity

It should have the Required Thermal diffusivity

B)

  • stoneware : This material has good thermal diffusivity and it  is quite affordable and it is used in making pizza stones
  • porcelain: mostly used for mugs and it is non-toxic
  • Pyrex : posses good thermal conductivity used in oven

C)   All the materials are suitable because they serve different purposes when making modern kitchen cookware

Explanation:

A) characteristics required of a ceramic material to be used as a kitchen cookware

  • It should be Non- toxic
  • It should possess high Thermal conductivity
  • It should have the Required Thermal diffusivity

B) comparison of three ceramic materials as to their relative properties

  • stoneware : This material has good thermal diffusivity and it  is quite affordable and it is used in making pizza stones
  • porcelain: mostly used for mugs and it is non-toxic
  • Pyrex : posses good thermal conductivity used in ovens

C) material most suitable for the cookware.

 All the materials are suitable because they serve different purposes when making modern kitchen cookware

8 0
3 years ago
Water is being added to a storage tank at the rate of 500 gal/min. Water also flows out of the bottom through a 2.0-in-inside di
melomori [17]

Answer:

From the answer, the water level is falling (since rate of outflow is more than that of inflow), and the rate at which the water level in the storage tank is falling is

(dh/dt) = - 0.000753

Units of m/s

Explanation:

Let the volume of the system at any time be V.

V = Ah

where A = Cross sectional Area of the storage tank, h = height of water level in the tank

Let the rate of flow of water into the tank be Fᵢ.

Take note that Fᵢ is given in the question as 500 gal/min = 0.0315 m³/s

Let the rate of flow of water out of the storage tank be simply F.

F is given in the form of (cross sectional area of outflow × velocity)

Cross sectional Area of outflow = πr²

r = 2 inches/2 = 1 inch = 0.0254 m

Cross sectional Area of outflow = πr² = π(0.0254)² = 0.00203 m²

velocity of outflow = 60 ft/s = 18.288 m/s

Rate of flow of water from the storage tank = 0.0203 × 18.288 = 0.0371 m³/s

We take an overall volumetric balance for the system

The rate of change of the system's volume = (Rate of flow of water into the storage tank) - (Rate of flow of water out of the storage tank)

(dV/dt) = Fᵢ - F

V = Ah (since A is constant)

dV/dt = (d/dt) (Ah) = A (dh/dt)

dV/dt = A (dh/dt) = Fᵢ - F

Divide through by A

dh/dt = (Fᵢ - F)/A

Fi = 0.0315 m³/s

F = 0.0371 m³/s

A = Cross sectional Area of the storage tank = πD²/4

D = 10 ft = 3.048 m

A = π(3.048)²/4 = 7.30 m²

(dh/dt) = (0.0315 - 0.0370)/7.3 = - 0.000753

(dh/dt) = - 0.000753

4 0
3 years ago
A rod that was originally 100-cm-long experiences a strain of 82%. What is the new length of the rod?
lisabon 2012 [21]

Answer:

The new length of the rod is 182 cm.

Explanation:

Given that a rod that was originally 100-cm-long experiences a strain of 82%, to determine what is the new length of the rod, the following calculation must be performed:

100 x 1.82 = X

182 = X

 

Therefore, the new length of the rod is 182 cm.

7 0
3 years ago
Other questions:
  • (10 points) A single crystal in the titanium cable is oriented so that the [001] direction is parallel to the applied load. If t
    14·1 answer
  • Give the approximate temperature at which creep deformation becomes an important consideration for each of the following metals:
    5·1 answer
  • The formula for the cross sectional area of specimen at the middle is
    5·1 answer
  • The line touching the circle at a point ....................... is known as ........................... .
    12·1 answer
  • What drives up the cost of consumables?
    6·1 answer
  • Excessive looseness in steering and suspension components can cause _____
    13·1 answer
  • Three-dimensional measuring references all of these EXCEPT:
    10·1 answer
  • Which material has the highest cp value?
    10·1 answer
  • What is the law of physics<br><br><br> 10 points if you tell me the answer and your name
    8·1 answer
  • A motor takes 38 amperes on a 220-volt circuit. Find the horsepower output (hp) of the motor shown with an efficiency of 90%. Ex
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!