uni

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

commit 293fe340904dd4684393253518cb43ceb935b8ab
parent 047c392b78d378f0ddcd635eca094388983a8663
Author: Christos Margiolis <christos@margiolis.net>
Date:   Sat,  6 Jun 2020 16:01:02 +0300

minor changes

Diffstat:
Massignment-2.3-operoverloading/src/course.cpp | 3++-
Massignment-2.3-operoverloading/src/student.hpp | 9+++++----
Massignment-2.4-inheritance/src/app.cpp | 2+-
Massignment-2.4-inheritance/src/app.hpp | 2+-
Massignment-2.4-inheritance/src/game.cpp | 4++--
Massignment-2.4-inheritance/src/game.hpp | 4++--
Massignment-2.4-inheritance/src/office.cpp | 5++---
Massignment-2.4-inheritance/src/office.hpp | 2+-
Massignment-2.4-inheritance/src/review.cpp | 3++-
Massignment-2.4-inheritance/src/review.hpp | 2+-
10 files changed, 19 insertions(+), 17 deletions(-)

diff --git a/assignment-2.3-operoverloading/src/course.cpp b/assignment-2.3-operoverloading/src/course.cpp @@ -1,6 +1,7 @@ #include "course.hpp" -Course::Course(const std::string& code, const std::string& cname, unsigned int csemester) +Course::Course(const std::string& code, const std::string& cname, + const unsigned int csemester) :code(code), cname(cname), csemester(csemester) {} Course::Course(const Course& c) diff --git a/assignment-2.3-operoverloading/src/student.hpp b/assignment-2.3-operoverloading/src/student.hpp @@ -41,11 +41,12 @@ class Student const std::string& get_name() const; constexpr const char *get_id() const {return this->id;} - constexpr unsigned int get_semester() const {return this->semester;} - constexpr unsigned int get_pcourses() const {return this->pcourses;} - constexpr float *get_grades() const {return (this->pcourses > 0) ? this->grades : nullptr;} + constexpr const unsigned int get_semester() const {return this->semester;} + constexpr const unsigned int get_pcourses() const {return this->pcourses;} + constexpr float *get_grades() const + {return (this->pcourses > 0) ? this->grades : nullptr;} constexpr Course **get_submitted_courses() const {return this->sc;} - constexpr unsigned int get_num_submitted_courses() const {return this->nsc;} + constexpr const unsigned int get_num_submitted_courses() const {return this->nsc;} void set_id (const char *id); void set_name (const std::string& name); diff --git a/assignment-2.4-inheritance/src/app.cpp b/assignment-2.4-inheritance/src/app.cpp @@ -4,7 +4,7 @@ App::App() :serialnum(nullptr), name(""), os(""), manf(nullptr), price(0) {} App::App(const char *serialnum, const std::string& name, - const std::string& os, Manufacturer *manf, int price) + const std::string& os, Manufacturer *manf, const int price) :serialnum(convsn(serialnum)), name(name), os(os), manf(manf), price(price) { if (!std::strcmp(serialnum, "")) diff --git a/assignment-2.4-inheritance/src/app.hpp b/assignment-2.4-inheritance/src/app.hpp @@ -26,7 +26,7 @@ class App public: App(); App(const char *serialnum, const std::string& name, - const std::string& os, Manufacturer *manf, int price); + const std::string& os, Manufacturer *manf, const int price); App(const App& app); virtual ~App(); diff --git a/assignment-2.4-inheritance/src/game.cpp b/assignment-2.4-inheritance/src/game.cpp @@ -4,8 +4,8 @@ Game::Game() :App(), genre(""), online(false) {} Game::Game(const char *serialnum, const std::string& name, - const std::string& os, Manufacturer *manf, int price, - const std::string& genre, bool online) + const std::string& os, Manufacturer *manf, const int price, + const std::string& genre, const bool online) :App(serialnum, name, os, manf, price), genre(genre), online(online) { if (genre.empty() || genre == "") diff --git a/assignment-2.4-inheritance/src/game.hpp b/assignment-2.4-inheritance/src/game.hpp @@ -12,8 +12,8 @@ class Game final: public App public: Game(); Game(const char *serialnum, const std::string& name, - const std::string& os, Manufacturer *manf, int price, - const std::string& genre, bool online); + const std::string& os, Manufacturer *manf, const int price, + const std::string& genre, const bool online); Game(const Game& g); const std::string get_genre() const {return genre;} diff --git a/assignment-2.4-inheritance/src/office.cpp b/assignment-2.4-inheritance/src/office.cpp @@ -1,11 +1,10 @@ #include "office.hpp" -Office::Office() - :App() {} +Office::Office() :App() {} Office::Office(const char *serialnum, const std::string& name, const std::string& os, Manufacturer *manf, - int price, const std::vector<std::string>& ext) + const int price, const std::vector<std::string>& ext) :App(serialnum, name, os, manf, price), extensions(ext) {} Office::Office(const Office& o) diff --git a/assignment-2.4-inheritance/src/office.hpp b/assignment-2.4-inheritance/src/office.hpp @@ -12,7 +12,7 @@ class Office final: public App Office(); Office(const char *serialnum, const std::string& name, const std::string& os, Manufacturer *manf, - int price, const std::vector<std::string>& ext); + const int price, const std::vector<std::string>& ext); Office(const Office& o); ~Office(); diff --git a/assignment-2.4-inheritance/src/review.cpp b/assignment-2.4-inheritance/src/review.cpp @@ -3,7 +3,8 @@ Review::Review() :stars(0), username(""), comment("") {} -Review::Review(int stars, const std::string& username, const std::string& comment) +Review::Review(const int stars, const std::string& username, + const std::string& comment) :stars(stars), username(username), comment(comment) { if (stars < 0 || stars > 5) diff --git a/assignment-2.4-inheritance/src/review.hpp b/assignment-2.4-inheritance/src/review.hpp @@ -16,7 +16,7 @@ class Review public: Review(); - Review(int stars, const std::string& username, + Review(const int stars, const std::string& username, const std::string& comment); Review(const Review& rev);