I'm struggling with C++, especially when it's about sorted list. Do they work like arrays? This is what I'm trying to do:
1. Student applicants will now be stored in a link-based sorted list.
2. Student applicants will be organized into two lists: one for female applicants, and one for male. As information for each student is created, these two lists will be created in the client.
3. A new function (clearNames) should be created. The purpose of this function is to check for any students who have not paid their deposits by a certain date. If a student hasn’t paid it by the date specified, then they are removed from the list.
I was going to originally place this in my main, but thinking again I thought it would be easier to place it in the implemenation I have listed below.
#include "Applicant.h"
/* set name and get name*/
void Applicant::setName(string firstName, string lastName)
{
name = firstName + " " + lastName;
}
string Applicant::getName()
{
return name;
}
/* set hours and get hours*/
void Applicant::setHours (int newHours)
{
hours = newHours;
}
int Applicant::getHours()
{
return hours;
}
/*set deposit and get deposit*/
void Applicant::setDeposit(bool newDeposit)
{
deposit = newDeposit;
}
bool Applicant::getDeposit()
{
int paid;
if (paid == 200)
return true;
else
return false;
}
/*Set and get payMonth*/
void Applicant::setPayMonth(int newPayMonth)
{
payMonth = newPayMonth;
}
int Applicant::getPayMonth()
{
return payMonth;
}
/* Set and get payDay*/
void Applicant::setPayDay(int newpayDay)
{
payDay = newpayDay;
}
int Applicant::getPayDay()
{
return payDay;
}
/* Set and get housing*/
void Applicant::setHousing(string newHousing)
{
housing = newHousing;
}
string Applicant::getHousing()
{
return housing;
}
/* Set and get sex*/
void Applicant::setSex(char newSex)
{
sex = newSex;
}
char Applicant::getSex()
{
return sex;
}
/* Add any necessary points to student's RSVP points*/
void Applicant::addPoints(int gpa)
{
int addpoints=0;
int crdhours=0;
if (gpa >= 3.80)
addpoints = addpoints+20;
else if (gpa >= 3.50)
addpoints = addpoints+18;
else if (gpa >= 3.20)
addpoints = addpoints+16;
else if (gpa >= 3.00)
addpoints = addpoints+14;
else if (gpa >= 2.80)
addpoints = addpoints+12;
else if (gpa >= 2.60)
addpoints = addpoints+10;
else if (gpa >= 2.40)
addpoints = addpoints+8;
else if (gpa >= 2.20)
addpoints = addpoints+6;
else if (gpa >= 2.00)
addpoints = addpoints+4;
else
addpoints = addpoints+2;
if (crdhours <= 29)
crdhours = crdhours+10;
else if (crdhours <= 59)
crdhours = crdhours+8;
else if (crdhours <= 59)
crdhours = crdhours+6;
else if (crdhours >= 90)
crdhours = crdhours+4;
points = addpoints+crdhours;
}
/* Deduct any points from student's RSVP points*/
void Applicant::deductPoints(int minuspoints)
{
int infractions;
minuspoints = 2*infractions;
points = points - minuspoints;
}
/*Get the total points for the student*/
int Applicant::getPoints()
{
return points;
}