Assignment Overview

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:

  • Program design
  • Program implementation
  • Debugging
  • Documentation
  • Testing

The implementation of your program, using C++, should conform to the following constraints; it should:

  • include at least one working and appropriate example of :
    • a two-dimensional array
    • a switch statement
    • an if statement
    • a while loop
    • a for loop
    • pointers
    • using pointers to iterate through the array
  • basic data validation – for example invalid heights, weights and menu selections
  • make appropriate use of functions – all of your code should not be included in the main function
  • be completed using appropriate coding standards
  • successfully compile using Visual Studio 2008 without errors or warnings. If you develop your code on another system please allow enough time to transfer the file and test that it runs successfully as this is the development environment on which your assignment will be marked..

Program Specifications

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.

Task one:

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).

Task two:

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).

Task three:

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.

Person Mark
1 13
2 8
3 19
4 6
5 18
6 10
7 15
8 8
9 16
10 12
Average mark: 11.5
Minimum: 6
Maximum: 19
Number of people with pass mark: 3

Task four:

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

Task five:

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.

Academic Honesty!
It is not our intention to break the school's academic policy. Projects posted are only used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly fill out the form. Please provide a valid email address and we'll get back to you in less than 24 hours. We will be sending an invoice through PayPal upon confirmation. We are a non profit organization however we need an amount to keep this organization running, and to be able to complete our research and development.