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
kari74 [83]
3 years ago
9

Create an array to hold the rainfall values. Create a 2nd parallel array (as a constant) to hold the abbreviated names of the mo

nths. I created my arrays to be 1 element bigger than needed, and then disregarded element [0] (so that my months went from [1] = "Jan" to [12] = "Dec").
Computers and Technology
1 answer:
Zarrin [17]3 years ago
4 0

Answer:

#include <stdio.h>

int main()

{

//variable declaration

int low, high;

float lowRain, highRain, total, avg;

 

//array declaration

float rainfall[13];

char monthName[13][10] = {"", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};

//get user input

for(int i=1; i<=12; i++)

{

printf("Enter the rainfall (in inches) for %s: ", monthName[i]);

scanf("%f", &rainfall[i]);

}

 

//display the monthly rainfall

printf("\nThe rainfall that was entered was:\n");

for(int i = 1; i<=6; i++)

printf("%s ", monthName[i]);

printf("\n");

for(int i = 1; i<=6; i++)

printf("%.1f ", rainfall[i]);

printf("\n");

for(int i = 7; i<=12; i++)

printf("%s ", monthName[i]);

printf("\n");

for(int i = 7; i<=12; i++)

printf("%.1f ", rainfall[i]);

 

//variable initialization

low = 1;

high = 1;

lowRain = rainfall[1];

highRain = rainfall[1];

total = 0;

 

//calculate the lowest, highest and averaage rainfall

for(int i=1; i<=12; i++)

{

if(lowRain>rainfall[i])

{

lowRain = rainfall[i];

low = i;

}

if(highRain<rainfall[i])

{

highRain = rainfall[i];

high = i;

}

total = total + rainfall[i];

}

 

avg = total / 12;

 

//display the result

printf("\n\nThe total rain that fell was %.1f inches", total);

printf("\nThe average monthly rainfall was %.1f inches.", avg);

printf("\nThe lowest monthly rainfall was %.1f inches in %s.", rainfall[low], monthName[low]);

printf("\nThe highest monthly rainfall was %.1f inches in %s.", rainfall[high], monthName[high]);

return 0;

}

You might be interested in
Please help me I don’t know what to do
kiruha [24]

Answer:

B

Explanation:

4 0
3 years ago
Read 2 more answers
Which education and qualifications are most helpful for Law Enforcement Services careers? Check all that apply.
bixtya [17]

Explanation:

For IAS..we need a high amptual amount of knowledge..

For IPS..we need master degree and physical fitness too..

For An Advocate..we need Master degree and social Skills..

so..the education and qualifications depends on the various jobs..

HOPE THE ANSWER IS USEFUL

3 0
3 years ago
What is faster C++ or go lang
alukav5142 [94]

Answer:

C++

Explanation:

3 0
3 years ago
What is the purpose of the Occupational Safety and Health Act?
NikAS [45]

Answer:

The purpose of this act was to reduce workplace hazards and implement more safety and health programs for both employers and their employees.  

3 0
3 years ago
Read 2 more answers
What is a limitation of 5G mmWave, despite its high speed?
Allushta [10]

The limitation of 5G mmWave, despite its high speed, is the fact that they have a short range.

  • 5G simply means the fifth generation of wireless technology that has great speed and provides connectivity to cellphones.

  • mmWave is the higher frequency radio band that is very fast. It should be noted that the 5G mmWave is super fast and is being used by large organizations to improve their work.

  • The main limitation of 5G mmWave is that for one to use it, one has to be close to the 5G tower. This is why it's hard for people living in rural areas to benefit from it unless it's situated close to them.

  • It should be noted that despite the fact 5G offers greater bandwidth, which is vital in relieving network congestion, there are still more improvements to be made in order for everyone to benefit.

In conclusion, the limitation of 5G mmWave, is that they have a short range.

Read related link on:

brainly.com/question/24664177

6 0
2 years ago
Other questions:
  • Alicia is a dietitian. She gives other people suggestions for nutrition. She wants to organize a large amount of data concerning
    13·1 answer
  • Forensic computer investigators must _____.
    6·2 answers
  • An administrator running a port scan wants to ensure that no processes are listening on port 23. What state should the port be i
    7·1 answer
  • Which of the following best define grit
    13·1 answer
  • Geobubble Chart (2D) displaying Robot Density Per 10,000 Employees for the specified countries;
    7·1 answer
  • Is this a Bad Cpu processor ? I need some.help ASAP I turn on my.pc and it has no display but everything is on fans and the you
    13·1 answer
  • Web design and development tools
    13·1 answer
  • Describe accessibility in Windows 7 ​
    13·1 answer
  • A ____________ protocol is software that provides or facilitates a connection in which no information is retained by either send
    13·1 answer
  • Write an alogorithm and draw the Flow Chart to
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!