Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

HELP WITH CODE PLEASE (code preferred is C not C++) Arrays An air quality index measuring the concentration of Carbon Monoxide in Omaha, NE on

HELP WITH CODE PLEASE (code preferred is C not C++)

Arrays

An air quality index measuring the concentration of Carbon Monoxide in Omaha, NE on each day of the current year is stored in a file named CO_omaha_2017.txt. Write a program to read the data from the file into an array of integer values. Dimension the array to be of size 400 but count the number of values as you read them, so that your program can be used throughout the year. Return the count from your read data function and use the count as the array size in the rest of your functions (this is a partially filled array). Your program must calculate and print the average air quality index for the days in the file as well as the day number of the lowest and highest values. The day number is the array index of the largest/smallest value plus 1. Your program must then sort the data using the selection sort algorithm and display the sorted data. All results can be printed to the monitor. Your program must also create and display a frequency array that shows the number of days with each index value. You can assume that the air quality indices range from 0 to 19. To do this, use the air quality index, which is your array value as an index into a second frequency array, incrementing the appropriate element of the frequency array. The Unit 7 notes contain an example program with functions to create and display a frequency array. Your program should have separate functions to: 1) Read the data 2) Find the average 3) Find the day number of the highest and lowest air quality indices 4) Sort the data 5) Create the frequency array 6) Display the highest day, lowest day, average, sorted data, and frequency array Also calculate and display the median of the data set, this is the middle value when the data is sorted or the average of the 2 middle values when the data set size is even.

Contents of : 3 6 5 5 6 6 10 14 7 9 8 9 8 14 14 8 8 5 7 7 10 10 6 5 5 7 6 6 6 8 7 5 7 6 7 7 10 10 8 8 18 19 11 13 9 9 9 5 8 13 3 5 2 2 2 2 3 6 5 5 6 2 3 2 2 3 5 3 3 3 3 3 3 3 5 6 6 6 6 6 6 6 7 8 9 9 9 8 2 2

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases And Information Systems 22nd European Conference Adbis 2018 Budapest Hungary September 2 5 2018 Proceedings Lncs 11019

Authors: Andras Benczur ,Bernhard Thalheim ,Tomas Horvath

1st Edition

3319983970, 978-3319983974

More Books

Students also viewed these Databases questions

Question

Name each compound by the E-Z system. a. b. , ,, C-C Br

Answered: 1 week ago

Question

To find the integral of 3x/(x - 1)(x - 2)(x - 3)

Answered: 1 week ago

Question

What are Fatty acids?

Answered: 1 week ago

Question

What are Electrophoresis?

Answered: 1 week ago

Question

2 What supply is and what affects it.

Answered: 1 week ago