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
if an individual inserts a thumb drive containing classified information on a computer in the office that is not part of the cla
KATRIN_1 [288]

Answer: Spillage

Explanation:

7 0
3 years ago
The image shows a sample group contract.
Shtirlitz [24]

Answer: c

Explanation:I done this before;DDD

8 0
3 years ago
Read 2 more answers
What is the primary uses of cell phone
den301095 [7]

Some primary uses of cell phones include, keeping in touch with friends or family. As well as communicating to work and to have in the event of an emergency.

8 0
3 years ago
Read 2 more answers
Does anyone know the code for codeHS 5.4.7 teenagers?
Over [174]

Answer:

function start(){

var age = readInt("Age: ");

if(age == 15){

println("Yes, you are a teenager.");

}else{

println("No, you are not a teenager.");

}

}

Explanation:

6 0
3 years ago
If you use your computer primarily for telnet into a remote computer, will you have a large long distance telephone bill?
Nikolay [14]

If you use your computer primarily for telnet into a remote computer, a person will not have a large long distance telephone bill.

<h3>What is telnet used for?</h3>

Telnet is known to be a kind of a network protocol that is said to be used to virtually look into a computer and to give a two-way, working hand in hand and text-based communication channel that exist between two machines.

Note that, If you use your computer primarily for telnet into a remote computer, a person will not have a large long distance telephone bill because it does not apply in any way.

Learn more about telnet from

brainly.com/question/23640188

#SPJ1

4 0
2 years ago
Other questions:
  • Which behavior could be acceptable at a classical concert as well as at a ball game? standing for an exceptional performance che
    9·2 answers
  • Alternating Current or AC is better for use in ___________, while DC direct current is needed in _________ .
    15·2 answers
  • You have been asked to report on the feasibility of installing an IP CCTV camera system at your organization. Detail the pros an
    5·1 answer
  • What is the decimal representation of the following signed binary numbers?
    6·1 answer
  • How we know that how many domain exist in window server 2012?
    14·1 answer
  • Please as soon as possible
    13·1 answer
  • Write a calculator program that will allow only addition, subtraction, multiplication &amp; division. Have the
    7·1 answer
  • The cost to ship a package is a flat fee of 75 cents plus 25 cents per pound. 1. Declare a const named CENTS_PER_POUND and initi
    12·1 answer
  • Do you want my hero academia?<br><br><br><br><br><br> if so, who's your favorite character :&gt;
    5·2 answers
  • There are many ways you can improve the performance of a website from an SEO perspective. When it comes to link building, which
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!