uni

University stuff
git clone git://git.christosmarg.xyz/uni-assignments.git
Log | Files | Refs | README | LICENSE

commit 44d915d312bcf723e298e792af771a19bb48ca4c
parent 53e0de4be30f1fbe6ed44e26bd99f61b14105df9
Author: Christos Margiolis <christos@margiolis.net>
Date:   Sat,  4 Apr 2020 03:18:54 +0300

removed (void)

Diffstat:
Massignment-2.3-operoverloading/src/student.cpp | 10+++++-----
Massignment-2.3-operoverloading/src/student.h | 18+++++++++---------
2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/assignment-2.3-operoverloading/src/student.cpp b/assignment-2.3-operoverloading/src/student.cpp @@ -21,7 +21,7 @@ Student::Student(const Student& s) std::copy(s.grades, s.grades+psubj, grades); } -Student::~Student(void) +Student::~Student() { delete[] this->AM; delete[] this->grades; @@ -56,14 +56,14 @@ Student& Student::operator= (const Student& s) return *this; } -float *Student::get_grades(void) const +float *Student::get_grades() const { float *ret = new float[psubj]; std::copy(grades, grades+psubj, ret); return ret; } -std::string *Student::get_submitted_subjects(void) const +std::string *Student::get_submitted_subjects() const { std::string *ret = new std::string[numSubmittedSubjects]; std::copy(submittedSubjects, submittedSubjects+numSubmittedSubjects, ret); @@ -103,7 +103,7 @@ void Student::add_grade(float grade) delete[] tmp; } -void Student::detailed_print(void) const +void Student::detailed_print() const { for (unsigned int i = 0; i < psubj; i++) { @@ -113,7 +113,7 @@ void Student::detailed_print(void) const std::cout << "Average grade: " << std::setprecision(2) << calc_average() << std::endl; } -float Student::calc_average(void) const +float Student::calc_average() const { float sum = 0; for (unsigned int i = 0; i < psubj; i++) diff --git a/assignment-2.3-operoverloading/src/student.h b/assignment-2.3-operoverloading/src/student.h @@ -35,13 +35,13 @@ class Student inline bool operator> (const Student& s) const {return (this->semester > s.semester) ? true : false;} inline bool operator>= (const Student& s) const {return (this->semester >= s.semester) ? true : false;} - inline const char *get_AM(void) const {return this->AM;} - inline const std::string& get_name(void) const {return this->name;} - inline unsigned int get_semester(void) const {return this->semester;} - inline unsigned int get_psubj(void) const {return this->psubj;} - float *get_grades(void) const; - inline unsigned int get_num_submitted_subjects(void) const {return this->numSubmittedSubjects;} - std::string *get_submitted_subjects(void) const; + inline const char *get_AM() const {return this->AM;} + inline const std::string& get_name() const {return this->name;} + inline unsigned int get_semester() const {return this->semester;} + inline unsigned int get_psubj() const {return this->psubj;} + float *get_grades() const; + inline unsigned int get_num_submitted_subjects() const {return this->numSubmittedSubjects;} + std::string *get_submitted_subjects() const; inline void set_AM(const char *AM) {this->AM = convert_AM(AM);} inline void set_name(const std::string& name) {this->name = name;} @@ -54,6 +54,6 @@ class Student char *convert_AM(const char *AM); float *convert_PSG(const float *grades); void add_grade(float grade); - void detailed_print(void) const; - float calc_average(void) const; + void detailed_print() const; + float calc_average() const; };