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
GDP measures the production levels of
UkoKoshka [18]

Answer:

A. Standard of Living

Explanation:

Gross Domestic Products (GDP) is a measure of the total market value of all finished goods and services made within a country during a specific period.

Simply stated, GDP is a measure of the total income of all individuals in an economy and the total expenses incurred on the economy's output of goods and services in a particular country. Also, Gross Domestic Products (GDP) is a measure of the production levels of any nation.

Basically, the four (4) major expenditure categories of GDP are consumption (C), investment (I), government purchases (G), and net exports (N).

Hence, the standard of living of the people living in a particular country automatically improves if a nation's level of productivity or production improves; they are able to easily pay for goods and services, as well as save and invest their money.

In contrast, inflation and high unemployment rate are indications of economic downturn, recession and low level of productivity (output) in a country; this would automatically affect the standard of living within such countries.

4 0
3 years ago
The divBySum method is intended to return the sum of all the elements in the int array parameter arr that are divisible by the i
iragen [17]

Answer:

The complete method is as follows:

public static int divBySum(int[] arr, int num){        

     int sum = 0;

     for(int i:arr){

         if(i%num == 0)

         sum+=i;

     }

     return sum;

   }

Explanation:

As instructed, the program assumes that arr has been declared and initialized. So, this solution only completes the divBySum method (the main method is not included)

This line defines the method

public static int divBySum(int[] arr, int num){        

This line declares and initializes sum to 0

     int sum = 0;

This uses for each to iterate through the array elements

     for(int i:arr){

This checks if an array element is divisible by num (the second parameter)

         if(i%num == 0)

If yes, sum is updated

         sum+=i;

     }

This returns the calculated sum

     return sum;

   }

8 0
3 years ago
A queue processes elements in a _____ manner. <br> a. filo <br> b. lifo <br> c. lilo <br> d. fifo
sladkih [1.3K]

A queue processes elements in a <u> fifo</u> manner.

<h3>What is the rule that each stack and queue are understood by?</h3>

The rule used for a queue is to permanently remove the item that has been in the collection the most amount of time.

This policy is known as first-in-first-out or FIFO. The rule used for a stack is to always remove the item that has been in the collection the least amount of time.

<h3>What is queue how it is distinct from stack and how is it implemented?</h3>

The primary difference between Stack and Queue Data Structures is that Stack pursues LIFO while Queue follows FIFO data structure type. LIFO guides to Last In First Out. It means that when we put data in a Pile, it processes the last entry first. Conversely, FIFO guides to First In First Out

To learn more about FIFO,  refer

brainly.com/question/27952133

#SPJ4

3 0
2 years ago
Indicate whether the statement is True or False (Choose FIVE only)
svlad2 [7]

Answer:

its false

Explanation:

because we use it always

4 0
3 years ago
Based on its location in the periodic table, we know that ALL BUT one property applies to the element radon. Which property does
blsea [12.9K]
Radon is not synthetic! It is produced naturally by the decay of uranium and radium. Radon is used in treating cancer - it is radioactive, nonreactive and a gas at room temperature.
6 0
4 years ago
Read 2 more answers
Other questions:
  • Im trying to learn c# for unity does anyone know any good sources
    10·1 answer
  • How many bit strings of length 12 contain the substring 111000?
    9·1 answer
  • Select the correct answer. Matt works for an advertising agency. He is often involved in the designing and development processes
    14·2 answers
  • Create an array of 10 fortune cookie sayings that will be randomly displayed each time the user reloads the page. The fortune wi
    5·1 answer
  • Josephine is in the process of creating ads within her Standard Display campaign. She finds that there are two main ad formats t
    5·1 answer
  • In addition to ranking the relevance of a particular site according to the keywords entered by the user, which of the following
    10·1 answer
  • An example of software is a
    8·1 answer
  • The first page of a website is what?​
    5·2 answers
  • If an ______ is caught dumping hazardous materials, that person can be prosecuted. Answer choices A) Employee B) Employer C) Bot
    7·1 answer
  • You have been asked to advise a group of several universities who want to combine research efforts and store data in the cloud.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!