Question
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
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started