uni

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

commit 897eb49077bb65546102409c7c38f371b5e55793
parent 9c2c18b91edee63ae1c2b71bd186ff0eef7fb343
Author: Christos Margiolis <christos@margiolis.net>
Date:   Thu, 30 Apr 2020 04:29:22 +0300

minor fixes

Diffstat:
Massignment-2.4-inheritance/bin/inheritance | 0
Massignment-2.4-inheritance/obj/appsystem.o | 0
Massignment-2.4-inheritance/src/appsystem.cpp | 11++++-------
3 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/assignment-2.4-inheritance/bin/inheritance b/assignment-2.4-inheritance/bin/inheritance Binary files differ. diff --git a/assignment-2.4-inheritance/obj/appsystem.o b/assignment-2.4-inheritance/obj/appsystem.o Binary files differ. diff --git a/assignment-2.4-inheritance/src/appsystem.cpp b/assignment-2.4-inheritance/src/appsystem.cpp @@ -36,7 +36,7 @@ bool AppSystem::read_data(const char *fpath) //f.exceptions(std::ifstream::failbit | std::ifstream::badbit); try { - f.open(fpath, std::ios::in); + f.open(fpath); if (f.is_open()) { std::string skip; @@ -46,7 +46,7 @@ bool AppSystem::read_data(const char *fpath) std::string sn, name, email; std::getline(f, sn, ','); std::getline(f, name, ','); - std::getline(f, email, ','); + std::getline(f, email); if (f.eof()) break; std::cout << sn << " " << name << " " << email << std::endl; manfs.push_back(new Manufacturer(sn.c_str(), name.c_str(), email)); @@ -194,11 +194,8 @@ const std::vector<Game *> AppSystem::get_goodgames() const int sum = 0, count = 0; for (auto& rev : revs) { - if (rev->get_stars() > 4) - { - sum += rev->get_stars(); - count++; - } + sum += rev->get_stars(); + count++; } if (sum / count > 4) ggames.push_back(o); }