Skip to content

realbrandonsexton/console-number-operations

Repository files navigation

Structured Programming Programming Assignment

This project is worth 30% of your total marks for this module. Teams will consist of three students.

All members of each team are expected to make an equal contribution to the project and participate in all aspects of it, including problem development and analysis, coding and documentation. Teams should work together when possible and class time is an ideal opportunity to do this. Individual marks will be awarded where it is apparent that team members have not made an equal contribution to the project.

Note: Where it is obvious that a team member has made little or no contribution to the work effort of the project deliverables; this will result in a mark of zero.

The project is based on how Arrays are handled in C++. You can produce the code to meet the minimum requirements of the project, but extra marks are reserved for teams that provide additional functionality, such as error trapping and handling, etc.

The project solution and documentation must be uploaded to Moodle by Friday, 19/04/2024 no later than 5pm.

Part A

The project itself requires you to develop a menu-driven command line application to manipulate the contents of an Integer Array, as follows:

Note: Each menu option should call the appropriate function to execute the required functionality.

Function prototypes and matching Function Definitions will need to be written for all of the function names highlighted in bold font overleaf:

InputList : which will populate the array with 12 integer values from the keyboard ShowMenu : which will display the list of menu options (1 to 12 listed below)

  1. Display: displays the content of the array to the screen
  2. GetTotal: returns the total of all of the numbers in the array
  3. GetAverage: returns the average value of all of the numbers in the array to 2 decimal places
  4. GetLargest: returns the largest integer value in the array
  5. GetSmallest: returns the smallest integer value in the array
  6. GetNumOccurrences: returns the number of times a particular number appears in the array, e.g. user enters the number 1 and if this number occurs 3 times in the array then the function should return 3.
  7. ScaleUp: updates the content of the array based on the scale factor entered, e.g. user enters a scale factor of 2; the function will then double the value of each number in the array
  8. Reverse: updates the content of the array such that the original set of numbers are now in reverse order. (NOTE: This is not simply displaying the collection in reverse order on the screen).
  9. ZeroBase: updates the content of the array such that all the values are adjusted by the same amount so that the smallest value will be zero.
  10. RemoveNumber: User is prompted to enter the element number that they wish to be removed. For example, enter 1 to remove the 1st number, enter 2 to remove the 2nd number etc. The number is then removed and the array is then updated accordingly.
  11. Sort: Sorts the array such that all the values are in ascending order – smallest to largest.
  12. Quit: Program finishes

Adapt the initial code in the Project application so that the array is now filled from a file called “Numbers.dat”.

The File “Numbers.dat” should only be updated to reflect any changes to the original set of numbers just before the program finishes.

Part B

Adapt your project solution to allow any number of integers to be read in from the file “Numbers.dat” (up to a maximum of 50 integer values should be catered for).

Part C

The design document must include details of your approach to software testing including sample test data together with expected and actual results.**

The design document must include a reflective piece from each student, in which you discuss how the team performed as a whole, what your contribution was, what you learned about all aspects of the project: team work, problem analysis, coding, what worked and could have been done better, etc. 3

Submission Details

Opens: Monday, 8 April 2024, 9:00 AM Due: Friday, 19 April 2024, 5:00 PM

Upload one zipped folder containing your project files from Visual Studio 2022, and your Documentation (PDF).

One member only of each group should submit the files.

The submission deadline is Friday, 19th April at 5pm.

Late submissions will not be accepted.

All members of each team are expected to make an equal contribution to the project and

participate in all aspects of it, including problem development, analysis and coding.

Teams should work together when possible and class time is an ideal

opportunity to do this.

Note: Individual marks will be awarded where it is apparent that team members have not made an equal contribution to the project.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages