diff options
Add files via upload
1 files changed, 17 insertions, 0 deletions
| -rw-r--r-- | Big4AndInheritance/AlcoholDrink.cpp | 17 |
diff --git a/Big4AndInheritance/AlcoholDrink.cpp b/Big4AndInheritance/AlcoholDrink.cpp new file mode 100644 index 0000000..a876a0b --- /dev/null +++ b/Big4AndInheritance/AlcoholDrink.cpp @@ -0,0 +1,17 @@ +include "AlcoholDrink.h"
+
+
+AlcoholDrink::AlcoholDrink(const char* mark, int ml, int percentAlcohol) : Drink(mark,ml)
+{
+ setAlcohol(percentAlcohol);
+}
+void AlcoholDrink::setAlcohol(int alcohol)
+{
+ if (alcohol < 4 || alcohol>98)
+ alcohol = 20;
+ percentAlcohol = alcohol;
+}
+int AlcoholDrink::getAlcohol() const
+{
+ return alcohol;
+}
\ No newline at end of file |
