Assignment Goals: To learn to use arrays and control structures to process data. Assignment: 1. Reading: Chapter 8. 2.Textbook: Starting Out with C++: Early Objects, 9th Edition, by Tony Gaddis, Judy Walters, and Godfrey Muganda, Pearson, 2016. ISBN-13: XXXXXXXXXXSorry I can't provide the textbook)
Programming Exercise: Write a program to perform the following tasks: 1) Create a txt file named “hw1data.txt” that contains 30 students’ test scores in the range of 0~100. Assume test scores are integers. You can use the following sample data: XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXXRead 30 test scores from the file “hw1data.txt” and store them in a one-dimensional array. 3) Write a function printList that prints the content of an array on the screen. The function has two formal parameters: an int array and an int variable containing the size of the array. 4) Write a function getLargest that finds and returns the largest value (first occurrence if more than one) in an array. 5) Write a function getSmallest that finds and returns the smallest value (first occurrence if more than one) in an array. 6) Write a function getAverage that finds and returns the average value of an array. The average value should be of type double. 7) In the function main, call the above functions to output all the test scores stored in the array, as well as the highest, the lowest, and the average test score. 8) In the function main, write statements to find the number of scores in each of the following ranges: XXXXXXXXXXDeclare file stream variable for example, ifstream infile; 3) Open input file for example, infile.open(“hw1data.txt”); 4) Input data from file for example, infile >> x; 5) Close the file infile.close(); Submission: Name your source file as hw1main.cpp when you create your C++ project and only submit your source file hw1main.cpp as an attachment via the Homework1 Submission link on Blackboard. Do NOT submit your project files. Please include the integrity statement “I certify that this submission is my own original work” and your name and RAM ID as comments in the source file.
Last, Modify your program so that it can read and process a flexible number of scores, assuming the total number of scores is no more than 200. In addition, in the function main, output the total number of scores read from the file. Hints: Consider using an array of size 200 and using a while loop to read all the scores from a file and track the number of scores that have been read.