Website Summary Files Commits Branches @commit @diff @stats
path: root / week11 / Exercise03
diff options
context:
space:
mode:
diff --git a/week11/Exercise03/Camera.cpp b/week11/Exercise03/Camera.cpp
new file mode 100644
index 0000000..b56a702
--- /dev/null
+++ b/week11/Exercise03/Camera.cpp
@@ -0,0 +1,8 @@
+#include "Camera.h"
+#include "Electronics.h"
+#include <iostream>
+
+void Camera::Print() {
+ Electroics::Print();
+ std::cout << ' ' << resolution;
+}
diff --git a/week11/Exercise03/Camera.h b/week11/Exercise03/Camera.h
new file mode 100644
index 0000000..d9e480f
--- /dev/null
+++ b/week11/Exercise03/Camera.h
@@ -0,0 +1,9 @@
+#pragma once
+#include "Electronics.h"
+
+class Camera : Electronics {
+ float resolution;
+
+public:
+ virtual void Print() override;
+};
diff --git a/week11/Exercise03/Electronics.cpp b/week11/Exercise03/Electronics.cpp
new file mode 100644
index 0000000..73be261
--- /dev/null
+++ b/week11/Exercise03/Electronics.cpp
@@ -0,0 +1,6 @@
+#include "Electronics.h"
+#include <iostream>
+
+void Electroics::Print() {
+ std::cout << model << ' ' << needsVolts << ' ' << needsAmps;
+}
diff --git a/week11/Exercise03/Electronics.h b/week11/Exercise03/Electronics.h
new file mode 100644
index 0000000..9f3d849
--- /dev/null
+++ b/week11/Exercise03/Electronics.h
@@ -0,0 +1,10 @@
+#pragma once
+
+class Electroics {
+ char model[256];
+ float needsVolts;
+ float needsAmps;
+
+public:
+ virtual void Print();
+};
diff --git a/week11/Exercise03/Laptop.cpp b/week11/Exercise03/Laptop.cpp
new file mode 100644
index 0000000..5c2ea87
--- /dev/null
+++ b/week11/Exercise03/Laptop.cpp
@@ -0,0 +1,7 @@
+#include "Laptop.h"
+#include <iostream>
+
+void Laptop::Print() {
+ Electroics::Print();
+ std::cout << ' ' << screenSize;
+}
diff --git a/week11/Exercise03/Laptop.h b/week11/Exercise03/Laptop.h
new file mode 100644
index 0000000..19b0bd5
--- /dev/null
+++ b/week11/Exercise03/Laptop.h
@@ -0,0 +1,9 @@
+#pragma once
+#include "Electronics.h"
+
+class Laptop : Electronics {
+ float screenSize;
+
+public:
+ virtual void Print() override;
+};
diff --git a/week11/Exercise03/WashingMachine.cpp b/week11/Exercise03/WashingMachine.cpp
new file mode 100644
index 0000000..18caa5f
--- /dev/null
+++ b/week11/Exercise03/WashingMachine.cpp
@@ -0,0 +1,7 @@
+#include "WashingMachine.h"
+#include <iostream>
+
+void WashingMachine::Print() {
+ Electroics::Print();
+ std::cout << ' ' << maxLaundryWeight;
+}
diff --git a/week11/Exercise03/WashingMachine.h b/week11/Exercise03/WashingMachine.h
new file mode 100644
index 0000000..8915393
--- /dev/null
+++ b/week11/Exercise03/WashingMachine.h
@@ -0,0 +1,9 @@
+#pragma once
+#include "Electronics.h"
+
+class WashingMachine : Electronics {
+ unsigned maxLaundryWeight;
+
+public:
+ virtual void Print() override;
+};