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]
4 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]4 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
Under which reflection(s) is the image of line m also a line?
lubasha [3.4K]

Answer:

c

Explanation:

5 0
3 years ago
Read 2 more answers
Will creates an entry in his calendar and marks it as an all-day instance. Which item has he created?
Hatshy [7]

Answer:

The answer u looking for is event

5 0
3 years ago
Read 2 more answers
the header, in an academic report, typically contains the author’s name and the current page number true or false
kolbaska11 [484]
TRUE

True


In most academic reports, most specifically, an MLA academic report, Student’s last name and current page number is contained in the headers. In MLA, which is most common used formatting guide in academic reports, headers numbers all pages consecutively within the right margin.


6 0
3 years ago
What term specifies how information systems resources should be used and how they should work together?
jarptica [38.1K]

Answer:

b.Information systems architecture

Explanation:

Information System Architecture defines a system in terms of its resources and how they interact with each other. Some aspects of the Information System Architecture include the data that is managed by the system and the architecture of the application software. Another aspect is configuration, which involves the hardware architecture of the system. The organization of the system takes a look at the maintenance of the system while the communication aspect architecture looks at the networks that link the different resources e.g topology diagrams.

6 0
3 years ago
Excel: Add a new row to a table by clicking in the
steposvetlana [31]
The correct answer is B!
7 0
3 years ago
Other questions:
  • Write a new program called Lab7D that will read strings from a text file and turn them into "encrypted code". Create a bool func
    14·1 answer
  • A malware-infected networked host under the remote control of a hacker is commonly referred to as:
    10·2 answers
  • All computers can support multiple internal hard drives. <br><br> a. True <br><br> b. False
    13·1 answer
  • Current versions of windows support file names up to ________ characters long
    5·1 answer
  • The Knowledge Consistency Checker (KCC) ensures the maximum number of hops between any two domain controllers does not exceed wh
    12·1 answer
  • Define a romanNumberToInt function that converts a RomanNumber value, which is a list of Roman digits, into an integer. Hints: -
    7·1 answer
  • What is the value of variable num after the following code segment is executed?
    5·1 answer
  • PLEASE HELP!!!!!!!!!
    8·1 answer
  • Which of the following ""invisible"" marks represents an inserted tab?
    10·1 answer
  • Create a timeline of the evolution of computers and their impact on society
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!