34 lines
981 B
C++
34 lines
981 B
C++
#pragma once
|
|
#include <string>
|
|
class Student {
|
|
private:
|
|
int number;
|
|
std::string name;
|
|
bool _isAnyNumber;
|
|
bool _isAnyName;
|
|
|
|
public:
|
|
Student();
|
|
Student(const int _number, const std::string _name);
|
|
// Returns student number.
|
|
const int getNumber() const;
|
|
// Returns the string from of the number, so as to display "any"
|
|
const std::string getNumberString() const;
|
|
// Returns student name.
|
|
const std::string getName() const;
|
|
// Set the new number
|
|
void setNumber(const int newNumber);
|
|
// Set the new name
|
|
void setName(const std::string newName);
|
|
// Set the number to "any"
|
|
void setAnyNumber();
|
|
bool isAnyNumber() const;
|
|
// Set the name to "any"
|
|
void setAnyName();
|
|
bool isAnyName() const;
|
|
bool matchesNumber(const Student &otherStu) const;
|
|
bool matchesName(const Student &otherStu) const;
|
|
bool matches(const Student &otherStu) const;
|
|
bool operator==(const Student &otherStu) const;
|
|
};
|