Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

https://www.cs.uky.edu/~kwjoiner/cs215/labs/lab9.pdf IN C++! Learning Objective: - Coding and unit testing of a simple class with a partial-array data member. - Submitting multiple files in Canvas

https://www.cs.uky.edu/~kwjoiner/cs215/labs/lab9.pdf

IN C++!

Learning Objective: - Coding and unit testing of a simple class with a partial-array data member. - Submitting multiple files in Canvas Specifications: Get and use the main() program provided on the course website. This will be used to test your class. You can start your lab in Visual Studio, then - add new item to source files called lab9.cpp - Copy/paste from the text file on the website. - Add your comment box at the top Add two new source files to your VS Project: student.h and student.cpp Use these to code the interface and implementation of the following class. Create a class called student. It should have the following data members: - Name of student - A Partial Array of scores [maximum of 10 scores] - Initialize the name to empty string, and the number of scores to 0 in the Constructor. The class should have the following methods: - setName: given a new name, sets the data member to the new name given. - setScores: given an array of integers and number of scores, if the number of scores given is lower than 0 or greater than the maximum number, prints: student::setScores(): invalid numScores given! Otherwise, it copies the given array into the scores data member, and sets the number of scores to the given value. - addScore: given a new score, adds the score to the list by copying it into the next available slot, and incrementing number of scores. When the array is full, prints: student::addScores(): MAX SCORES exceeded! - getName: simply returns the data member. - getAvg: when the number of scores is 0, returns 0.0; otherwise, returns the average of the scores in the list. - getScores: given an array of integers (which is already pass-by-reference), fill the array with the current contents of the score data member and return the current number of scores data member. - print: on one line, prints the name, average (by invoking getAvg()), number of scores, and scores as shown in the example below. Submission: Using MS-Windows Explorer: - be sure to SAVE ALL before submitting. - find the folder where your .h and .cpp files are saved - highlight one of the files, the press ctrl and highlight the others o .h and .cpp files ONLY - Right-click on one of the highlighted files and select send to / compressed (zip) file - Rename .zip file created to lab9.zip - Submit the .zip file

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Transactions On Large Scale Data And Knowledge Centered Systems Xxiv Special Issue On Database And Expert Systems Applications Lncs 9510

Authors: Abdelkader Hameurlain ,Josef Kung ,Roland Wagner ,Hendrik Decker ,Lenka Lhotska ,Sebastian Link

1st Edition

366249213X, 978-3662492130

More Books

Students also viewed these Databases questions