Website Summary Files Commits Branches @commit @diff @stats
path: root / Sem. 11 / Examples / Bar / AlcoholDrink / AlcoholDrink.cpp
diff options
context:
space:
mode:
Commit4993c6468aa07e7c6a006a721fe82aaa4413eede (patch)
Author
 angeld55 <angel_dimitriev@abv.bg>
2022-05-17 20:42:42 +0300
Committer
 angeld55 <angel_dimitriev@abv.bg>
2022-05-17 20:42:42 +0300
Files819dc184dc1c4d23ff71bdd5d9d538b8ce32a5de /Sem. 11/Examples/Bar/AlcoholDrink/AlcoholDrink.cpp
Object-oriented_programming_FMI-4993c6468aa07e7c6a006a721fe82aaa4413eede.tar
Object-oriented_programming_FMI-4993c6468aa07e7c6a006a721fe82aaa4413eede.tar.gz
Object-oriented_programming_FMI-4993c6468aa07e7c6a006a721fe82aaa4413eede.zip
Parent8af74b1eeed52119ecaaf57ff6779edbc219c34b (diff)
added bar task
1 files changed, 19 insertions, 0 deletions
-rw-r--r--Sem. 11/Examples/Bar/AlcoholDrink/AlcoholDrink.cpp19
diff --git a/Sem. 11/Examples/Bar/AlcoholDrink/AlcoholDrink.cpp b/Sem. 11/Examples/Bar/AlcoholDrink/AlcoholDrink.cpp
new file mode 100644
index 0000000..ddd890e
--- /dev/null
+++ b/Sem. 11/Examples/Bar/AlcoholDrink/AlcoholDrink.cpp
@@ -0,0 +1,19 @@
+#pragma once
+#include "AlcoholDrink.h"
+
+AlcoholDrink::AlcoholDrink():alcP(5) {}
+
+AlcoholDrink::AlcoholDrink(const MyString& name, int ml, int alcP) :Drink(name, ml)
+{
+ setAlcP(alcP);
+}
+void AlcoholDrink::setAlcP(int alcP)
+{
+ if (alcP < 5 || alcP > 98)
+ alcP = 50;
+ this->alcP = alcP;
+}
+int AlcoholDrink::getAlcP() const
+{
+ return alcP;
+} \ No newline at end of file