diff --git a/Sorting/BubbleSort.ipynb b/Sorting/BubbleSort.ipynb
index bc631e2..0df6fb0 100644
--- a/Sorting/BubbleSort.ipynb
+++ b/Sorting/BubbleSort.ipynb
@@ -2,55 +2,480 @@
"cells": [
{
"cell_type": "code",
- "execution_count": 15,
+ "execution_count": null,
"metadata": {},
"outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "Enter 1 to create a new account\n",
+ "Enter 2 to access an existing account\n",
+ "Enter 3 to exit\n"
+ ]
+ },
+ {
+ "name": "stdin",
+ "output_type": "stream",
+ "text": [
+ " 3\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "\n",
+ "Enter 1 to create a new account\n",
+ "Enter 2 to access an existing account\n",
+ "Enter 3 to exit\n"
+ ]
+ },
+ {
+ "name": "stdin",
+ "output_type": "stream",
+ "text": [
+ " 2\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "\n",
+ "Enter your name: \n"
+ ]
+ },
+ {
+ "name": "stdin",
+ "output_type": "stream",
+ "text": [
+ " Soumyadip\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Enter your account number: \n"
+ ]
+ },
+ {
+ "name": "stdin",
+ "output_type": "stream",
+ "text": [
+ " 21004\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "Authentication Failed\n",
+ "\n",
+ "\n",
+ "\n",
+ "Enter 1 to create a new account\n",
+ "Enter 2 to access an existing account\n",
+ "Enter 3 to exit\n"
+ ]
+ },
+ {
+ "name": "stdin",
+ "output_type": "stream",
+ "text": [
+ " 2\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "\n",
+ "Enter your name: \n"
+ ]
+ },
+ {
+ "name": "stdin",
+ "output_type": "stream",
+ "text": [
+ " Soumyadip\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Enter your account number: \n"
+ ]
+ },
+ {
+ "name": "stdin",
+ "output_type": "stream",
+ "text": [
+ " 21002\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "Authentication Failed\n",
+ "\n",
+ "\n",
+ "\n",
+ "Enter 1 to create a new account\n",
+ "Enter 2 to access an existing account\n",
+ "Enter 3 to exit\n"
+ ]
+ },
+ {
+ "name": "stdin",
+ "output_type": "stream",
+ "text": [
+ " 1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "\n",
+ "Enter your name: \n"
+ ]
+ },
+ {
+ "name": "stdin",
+ "output_type": "stream",
+ "text": [
+ " Soumya]\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Enter the initial deposit: \n"
+ ]
+ },
{
"name": "stdin",
"output_type": "stream",
"text": [
- "Enter N 5\n",
- " 3\n",
- " 4\n",
- " 1\n",
- " 3\n",
- " 4\n"
+ " 10000\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
- "Sorted array is:\n",
- "1\n",
- "3\n",
- "3\n",
- "4\n",
- "4\n"
+ "\n",
+ "Account creation has been successful. Your account number is 26130\n",
+ "\n",
+ "\n",
+ "\n",
+ "Enter 1 to create a new account\n",
+ "Enter 2 to access an existing account\n",
+ "Enter 3 to exit\n"
+ ]
+ },
+ {
+ "name": "stdin",
+ "output_type": "stream",
+ "text": [
+ " 2\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "\n",
+ "Enter your name: \n"
+ ]
+ },
+ {
+ "name": "stdin",
+ "output_type": "stream",
+ "text": [
+ " Soumya]\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Enter your account number: \n"
+ ]
+ },
+ {
+ "name": "stdin",
+ "output_type": "stream",
+ "text": [
+ " 26130\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "Authentication Successful\n",
+ "\n",
+ "\n",
+ "\n",
+ "Enter 1 to withdraw\n",
+ "Enter 2 to deposit\n",
+ "Enter 3 to display avialable balance\n",
+ "Enter 4 to go back to the previous menu\n"
+ ]
+ },
+ {
+ "name": "stdin",
+ "output_type": "stream",
+ "text": [
+ " 10\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "\n",
+ "Enter 1 to withdraw\n",
+ "Enter 2 to deposit\n",
+ "Enter 3 to display avialable balance\n",
+ "Enter 4 to go back to the previous menu\n"
+ ]
+ },
+ {
+ "name": "stdin",
+ "output_type": "stream",
+ "text": [
+ " 2\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "\n",
+ "Enter an amount to be deposited\n"
+ ]
+ },
+ {
+ "name": "stdin",
+ "output_type": "stream",
+ "text": [
+ " 10\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "Deposit was successful.\n",
+ "Avaialble balance: 10010\n",
+ "\n",
+ "\n",
+ "\n",
+ "Enter 1 to withdraw\n",
+ "Enter 2 to deposit\n",
+ "Enter 3 to display avialable balance\n",
+ "Enter 4 to go back to the previous menu\n"
+ ]
+ },
+ {
+ "name": "stdin",
+ "output_type": "stream",
+ "text": [
+ " 1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "\n",
+ "Enter a withdrawal amount\n"
+ ]
+ },
+ {
+ "name": "stdin",
+ "output_type": "stream",
+ "text": [
+ " 5000\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "Withdrawal was successful.\n",
+ "Avaialble balance: 5010\n",
+ "\n",
+ "\n",
+ "\n",
+ "Enter 1 to withdraw\n",
+ "Enter 2 to deposit\n",
+ "Enter 3 to display avialable balance\n",
+ "Enter 4 to go back to the previous menu\n"
]
}
],
"source": [
- "def bubbleSort(arr):\n",
- " n = len(arr)\n",
+ "from abc import ABCMeta, abstractmethod\n",
+ "from random import randint\n",
+ "\n",
+ "class Account(metaclass = ABCMeta):\n",
+ " @abstractmethod\n",
+ " def createAccount():\n",
+ " return 0\n",
+ " @abstractmethod\n",
+ " def authenticate():\n",
+ " return 0\n",
+ " @abstractmethod\n",
+ " def withdraw():\n",
+ " return 0\n",
+ " @abstractmethod\n",
+ " def deposit():\n",
+ " return 0\n",
+ " @abstractmethod\n",
+ " def displayBalance():\n",
+ " return 0\n",
+ "\n",
"\n",
- " for i in range(n):\n",
- " \n",
- " for j in range(0, n-i-1):\n",
- " if arr[j] > arr[j+1] :\n",
- " arr[j], arr[j+1] = arr[j+1], arr[j]\n",
- " \n",
+ "class SavingsAccount(Account):\n",
+ " def __init__(self):\n",
+ " # [key][0] => name ; [key][1] => balance\n",
+ " self.savingsAccounts = {}\n",
+ " def createAccount(self, name, initialDeposit):\n",
+ " print()\n",
+ " self.accountNumber = randint(10000, 99999)\n",
+ " self.savingsAccounts[self.accountNumber] = [name, initialDeposit]\n",
+ " print (\"Account creation has been successful. Your account number is \", self.accountNumber)\n",
+ " print()\n",
"\n",
- "arr = []\n",
- "n=int(input(\"Enter N\"))\n",
- "for x in range(n):\n",
- " arr.append(int(input()))\n",
+ " def authenticate(self, name, accountNumber):\n",
+ " print()\n",
+ " if accountNumber in self.savingsAccounts.keys():\n",
+ " if self.savingsAccounts[accountNumber][0] == name:\n",
+ " print(\"Authentication Successful\")\n",
+ " self.accountNumber = accountNumber\n",
+ " print()\n",
+ " return True\n",
+ " else:\n",
+ " print(\"Authentication Failed\")\n",
+ " print()\n",
+ " return False\n",
+ " else:\n",
+ " print(\"Authentication Failed\")\n",
+ " print()\n",
+ " return False\n",
+ "\n",
+ " def withdraw(self, withdrawalAmount):\n",
+ " print()\n",
+ " if withdrawalAmount > self.savingsAccounts[self.accountNumber][1]:\n",
+ " print(\"Insufficient balance\")\n",
+ " else:\n",
+ " self.savingsAccounts[self.accountNumber][1] -= withdrawalAmount\n",
+ " print(\"Withdrawal was successful.\")\n",
+ " self.displayBalance()\n",
+ " print()\n",
+ "\n",
+ " def deposit(self, depositAmount):\n",
+ " print()\n",
+ " self.savingsAccounts[self.accountNumber][1] += depositAmount\n",
+ " print(\"Deposit was successful.\")\n",
+ " self.displayBalance()\n",
+ " print()\n",
+ "\n",
+ " def displayBalance(self):\n",
+ " print(\"Avaialble balance: \",self.savingsAccounts[self.accountNumber][1])\n",
+ "\n",
+ "savingsAccount = SavingsAccount()\n",
+ "while True:\n",
+ " print()\n",
+ " print(\"Enter 1 to create a new account\")\n",
+ " print(\"Enter 2 to access an existing account\")\n",
+ " print(\"Enter 3 to exit\")\n",
+ " userChoice = int(input())\n",
+ " print()\n",
+ " if userChoice is 1:\n",
+ " print()\n",
+ " print(\"Enter your name: \")\n",
+ " name = input()\n",
+ " print(\"Enter the initial deposit: \")\n",
+ " deposit = int(input())\n",
+ " savingsAccount.createAccount(name, deposit)\n",
+ " print()\n",
+ " elif userChoice is 2:\n",
+ " print()\n",
+ " print(\"Enter your name: \")\n",
+ " name = input()\n",
+ " print(\"Enter your account number: \")\n",
+ " accountNumber = int(input())\n",
+ " authenticationStatus = savingsAccount.authenticate(name, accountNumber)\n",
+ " print()\n",
+ " if authenticationStatus is True:\n",
+ " while True:\n",
+ " print()\n",
+ " print(\"Enter 1 to withdraw\")\n",
+ " print(\"Enter 2 to deposit\")\n",
+ " print(\"Enter 3 to display avialable balance\")\n",
+ " print(\"Enter 4 to go back to the previous menu\")\n",
+ " userChoice = int(input())\n",
+ " print()\n",
+ " if userChoice is 1:\n",
+ " print()\n",
+ " print(\"Enter a withdrawal amount\")\n",
+ " withdrawalAmount = int(input())\n",
+ " savingsAccount.withdraw(withdrawalAmount)\n",
+ " print()\n",
+ " elif userChoice is 2:\n",
+ " print()\n",
+ " print(\"Enter an amount to be deposited\")\n",
+ " depositAmount = int(input())\n",
+ " savingsAccount.deposit(depositAmount)\n",
+ " print()\n",
+ " elif userChoice is 3:\n",
+ " print()\n",
+ " savingsAccount.displayBalance()\n",
+ " print()\n",
+ " elif userChoice is 4:\n",
+ " break\n",
+ " elif userChoice is 3:\n",
+ " quit()\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": []
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
"\n",
- "bubbleSort(arr)\n",
- " \n",
- "print (\"Sorted array is:\")\n",
- "for i in range(len(arr)):\n",
- " print (arr[i]),"
+ "E"
]
}
],
diff --git a/svg/Model!DataFlowModel1!DFDDiagram1_1.svg b/svg/Model!DataFlowModel1!DFDDiagram1_1.svg
new file mode 100644
index 0000000..8e8f26a
--- /dev/null
+++ b/svg/Model!DataFlowModel1!DFDDiagram1_1.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/svg/Model!Main_0.svg b/svg/Model!Main_0.svg
new file mode 100644
index 0000000..b7a360e
--- /dev/null
+++ b/svg/Model!Main_0.svg
@@ -0,0 +1 @@
+
\ No newline at end of file