Objective:

The purpose of this project is to expose you to: Classes, objects, data members, member functions, and header files.

Problem Specification:

Design a class that will do the following:

  • Accept a student's name (string) and maintains an array of test scores which might be an integer, a float or a double.
  • If there is room you can add a score at the first available position. That is the position immediately following the last added score. If the array is empty, you add at the first position. If the array is full, then you cannot add and must indicate that. The function add () is a boolean function that returns true when an item is added , otherwise it returns a false.
  • If there are scores in the array, you can remove the last score; scores in the middle or front may not be removed. If the array is empty then you cannot remove and must indicate that. The function remove () is a boolean function that returns true when an item is removed , otherwise it returns a false.
  • You can also clear the array of all the scores, but before you do that you must call a private function print () which will print the name then the scores in reverse order, that is the scores last to first

Requirements:

  • Create a CRC card as explained in chapter 1.
  • Specify each method's purpose, describe its parameters, and write a pseudo-code version of its header as explained in chapter 1.
  • Create a class diagram showing the class name, public and private members.
  • You are to create a header file that contains the class declaration and interface for the class that will maintain objects of the class.
  • You are to define a default constructor that will ask for a student name to be entered from the keyboard and stores it. It also initializes a counter that keeps track of the number of scores in the array and is maintained when you add, remove, or clear.
  • You have to define a null destructor.
  • The maximum number of test scores is 5 and is stored in the class data as a static constant.
  • The test scores may be integers, floats or doubles.
  • Two methods are defined to determine if the arrayscores isFull or isEmpty.

The file "proj4.cpp" is the client file that tests the methods defined in the implementation file and declared in the header file called proj1.h

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be 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 complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.