diff --git a/Solutions/maaaaaaaax12/Game Shop/Part 1/Main.cpp b/Solutions/maaaaaaaax12/Game Shop/Part 1/Main.cpp new file mode 100644 index 0000000..bb7f9fa --- /dev/null +++ b/Solutions/maaaaaaaax12/Game Shop/Part 1/Main.cpp @@ -0,0 +1,10 @@ +#include "Shop.h" + +int main() +{ + Item* Exalibur = new Item("Excalibur", "The legendary sword of King Arthur", 12, 1024); + Exalibur->Describe(); + + Item STeel_Armor("Steel Armor", "Protective covering made by steel", 15, 805); + STeel_Armor.Describe(); +} \ No newline at end of file diff --git a/Solutions/maaaaaaaax12/Game Shop/Part 1/Shop.cpp b/Solutions/maaaaaaaax12/Game Shop/Part 1/Shop.cpp new file mode 100644 index 0000000..c47354b --- /dev/null +++ b/Solutions/maaaaaaaax12/Game Shop/Part 1/Shop.cpp @@ -0,0 +1,19 @@ +#include "Shop.h" + +#include +#include + +Item::Item(string name, string description, int weight, int value) + :name(name), description(description), weight(weight), value(value) +{ + +} + +void Item::Describe() +{ + cout.setf(ios::left); + cout << setw(13) << "Name" << "= " << name << endl; + cout << setw(13) << "Description" << "= " << description << endl; + cout << setw(13) << "Weight" << "= " << weight << endl; + cout << setw(13) << "Value" << "= " << value << endl; +} \ No newline at end of file diff --git a/Solutions/maaaaaaaax12/Game Shop/Part 1/Shop.h b/Solutions/maaaaaaaax12/Game Shop/Part 1/Shop.h new file mode 100644 index 0000000..07946ca --- /dev/null +++ b/Solutions/maaaaaaaax12/Game Shop/Part 1/Shop.h @@ -0,0 +1,17 @@ +#pragma once + +#include +using namespace std; + +class Item +{ +private: + string name; + string description; + int weight; + int value; + +public: + Item(string name, string description, int weight, int value); + void Describe(); +}; \ No newline at end of file