Question: / * TODO: Test 3 - Insert into collection * = = = = = = = = = = = = = = =

/
*
TODO: Test
3
-
Insert into collection
*
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
*
Given a student object, enrolled, and a vector of students,
*
search the students vector to find an open space. If an
*
opening is located, place the enrolled student into that
*
position and return true. If no openings are found, return
*
false.
*
*
Tips:
*
-
An open space is identified by locating a space with a "default"
*
student.
*
-
"Default" students will always have an ID number of
1
0
0
0
0
0
0
*
-
As this a boolean true, the value displayed in the console may not
*
accurately represent your points for this test.
*
/
static bool Test
3
(
vector students, Student enrolled
)
{
return false;
}
/
*
TODO: Test
4
-
Remove from collection
*
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
*
Given an integer idNumber and a vector of students,
*
search the students vector for a student whose ID number
*
matches the idNumber parameter. If the ID number is found
*
replace the student in that position with a student created
*
using the default constructor and return true. If no student
*
with the given ID number is found, return false.
*
*
Tips:
*
-
As this a boolean true, the value displayed in the console may not
*
accurately represent your points for this test.
*
/
static bool Test
4
(
int idNumber, vector students
)
{
return false;
}
/
*
TODO: Test
5
-
Retrieve from collection
*
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
*
Given an integer idNumber and a vector of students,
*
search the students vector for the first student whose ID number
*
matches the idNumber parameter. If the ID number is found,
*
return the student with that ID number. If no student with
*
that ID number is found, return a student created with the
*
default constructor.
*
*
Tips:
*
-
Given the nature of the returned result, the value displayed
*
in the console may not accurately represent your points for
*
this test.
*
/
static Student Test
5
(
int idNumber, vector students
)
{
return
{
}
;
}
class Student
{
private:
string lastName;
string firstName;
int idNumber;
public:
/
/
Default constructor
Student
(
)
{
lastName
=
"
"
;
firstName
=
"
"
;
idNumber
=
1
0
0
0
0
0
0
;
}
/
/
Overloaded Constructor
Student
(
string last, string first, int idNo
)
{
lastName
=
last;
firstName
=
first;
idNumber
=
idNo;
}
/
/
Getters
string GetLastName
(
)
{
return lastName;
}
string GetFirstName
(
)
{
return firstName;
}
int GetIDNumber
(
)
{
return idNumber;
}
/
/
Setters
void SetLastName
(
string last
)
{
lastName
=
last;
}
void SetFirstName
(
string first
)
{
firstName
=
first;
}
void SetIDNumber
(
int idNo
)
{
idNumber
=
idNo;
}
/
/
CAN
'
T USE MULTIPLE RETURN METHODS PER TEST NUMBER
/
/
CAN
'
T USE AUTO
(
&auto
)
CPP only

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!