diff --git a/week_5.ipynb b/week_5.ipynb new file mode 100644 index 0000000..364a190 --- /dev/null +++ b/week_5.ipynb @@ -0,0 +1,873 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "turkish-shopper", + "metadata": {}, + "source": [ + "## Question 1:\n", + "Create the class `Society` with following information:\n", + "\n", + "`society_name`, `house_no`, `no_of_members`, `flat`, `income`\n", + "\n", + "**Methods :**\n", + "\n", + "*\t An `__init__` method to assign initial values of `society_name`, `flat`, `house_no`, `no_of_members`, `income`\n", + "*\t`input_data()` To read information from members\n", + "*\t`allocate_flat()` To allocate flat according to income using the below table.\n", + "*\t`show_data()` to display the details of the entire class.\n", + "\n", + "![image](https://user-images.githubusercontent.com/48380735/107130781-429d7100-68d1-11eb-90df-246107a2677b.png)\n" + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "id": "adapted-future", + "metadata": {}, + "outputs": [], + "source": [ + "class Society(object):\n", + " \n", + " def allocate_flat(self):\n", + " if self.income>=25000:\n", + " self.flat='A Type'\n", + " elif self.income>=20000:\n", + " self.flat='B Type'\n", + " elif self.income>=15000:\n", + " self.flat='C Type'\n", + " else:\n", + " self.flat='D Type'\n", + " \n", + " def __init__ (self,society_name, house_no ,no_of_members,income,flat=None):\n", + " self.society_name=society_name\n", + " self.house_no=house_no\n", + " self.no_of_members=no_of_members\n", + " self.income=income\n", + " self.allocate_flat()\n", + "\n", + " def input_data(self):\n", + " self.society_name=input(\"Please enter the society name: \")\n", + " self.house_no=int(input(\"Please enter the house no: \"))\n", + " self.no_of_members=int(input(\"Please enter the number of members: \"))\n", + " self.income=int(input(\"Please enter the income: \"))\n", + " self.allocate_flat()\n", + " \n", + " def show_data(self):\n", + " print(f\"\"\"Society Name\\t:\\t{self.society_name}\n", + "House Number\\t:\\t{self.house_no}\n", + "No of Members\\t:\\t{self.no_of_members}\n", + "Flat\\t\\t:\\t{self.flat}\n", + "Income\\t\\t:\\t{self.income}\"\"\")\n", + " " + ] + }, + { + "cell_type": "code", + "execution_count": 46, + "id": "atlantic-might", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Society Name\t:\tMilkyway Apartment\n", + "House Number\t:\t8\n", + "No of Members\t:\t14\n", + "Flat\t\t:\tA Type\n", + "Income\t\t:\t26000\n" + ] + } + ], + "source": [ + "society_1=Society('Milkyway Apartment',8,14,26000)\n", + "society_2=Society('Fullmoon Apartment',15,11,21000)\n", + "society_3=Society('Venus Apartment',10,7,14000)\n", + "\n", + "society_1.show_data()" + ] + }, + { + "cell_type": "code", + "execution_count": 47, + "id": "revolutionary-server", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Please enter the society name: Kilyos Apartment\n", + "Please enter the house no: 7\n", + "Please enter the number of members: 12\n", + "Please enter the income: 10000\n" + ] + } + ], + "source": [ + "society_1.input_data()" + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "id": "careful-pencil", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Society Name\t:\tKilyos Apartment\n", + "House Number\t:\t7\n", + "No of Members\t:\t12\n", + "Flat\t\t:\tD Type\n", + "Income\t\t:\t10000\n" + ] + } + ], + "source": [ + "society_1.show_data()" + ] + }, + { + "cell_type": "markdown", + "id": "dress-composer", + "metadata": {}, + "source": [ + "## Question 2:\n", + "Define a class named `ItemInfo` with the following description:\n", + "\n", + "`item_code`(Item Code), `item`(item name), `price`(Price of each item), `qty`(quantity in stock), `discount`(Discount percentage on the item), `net_price`(Price after discount)\n", + "\n", + "**Methods :**\n", + "*\tA member method `calculate_discount()` to calculate discount as per the following rules:\n", + "*\tIf `qty <= 10` —> discount is `0`\n", + "*\tIf `qty (11 to 20 inclusive)` —> discount is `15`\n", + "*\tIf `qty >= 20` —> discount is `20`\n", + "*\tA constructor init method to assign the initial values for `item_code` to `0` and `price`, `qty`, `net_price` and `discount` to `null`\n", + "*\tA function called `buy()` to allow user to enter values for `item_code`, `item`, `price`, `qty`. Then call function `calculate_discount()` to calculate the `discount` and `net_price`(price * qty - discount).\n", + "*\tA function `show_all()` or similar name to allow user to view the content of all the data members.\n" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "id": "fourth-exhaust", + "metadata": {}, + "outputs": [], + "source": [ + "class ItemInfo(object):\n", + " \n", + " def calculate_discount(self):\n", + " if self.qty <= 10:\n", + " self.discount = 0\n", + " elif self.qty <= 20:\n", + " self.discount = 15\n", + " else:\n", + " self.discount = 20\n", + " self.net_price = round(self.price * self.qty * (1-self.discount/100),1)\n", + " \n", + " \n", + " def __init__(self, item_code=0, item=None, price=None, qty=None, discount=None, net_price=None):\n", + " self.item_code = item_code\n", + " self.item = item\n", + " self.price = price\n", + " self.qty = qty\n", + " self.calculate_discount()\n", + " \n", + " def buy(self):\n", + " self.item_code=int(input(\"Please enter the item code: \"))\n", + " self.item=input(\"Please enter the item name: \")\n", + " self.price=int(input(\"Please enter the price of item \"))\n", + " self.qty=int(input(\"Please enter the quantity in stock: \"))\n", + " self.calculate_discount()\n", + " \n", + " def show_all(self):\n", + " print(f\"\"\"Item Code\\t:\\t{self.item_code}\n", + "Item Name\\t:\\t{self.item}\n", + "Price\\t\\t:\\t€{self.price}\n", + "Quantity\\t:\\t{self.qty}\n", + "Discount\\t:\\t%{self.discount}\n", + "Net Price\\t:\\t{self.net_price}\"\"\")" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "id": "broadband-brook", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Item Code\t:\t12478\n", + "Item Name\t:\tbutter\n", + "Price\t\t:\t€6\n", + "Quantity\t:\t12\n", + "Discount\t:\t%15\n", + "Net Price\t:\t61.2\n" + ] + } + ], + "source": [ + "product_1 = ItemInfo(12345,'icecream', 4, 10)\n", + "product_2 = ItemInfo(12478,'butter', 6, 12)\n", + "product_3 = ItemInfo(96325,'yogurt', 3, 5)\n", + "\n", + "product_2.show_all()" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "id": "remarkable-newark", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Please enter the item code: 96325\n", + "Please enter the item name: yogurt\n", + "Please enter the price of item 10\n", + "Please enter the quantity in stock: 3\n" + ] + } + ], + "source": [ + "product_3.buy()" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "id": "terminal-campbell", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Item Code\t:\t96325\n", + "Item Name\t:\tyogurt\n", + "Price\t\t:\t€10\n", + "Quantity\t:\t3\n", + "Discount\t:\t%0\n", + "Net Price\t:\t30.0\n" + ] + } + ], + "source": [ + "product_3.show_all()" + ] + }, + { + "cell_type": "markdown", + "id": "latin-delight", + "metadata": {}, + "source": [ + "## Question 3:\n", + "\n", + "Define a class named `Product` with the following specifications:\n", + "#### Data members:\n", + "* `product_id` – A string to store product.\n", + "* `product_name` - A string to store the name of the product. \n", + "* `product_purchase_price` – A flo to store the cost price of the product.\n", + "* `product_sale_price` – A decimal to store Sale Price \n", + "* `Margin` - A decimal to be calculated as `(product_sale_price - product_purchase_price)`\n", + "\n", + "**Remarks** - To store \"Profit\" if Margin is positive else \"Loss\" if Margin is negative.\n", + "\n", + "**Methods :**\n", + "*\tA constructor to intialize all the data members with valid default values.\n", + "*\tA method `set_remarks()` that assigns Margin as `(product_sale_price - product_purchase_price)` and sets Remarks as mentioned below :\n", + "\n", + "![image](https://user-images.githubusercontent.com/48380735/107130956-d91e6200-68d2-11eb-92e3-74006ce1127c.png)\n", + "\n", + "*\tA method `set_details()` to accept values for `product_id`. `product_name`, `product_purchase_price`, `product_sale_price` and invokes `SetRemarks()` method.\n", + "*\tA method `get_details()` that displays all the data members.\n" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "id": "unexpected-identifier", + "metadata": {}, + "outputs": [], + "source": [ + "class Product(object):\n", + " \n", + " def set_remarks(self):\n", + " self.margin = round(self.product_sale_price - self.product_purchase_price,1)\n", + " self.remark = 'Loss' if self.margin < 0 else 'Profit'\n", + " \n", + " \n", + " def __init__(self, product_id=None, product_name=None, product_purchase_price=None, product_sale_price=None, margin=None):\n", + " self.product_id = product_id\n", + " self.product_name = product_name\n", + " self.product_purchase_price = product_purchase_price\n", + " self.product_sale_price = product_sale_price\n", + " self.set_remarks()\n", + " \n", + "\n", + " def set_details(self):\n", + " self.product_id=input(\"Please enter the product id: \")\n", + " self.product_name=input(\"Please enter the product name: \")\n", + " self.product_purchase_price=float(input(\"Please enter the product purchase price \"))\n", + " self.product_sale_price=float(input(\"Please enter the product sale price: \"))\n", + " self.set_remarks()\n", + " \n", + " def get_details(self):\n", + " print(f\"\"\"Product Id\\t\\t:\\t{self.product_id}\n", + "Product Name\\t\\t:\\t{self.product_name}\n", + "Product Purchase Price\\t:\\t€{self.product_purchase_price}\n", + "Product Sale Price\\t:\\t€{self.product_sale_price}\n", + "Margin\\t\\t\\t:\\t€{self.margin}\n", + "Remark\\t\\t\\t:\\t{self.remark}\"\"\")" + ] + }, + { + "cell_type": "code", + "execution_count": 42, + "id": "virgin-jackson", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Product Id\t\t:\tE12478\n", + "Product Name\t\t:\tbutter\n", + "Product Purchase Price\t:\t€6.5\n", + "Product Sale Price\t:\t€8.1\n", + "Margin\t\t\t:\t€1.6\n", + "Remark\t\t\t:\tProfit\n" + ] + } + ], + "source": [ + "product_1 = Product('A12345','icecream', 4.3, 7.2)\n", + "product_2 = Product('E12478','butter', 6.5, 8.1)\n", + "product_3 = Product('C96325','yogurt', 5.6, 7.5)\n", + "\n", + "product_2.get_details()" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "id": "competent-tolerance", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Please enter the product id: Z12345\n", + "Please enter the product name: bread\n", + "Please enter the product purchase price 1\n", + "Please enter the product sale price: 1.5\n" + ] + } + ], + "source": [ + "product_1.set_details()" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "id": "successful-cotton", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Product Id\t\t:\tZ12345\n", + "Product Name\t\t:\tbread\n", + "Product Purchase Price\t:\t€1.0\n", + "Product Sale Price\t:\t€1.5\n", + "Margin\t\t\t:\t€0.5\n", + "Remark\t\t\t:\tProfit\n" + ] + } + ], + "source": [ + "product_1.get_details()" + ] + }, + { + "cell_type": "markdown", + "id": "clinical-responsibility", + "metadata": {}, + "source": [ + "## Question 4:\n", + "Write a `Customer` class and `Items` class. \n", + "Let user enter customer information and add stuff to his/her shopping card.\n", + "\n", + "### Class `Items` :\n", + "**Method :**\n", + "`__init__()`, `__str__()`, `calculate_discount()`, `shopping_cart()`, `get_total_amount()`\n", + "\n", + "**calculate_discount()**\n", + "*\t`total_price` = `price` * `qty`\n", + "*\tdiscount —> `25%` if `total_price >= 4000`\n", + "*\tdiscount —> `15%` if `total_price >= 2000`\n", + "*\tdiscount —> `10%` if `total_price < 2000`\n", + "*\t`price_tobe_paid` = `total_price – discount`\n", + "\n", + "**shopping_cart()**\n", + "* Let user add items in the shopping basket. Be creative with the items, set their prices as well. \n", + "\n", + "**_\\_str\\_\\_()**\n", + "*\tPrint items added and total price nicely.\n", + "\n", + "### Class `Customer` :\n", + "**Methods:** \n", + "`__init__()`, `get_cust_info()` this is optional, `__str__()`\n", + "\n", + "Optionally create a `get_cust_info()` or similar to allow customer to enter his/her information or just define them in `__init__()` and pass customer information as arguments while creating a customer object.\n", + "\n", + "**_\\_str\\_\\_()**\n", + "\n", + "*\tPrint customer information and price nicely.\n", + "\n", + "Find a way to link two classes. For example, instances of both classes may have a customer number. With a get method, get the customer number and pass it to the item object as an argument to set customer number attribute. \n", + "So `Customer` class instance holds the customer info, `Items` class holds the shopped item’s info for the same customer ID number such as price, quantity or so. \n", + "\n", + "In the end, print both info (customer info and shopped items info) using their respective `__str__` format in a nice way. \n", + "\n", + "**Simple example:**\n", + "\n", + "`Customer1 = [name : Jack, last_name : Russel, customer_id : 123]`\n", + "\n", + "`shopping_cart1 = [customer_id : 123, items : [necklace, ring, ear ring], total_price : 2000, discount : 300, price_tobe_paid : 1700]`\n", + "\n", + "Crate a few customers and print their information (Personal and shopping info). \n" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "dominican-watershed", + "metadata": {}, + "outputs": [], + "source": [ + "class Customer(object):\n", + " customer_ids, names, last_names = [], [], []\n", + "\n", + " def __init__(self, customer_id=None, name=None, last_name=None):\n", + " self.customer_id = customer_id\n", + " self.name = name\n", + " self.last_name = last_name\n", + " if self.customer_id is not None:\n", + " Customer.customer_ids.append(self.customer_id)\n", + " Customer.names.append(self.name)\n", + " Customer.last_names.append(self.last_name)\n", + " \n", + " @property\n", + " def get_full_name(self):\n", + " return \"{} {}\".format(self.name,self.last_name)\n", + " \n", + " def __str__(self):\n", + " return f\"\"\"Customer id\\t: {self.customer_id}\n", + "Full Name\\t: {self.name} {self.last_name}\"\"\"\n", + " \n", + " def set_cust_info(self):\n", + " self.customer_id = int(input(\"Please enter your customer id: \"))\n", + " self.name = input(\"Please enter your first name: \")\n", + " self.last_name = input(\"Please enter your last name: \")\n", + " if self.customer_id is not None:\n", + " Customer.customer_ids.append(self.customer_id)\n", + " Customer.names.append(self.name)\n", + " Customer.last_names.append(self.last_name)\n", + "\n", + " @classmethod\n", + " def get_cust_info(cls):\n", + " print(\"\\nAll Customer Informations:\\n--------------------------\")\n", + " for i in range(len(Customer.customer_ids)):\n", + " print(f\"\"\"Customer Id\\t: {Customer.customer_ids[i]} \n", + "Full Name\\t: {Customer.names[i]} {Customer.last_names[i]}\\n\"\"\")\n", + "\n", + "\n", + "class Items(Customer):\n", + " \n", + " customer_ids, items, quantities, unit_prices = [],[],[],[]\n", + " total_prices, discounts, price_tobe_paids = [],[],[]\n", + " \n", + " def get_total_amount(self): \n", + " self.total_price = self.quantity * self.unit_price\n", + " return self.total_price\n", + " \n", + " def calculate_discount(self): \n", + " self.total_price = self.get_total_amount()\n", + " \n", + " if self.total_price >= 4000:\n", + " self.discount = 25\n", + " elif self.total_price >= 2000:\n", + " self.discount = 15\n", + " else:\n", + " self.discount = 10\n", + " \n", + " self.price_tobe_paid = round(self.total_price * (1-self.discount/100),1)\n", + " \n", + " if self.customer_id is not None:\n", + " Items.total_prices.append(self.total_price)\n", + " Items.discounts.append(self.discount)\n", + " Items.price_tobe_paids.append(self.price_tobe_paid)\n", + "\n", + " def __init__(self, customer_id=None, item=None, quantity=None, unit_price=None):\n", + " self.customer_id = customer_id\n", + " self.item = item\n", + " self.quantity = quantity\n", + " self.unit_price = unit_price\n", + " \n", + " if self.customer_id is not None:\n", + " Items.customer_ids.append(self.customer_id)\n", + " Items.items.append(self.item)\n", + " Items.quantities.append(self.quantity)\n", + " Items.unit_prices.append(self.unit_price)\n", + " self.calculate_discount()\n", + " \n", + " def __str__(self):\n", + " return f\"\"\"Customer id\\t: {self.customer_id}\n", + "Item\\t\\t: {self.item}\n", + "Unit Price\\t: €{self.unit_price}\n", + "Quantity\\t: {self.quantity}\n", + "Total price\\t: €{self.total_price}\n", + "Discount\\t: %{self.discount}\n", + "Net Amount Paid\\t: €{self.price_tobe_paid}\"\"\"\n", + " \n", + " def shopping_cart(self):\n", + " self.customer_id = int(input(\"Please enter the customer id: \"))\n", + " self.item = input(\"Please enter the item: \")\n", + " self.quantity = int(input(f\"Please enter the quantity of item: \"))\n", + " self.unit_price = int(input(f\"please enter the unit price of item: \")) \n", + " \n", + " if self.customer_id is not None:\n", + " Items.customer_ids.append(self.customer_id)\n", + " Items.items.append(self.item)\n", + " Items.quantities.append(self.quantity)\n", + " Items.unit_prices.append(self.unit_price)\n", + " self.calculate_discount()" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "functional-frequency", + "metadata": {}, + "outputs": [], + "source": [ + "def merge(ob1, ob2):\n", + " ob1.__dict__.update(ob2.__dict__)\n", + " return ob1\n", + "\n", + "def get_all():\n", + " for i in range(len(Customer.customer_ids)):\n", + " print(f'\\n{i+1}. Customer:\\n-----------------')\n", + " inst = eval(f\"merge( item_{i+1}, customer_{i+1} )\")\n", + " print(f\"\"\"Customer Id\\t: {inst.customer_id}\n", + "Full Name\\t: {inst.name} {inst.last_name}\n", + "Item\\t\\t: {inst.item}\n", + "Quantity\\t: {inst.quantity}\n", + "Unit Price\\t: {inst.unit_price}\n", + "Total Price\\t: €{inst.total_price}\n", + "Discount\\t: %{inst.discount}\n", + "Price Tobe Paid\\t: €{inst.price_tobe_paid}\"\"\") " + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "amino-regression", + "metadata": {}, + "outputs": [], + "source": [ + "# Define item objects\n", + "item_1=Items(11111,'dinner set',1,3500)\n", + "item_2=Items(22222,'necklace',3,2000)\n", + "item_3=Items(33333,'ring',2,1500)" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "another-activity", + "metadata": {}, + "outputs": [], + "source": [ + "# Define customer objects\n", + "customer_1=Customer(11111,'Fatih','Fidan')\n", + "customer_2=Customer(22222,'Ahmet','Altan')\n", + "customer_3=Customer(33333,'Atilla','Tas')" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "martial-campaign", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Fatih Fidan\n" + ] + } + ], + "source": [ + "# Display the full name of any customer\n", + "print(customer_1.get_full_name)" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "duplicate-coordinator", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Customer id\t: 33333\n", + "Full Name\t: Atilla Tas\n" + ] + } + ], + "source": [ + "# Display the info of any customer \n", + "print(str(customer_3))" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "absent-terrace", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "All Customer Informations:\n", + "--------------------------\n", + "Customer Id\t: 11111 \n", + "Full Name\t: Fatih Fidan\n", + "\n", + "Customer Id\t: 22222 \n", + "Full Name\t: Ahmet Altan\n", + "\n", + "Customer Id\t: 33333 \n", + "Full Name\t: Atilla Tas\n", + "\n" + ] + } + ], + "source": [ + "# Display the infos of all customers\n", + "Customer.get_cust_info()" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "unlimited-tamil", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Please enter your customer id: 44444\n", + "Please enter your first name: Bill\n", + "Please enter your last name: Gates\n" + ] + } + ], + "source": [ + "# Define a new customer, enter the infos from keyboard\n", + "customer_4 = Customer()\n", + "customer_4.set_cust_info()" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "divine-coffee", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Customer id\t: 44444\n", + "Full Name\t: Bill Gates\n" + ] + } + ], + "source": [ + "# Display the infos of the last customer \n", + "print(str(customer_4))" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "id": "coated-matrix", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Please enter the customer id: 44444\n", + "Please enter the item: car\n", + "Please enter the quantity of item: 1\n", + "please enter the unit price of item: 5000\n" + ] + } + ], + "source": [ + "# Define a new item, enter the infos from keyboard\n", + "# Be careful, Its customer_id must be same with the corresponding object in Customer class.\n", + "item_4 = Items()\n", + "item_4.shopping_cart()" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "id": "studied-estate", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Customer id\t: 44444\n", + "Item\t\t: car\n", + "Unit Price\t: €5000\n", + "Quantity\t: 1\n", + "Total price\t: €5000\n", + "Discount\t: %25\n", + "Net Amount Paid\t: €3750.0\n" + ] + } + ], + "source": [ + "# Display the infos of the last item.\n", + "print(str(item_4))" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "id": "beneficial-impossible", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "1. Customer:\n", + "-----------------\n", + "Customer Id\t: 11111\n", + "Full Name\t: Fatih Fidan\n", + "Item\t\t: dinner set\n", + "Quantity\t: 1\n", + "Unit Price\t: 3500\n", + "Total Price\t: €3500\n", + "Discount\t: %15\n", + "Price Tobe Paid\t: €2975.0\n", + "\n", + "2. Customer:\n", + "-----------------\n", + "Customer Id\t: 22222\n", + "Full Name\t: Ahmet Altan\n", + "Item\t\t: necklace\n", + "Quantity\t: 3\n", + "Unit Price\t: 2000\n", + "Total Price\t: €6000\n", + "Discount\t: %25\n", + "Price Tobe Paid\t: €4500.0\n", + "\n", + "3. Customer:\n", + "-----------------\n", + "Customer Id\t: 33333\n", + "Full Name\t: Atilla Tas\n", + "Item\t\t: ring\n", + "Quantity\t: 2\n", + "Unit Price\t: 1500\n", + "Total Price\t: €3000\n", + "Discount\t: %15\n", + "Price Tobe Paid\t: €2550.0\n", + "\n", + "4. Customer:\n", + "-----------------\n", + "Customer Id\t: 44444\n", + "Full Name\t: Bill Gates\n", + "Item\t\t: car\n", + "Quantity\t: 1\n", + "Unit Price\t: 5000\n", + "Total Price\t: €5000\n", + "Discount\t: %25\n", + "Price Tobe Paid\t: €3750.0\n" + ] + } + ], + "source": [ + "# Merge and display all infos came from Customer and Items Classes.\n", + "get_all()" + ] + }, + { + "cell_type": "markdown", + "id": "turkish-furniture", + "metadata": {}, + "source": [ + "## Question 5 (Optional):\n", + "\n", + "Could be a long term project as you may have time.\n", + "Create a simple game like TicTacToe or similar (Black Jack, paper-scissor-rock etc.) using Object Oriented Programming methodology.\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fitted-omaha", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.5" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +}