For this assignment, you are required to design, implement and test a program for the program specification provided below; you are to use the top-down approach for software development. This assignment is your opportunity to demonstrate that you understand the basics of:
The implementation of your program, using C++, should conform to the following constraints; it should:
Your task is to write a small program to assist with a professor managing the marks of the class. The professor needs to record the marks of every student, and to gather information about the marks. The program will be used to store the marks of 10 students (using an array) and then calculate and display various performance statistics about the class: the average, minimum and maximum marks, as well as the number of students below the pass mark. The program has been broken down into a number of tasks to assist you with your development. You should write your code so that if the number of volunteers changes in the future, the changes to the code will be kept to a minimum. For each of the tasks provided, you should provide basic design information, such as any data validation, calculations that need to be preformed and a first level algorithm.
Design and implement a function that fills an array (which has been passed as an argument), capable of storing the marks of 10 students. The function should read in the data from a file. The program should stop reading the file when it reaches the limit of the array. challenge task: The program would be more flexible using dynamic memory for the array. Write a function that will count and return the number of marks in the file. Then declare an array (using the new operator) which will create enough space for all the records. Don’t forget to use delete to remove the space once you’ve finished with it. Only attempt this task when you’re satisfied that the rest of the program is working correctly (and make sure you take a backup first).
Implement four functions that compute and return the average, minimum and maximum values, and number of marks above 10 in the array (passed as an argument).
Design and implement a function that displays the contents of the data in the array (passed as an argument), and then displays various statistics: average, minimum and maximum marks and the number of students below the pass mark. This function should call all the functions that you implemented in task two.
Average mark: 11.5
Number of people with pass mark: 3
Write a function that sorts the data in the array according to the mark. First create a copy of the array. This copy (call it sortedMarksArray) should contain all of the data in the original array. Selection sort (think back to programming 1) should be used to perform the sort. You will need a function to swap two records in the array. The swap function should have two int parameters (for the elements to be swapped). The array ‘sortedMarksArray’) should also be passed in to the function. Use the function from task 3 to display the data from the sortedMarksArray
Once you have each of the above tasks, design and implement a menu system that can be used to test your code, such as: 1. Enter data 2. Display data 3. Sort array and display 4. Exit Enter selection: This menu should be used so that it allows all the tasks completed above to be tested. The menu should be put inside a while loop which will continue to run until the user selects the ‘Exit’ option.