Website Summary Files Commits Branches @commit @diff @stats
path: root / Sem. 09 / task1 (not finished) / Grade.cpp
diff options
context:
space:
mode:
Commit8cf1283a4ffb9fe1901c29c087fa376de82726af (patch)
Author
 angeld55 <angel_dimitriev@abv.bg>
2022-02-19 23:30:52 +0200
Committer
 angeld55 <angel_dimitriev@abv.bg>
2022-02-19 23:30:52 +0200
Filesabdfe6bf526100dcce87a88563100e02adf7605e /Sem. 09/task1 (not finished)/Grade.cpp
Object-oriented_programming_FMI-8cf1283a4ffb9fe1901c29c087fa376de82726af.tar
Object-oriented_programming_FMI-8cf1283a4ffb9fe1901c29c087fa376de82726af.tar.gz
Object-oriented_programming_FMI-8cf1283a4ffb9fe1901c29c087fa376de82726af.zip
Parentd73a7ec225516657dec74472a0491330e9999217 (diff)
clean up
1 files changed, 0 insertions, 69 deletions
-rw-r--r--Sem. 09/task1 (not finished)/Grade.cpp69
diff --git a/Sem. 09/task1 (not finished)/Grade.cpp b/Sem. 09/task1 (not finished)/Grade.cpp
deleted file mode 100644
index 4302166..0000000
--- a/Sem. 09/task1 (not finished)/Grade.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-#include "Grade.h"
-
-
-Grade::Grade() : taskName(nullptr)
-{
- setTaskName("Unknown");
- setGrade(2);
-}
-
-Grade::Grade(const char* taskName, size_t gradeValue) : taskName(nullptr)
-{
- setTaskName(taskName);
- setGrade(gradeValue);
-}
-
-void Grade::free()
-{
- delete[] taskName;
-}
-void Grade::copyFrom(const Grade& other)
-{
- gradeValue = other.gradeValue;
-
- taskName = new char[strlen(other.taskName) + 1];
- strcpy(taskName, other.taskName);
-}
-
-Grade::Grade(const Grade& other)
-{
- copyFrom(other);
-}
-
-Grade& Grade::operator=(const Grade& other)
-{
- if (this != &other)
- {
- free();
- copyFrom(other);
- }
- return *this;
-}
-Grade::~Grade()
-{
- free();
-}
-
-const char* Grade::getTaskName() const
-{
- return taskName;
-}
-size_t Grade::getGrade() const
-{
- return gradeValue;
-}
-
-void Grade::setGrade(size_t grade)
-{
- if (grade < 2 || grade > 6)
- throw std::exception("error!");
-
- gradeValue = grade;
-}
-
-void Grade::setTaskName(const char* name)
-{
- delete[] taskName;
- taskName = new char[strlen(name) + 1];
- strcpy(taskName, name);
-} \ No newline at end of file