Website Summary Files Commits Branches @commit @diff @stats
path: root / Sem. 05
diff options
context:
space:
mode:
Commit17650102c81e2e55d0276430517c4cb72a85a1df (patch)
Author
 Angel Dimitriev <angel_dimitriev@abv.bg>
2022-03-22 20:37:31 +0200
Committer
 GitHub <noreply@github.com>
2022-03-22 20:37:31 +0200
Filesbb48209539221c955020b1d61cd20d46230c749b /Sem. 05
Object-oriented_programming_FMI-17650102c81e2e55d0276430517c4cb72a85a1df.tar
Object-oriented_programming_FMI-17650102c81e2e55d0276430517c4cb72a85a1df.tar.gz
Object-oriented_programming_FMI-17650102c81e2e55d0276430517c4cb72a85a1df.zip
Parentb38347d7aa5e670642aea9fd5007bd7f65ca407b (diff)
Update README.md
1 files changed, 9 insertions, 11 deletions
-rw-r--r--Sem. 05/README.md20
diff --git a/Sem. 05/README.md b/Sem. 05/README.md
index a578944..23d1bbb 100644
--- a/Sem. 05/README.md
+++ b/Sem. 05/README.md
@@ -30,11 +30,11 @@ public:
setGrade(grade);
setAge(age);
}
- int getGrade()
+ int getGrade() const
{
return grade;
}
- int getAge()
+ int getAge() const
{
return age;
}
@@ -52,16 +52,14 @@ public:
int main()
{
- while ()
- {
- Test t;// Object is created
- if ()
- {
- Test t2; // Object is created
-
- }// Object is destroyed (t2)
+ Student s(2,3);
+
+ //s.grade = -1; would not compile (grade is private)
+
+ std::cout << s.getGrade(); //return a copy of the grade
+
+ s.setAge(5); //return a copy of the grade
- }//Object is destroyed (t)
}
```