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
Which user characteristic may not be used to change keyword bids in adwords?:?
AURORKA [14]

The question above has multiple choices as follows;

<span>a. </span>time of day<span>
</span>

<span>b. ad preference</span>
<span /><span>
</span>

<span>c. location
</span>

<span>d. device</span>

The answer is (B) ad preference.


The rest of the choices are able to change keyword bids in adwords apart from ad preference and are among the several types of bid adjustments. You can show ads more or less frequently based on when, where, and how people search.




7 0
4 years ago
A comma is also called a statement terminator. A. True B. False
aleksandrvk [35]

Answer:

The answer is False

Explanation:

A comma is also called a statement terminator. A. True B. False

The answer is False

Comma is used to separate individiual values or data types

variables.

A semi-colon (;) at end of a statement is called terminator.

8 0
3 years ago
4.8 Code Practice: Question 1<br> I need help
nataly862011 [7]

for x in range(5,76,5):

   print(x, end=" ")

I wrote my code in python 3.8. Hope this helps

4 0
3 years ago
When a startup failure occurs before the logon user interface appears, the problem could be hardware-related but it is most like
blondinia [14]

Answer: by using the safe mode

Explanation: to start the computer using the safe mode immediately after the computer is powered on or restarted (usually after you hear your computer beep), tap the F8 key in 1 second intervals.

5 0
4 years ago
Imagine a situation where two developers are simultaneously modifying three different software components. what difficulties mig
lbvjy [14]
A main problem that may arise is if they have created two different ways of adressing the same part of the software
4 0
3 years ago
Other questions:
  • One main advantage of CD-ROMs is that
    14·1 answer
  • Changeover means that ____. (select all that apply)
    7·2 answers
  • ] why was drone-defense equipment deployed at airports in the United Kingdom?
    13·1 answer
  • Which option allows you to customize the order of your data ?
    8·2 answers
  • What is the output of the following code fragment? int i = 1; int sum = 0; while (i &lt;= 15) { sum = sum + i; i++; } System.out
    5·1 answer
  • Which words in the sentence make up the adjective phrase? Which word does the adjective phrase modify? The farmer delivers five
    15·1 answer
  • Amazon Web Services and Microsoft Azure are some of the most widely used _______.
    7·1 answer
  • 9.18 LAB: Exact change - methods Write a program with total change amount as an integer input that outputs the change using the
    11·1 answer
  • Я люблю есть гнезда петух
    11·1 answer
  • Which statement best describes how the programming layer of abstraction in
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!