35 lines
886 B
C++
35 lines
886 B
C++
// Specification file for the Student class
|
|
// Written by: Iurii Tatishchev
|
|
// Reviewed & Modified by: Iurii Tatishchev
|
|
// IDE: CLion
|
|
|
|
#ifndef STUDENT_H
|
|
#define STUDENT_H
|
|
|
|
//using namespace std; //<==== This statement
|
|
// in a header file of a complex project could create
|
|
// namespace management problems for the entire project
|
|
// (such as name collisions).
|
|
// Do not write namespace using statements at the top level in a header file!
|
|
|
|
#include <string>
|
|
using std::string;
|
|
|
|
class Student {
|
|
private:
|
|
double gpa;
|
|
string name;
|
|
|
|
public:
|
|
Student() { gpa = 0 ; name = ""; }
|
|
Student(double gpa, string name) { this->gpa = gpa; this->name = name; }
|
|
|
|
// Setters and getters
|
|
void setGpa(double gpa) { this->gpa = gpa; }
|
|
void setName(string name) { this->name = name; }
|
|
double getGpa() const { return gpa; }
|
|
string getName() const { return name; }
|
|
|
|
};
|
|
#endif
|