Question
C++ exercise /*#include Student.h *using namespace std; * EXERCISE #6 * * DO NOT USE WHILE LOOPS * * Find the Student record that matches
C++ exercise
/*#include "Student.h"
*using namespace std; * EXERCISE #6 * * DO NOT USE WHILE LOOPS * * Find the Student record that matches the given Student * and update its data. If the Student is not present, add it to the list. * * Remember that each Student has an unique identifier */ void Student::updateStudent(vector
//YOUR CODE HERE
Student.h
#include
using namespace std;
enum Gender{ MALE, FEMALE };
class Student{
private: long id; // Unique ID string name; // Name of student Gender gender; // Gender of student string courseCode; // Course code (CIIC or ICOM) double gpa; // GPA of student
public: Student(long id, const string &name, Gender gender, double gpa){ this->id = id; this->name = name; this->gender = gender; this->courseCode = ""; this->gpa = gpa; }
Student(long id, const string &name, Gender gender, string courseCode, double gpa){ this->id = id; this->name = name; this->gender = gender; this->courseCode = courseCode; this->gpa = gpa; }
Student(){}
static string toString(Student& s){ string genderLetter = (s.gender == MALE ? "M" : "F"); return string("{" + to_string(s.id) + "," + s.name + "," + genderLetter + "," + to_string(s.gpa) + "}"); }
static string toString(vector
static string toString(vector
// Getters long getID(){return id;} string getName(){return name;} Gender getGender(){return gender;} double getGPA(){return gpa;} string getCourseCode(){return courseCode;}
//Setters void setName(string name){this->name = name;} void setGender(Gender gender){this->gender = gender;} void setGPA(double gpa){this->gpa = gpa;} void setCourseCode(string code){this->courseCode = code;}
// EXERCISES static double maxStudentGPA(vector
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started