Compare commits
No commits in common. "1c7f6684dc0e6b13d1e7b2bacdf8ad9bfccb6a99" and "c580ecc6e4fd263d1bf08b645a21a6c1ac870893" have entirely different histories.
1c7f6684dc
...
c580ecc6e4
@ -1,33 +0,0 @@
|
|||||||
# Programm, welches das Sortierverfahren Bubble-Sort mit hilfe eines Aarays durchführt.
|
|
||||||
|
|
||||||
array=[] # Leeren Array erstellen
|
|
||||||
# Nutzer fragen, wie lang der Array sein soll
|
|
||||||
arraylenght=int(input("Wie lang soll die Zahlenliste sein? "))
|
|
||||||
|
|
||||||
# Zahlen dem Array hinzufügen
|
|
||||||
for i in range(arraylenght):
|
|
||||||
neue_nummer=float(input("Bitte Nummer eingeben: "))
|
|
||||||
array.append(neue_nummer)
|
|
||||||
# Verarbeitung
|
|
||||||
|
|
||||||
'''
|
|
||||||
# 1. Version
|
|
||||||
if array[0]>array[1]: #Tausch, falls vordere Zahl größer
|
|
||||||
h=array[0] #Ringtausch
|
|
||||||
array[0]=array[1]
|
|
||||||
array[1]=h
|
|
||||||
'''
|
|
||||||
|
|
||||||
# 2. Version
|
|
||||||
for j in range(len(array)-1):
|
|
||||||
for i in range(len(array)-1):
|
|
||||||
if array[i]>array[i+1]: #Tausch, falls vordere Zahl größer
|
|
||||||
h=array[i] #Ringtausch
|
|
||||||
array[i]=array[i+1]
|
|
||||||
array[i+1]=h
|
|
||||||
|
|
||||||
|
|
||||||
# Ausgabe
|
|
||||||
print("Folgende Reihenfolge ergibt sich für %s Zahlen:" %(len(array)))
|
|
||||||
for i in range(len(array)):
|
|
||||||
print (array[i])
|
|
@ -22,7 +22,6 @@ def admin_mode():
|
|||||||
print("1. Add Product")
|
print("1. Add Product")
|
||||||
print("2. Change Price")
|
print("2. Change Price")
|
||||||
print("3. Delete Product")
|
print("3. Delete Product")
|
||||||
print("4. Quit Admin Mode")
|
|
||||||
# Ask for the user input
|
# Ask for the user input
|
||||||
admin_input=input("Please choose an option: ")
|
admin_input=input("Please choose an option: ")
|
||||||
# Check if the input is a number
|
# Check if the input is a number
|
||||||
@ -121,7 +120,7 @@ def normal_mode():
|
|||||||
product_price=c.execute("SELECT price FROM products WHERE id=?", (int(product_id),)).fetchone()[0]
|
product_price=c.execute("SELECT price FROM products WHERE id=?", (int(product_id),)).fetchone()[0]
|
||||||
# Ask the amount of the product
|
# Ask the amount of the product
|
||||||
product_amount=int(input("Bitte Anzahl des Produktes Eingeben: "))
|
product_amount=int(input("Bitte Anzahl des Produktes Eingeben: "))
|
||||||
sum_of_price=round(product_price*product_amount,2)
|
sum_of_price=product_price*product_amount
|
||||||
# Print the price of the sum
|
# Print the price of the sum
|
||||||
print("Summe:%s€" % sum_of_price)
|
print("Summe:%s€" % sum_of_price)
|
||||||
# Ask if the user wants to continue
|
# Ask if the user wants to continue
|
||||||
@ -137,7 +136,7 @@ def payment(sum_of_price):
|
|||||||
money_in_machine=input("Bitte Geld eingeben: ")
|
money_in_machine=input("Bitte Geld eingeben: ")
|
||||||
# Check if the money is a number
|
# Check if the money is a number
|
||||||
try:
|
try:
|
||||||
money_in_machine=float(money_in_machine)
|
money_in_machine=int(money_in_machine)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
print("Bitte geben Sie eine Nummer ein")
|
print("Bitte geben Sie eine Nummer ein")
|
||||||
return
|
return
|
||||||
@ -152,59 +151,45 @@ def payment(sum_of_price):
|
|||||||
rest_cent=rest_euro*100
|
rest_cent=rest_euro*100
|
||||||
|
|
||||||
# 10 Euro
|
# 10 Euro
|
||||||
rest_euro_10=rest_cent//1000
|
rest_euro_10=rest_cent//10000
|
||||||
rest_cent=rest_cent-rest_euro_10*10000
|
rest_cent=rest_cent-rest_euro_10*10000
|
||||||
|
|
||||||
# 5 Euro
|
# 5 Euro
|
||||||
rest_euro_5=rest_cent//500
|
rest_euro_5=rest_cent//5000
|
||||||
rest_cent=rest_cent-rest_euro_5*5000
|
rest_cent=rest_cent-rest_euro_5*5000
|
||||||
|
|
||||||
# 2 Euro
|
# 2 Euro
|
||||||
rest_euro_2=rest_cent//200
|
rest_euro_2=rest_cent//2000
|
||||||
rest_cent=rest_cent-rest_euro_2*2000
|
rest_cent=rest_cent-rest_euro_2*2000
|
||||||
|
|
||||||
# 1 Euro
|
# 1 Euro
|
||||||
rest_euro_1=rest_cent//100
|
rest_euro_1=rest_cent//1000
|
||||||
rest_cent=rest_cent-rest_euro_1*1000
|
rest_cent=rest_cent-rest_euro_1*1000
|
||||||
|
|
||||||
# 50 Cent
|
# 50 Cent
|
||||||
rest_cent_50=rest_cent//50
|
rest_cent_50=rest_cent//500
|
||||||
rest_cent=rest_cent-rest_cent_50*500
|
rest_cent=rest_cent-rest_cent_50*500
|
||||||
|
|
||||||
# 20 Cent
|
# 20 Cent
|
||||||
rest_cent_20=rest_cent//20
|
rest_cent_20=rest_cent//200
|
||||||
rest_cent=rest_cent-rest_cent_20*200
|
rest_cent=rest_cent-rest_cent_20*200
|
||||||
|
|
||||||
# 10 Cent
|
# 10 Cent
|
||||||
rest_cent_10=rest_cent//10
|
rest_cent_10=rest_cent//100
|
||||||
rest_cent=rest_cent-rest_cent_10*100
|
rest_cent=rest_cent-rest_cent_10*100
|
||||||
|
|
||||||
# 5 Cent
|
# 5 Cent
|
||||||
rest_cent_5=rest_cent//5
|
rest_cent_5=rest_cent//50
|
||||||
rest_cent=rest_cent-rest_cent_5*50
|
rest_cent=rest_cent-rest_cent_5*50
|
||||||
|
|
||||||
# 1 Cent
|
print ("10 Euro: %s" % rest_euro_10)
|
||||||
rest_cent_1=rest_cent//1
|
print ("5 Euro: %s" % rest_euro_5)
|
||||||
rest_cent=rest_cent-rest_cent_1*1
|
print ("2 Euro: %s" % rest_euro_2)
|
||||||
|
print ("1 Euro: %s" % rest_euro_1)
|
||||||
if rest_euro_10 >=1:
|
print ("50 Cent: %s" % rest_cent_50)
|
||||||
print ("Sie bekommen %smal 10€" % rest_euro_10)
|
print ("20 Cent: %s" % rest_cent_20)
|
||||||
if rest_euro_5 >=1:
|
print ("10 Cent: %s" % rest_cent_10)
|
||||||
print ("Sie bekommen %smal 5€" % rest_euro_5)
|
print ("5 Cent: %s" % rest_cent_5)
|
||||||
if rest_euro_2 >=1:
|
|
||||||
print ("Sie bekommen %smal 2€" % rest_euro_2)
|
|
||||||
if rest_euro_1 >=1:
|
|
||||||
print ("Sie bekommen %smal 1€" % rest_euro_1)
|
|
||||||
if rest_cent_50 >=1:
|
|
||||||
print ("Sie bekommen %smal 50 Cent:" % rest_cent_50)
|
|
||||||
if rest_cent_20 >=1:
|
|
||||||
print ("Sie bekommen %smal 20 Cent:" % rest_cent_20)
|
|
||||||
if rest_cent_10 >=1:
|
|
||||||
print ("Sie bekommen %smal 10 Cent:" % rest_cent_10)
|
|
||||||
if rest_cent_5 >=1:
|
|
||||||
print ("Sie bekommen %smal 5 Cent:" % rest_cent_5)
|
|
||||||
if rest_cent_1 >=1:
|
|
||||||
print("Sie bekommen %smal 1 Cent" % rest_cent_1)
|
|
||||||
|
|
||||||
normal_mode()
|
normal_mode()
|
||||||
|
|
||||||
|
Binary file not shown.
@ -1,31 +0,0 @@
|
|||||||
# Make a programm which asks the user for an input and then sorts the input of the user
|
|
||||||
|
|
||||||
# First ask the user how long he want the Array to be
|
|
||||||
array_length=int(input("Wie viele Zahlen sollen sortiert werden"))
|
|
||||||
# Second make an array
|
|
||||||
array=[]
|
|
||||||
# Third ask the user for number input
|
|
||||||
for i in range(array_length):
|
|
||||||
number=float(input("Bitte mir einfach eine Zahl geben"))
|
|
||||||
# Now append that number to the array
|
|
||||||
array.append(number)
|
|
||||||
# Now sort the numbers with the help of insertion sort
|
|
||||||
def insertionSort(array):
|
|
||||||
|
|
||||||
# Traverse through 1 to len(arr)
|
|
||||||
for i in range(1, len(array)):
|
|
||||||
|
|
||||||
key = array[i]
|
|
||||||
|
|
||||||
# Move elements of arr[0..i-1], that are
|
|
||||||
# greater than key, to one position ahead
|
|
||||||
# of their current position
|
|
||||||
j = i-1
|
|
||||||
while j >=0 and key < array[j] :
|
|
||||||
array[j+1] = array[j]
|
|
||||||
j -= 1
|
|
||||||
array[j+1] = key
|
|
||||||
insertionSort(array)
|
|
||||||
# print finished array
|
|
||||||
for i in range(len(array)):
|
|
||||||
print(array[i])
|
|
@ -1,23 +0,0 @@
|
|||||||
# Make a programm which asks the user for an input and then sorts the input of the user
|
|
||||||
|
|
||||||
# First ask the user how long he want the Array to be
|
|
||||||
array_length=int(input("Wie viele Zahlen sollen sortiert werden"))
|
|
||||||
# Second make an array
|
|
||||||
array=[]
|
|
||||||
# Third ask the user for number input
|
|
||||||
for i in range(array_length):
|
|
||||||
number=float(input("Bitte mir einfach eine Zahl geben"))
|
|
||||||
# Now append that number to the array
|
|
||||||
array.append(number)
|
|
||||||
|
|
||||||
# Now sort them with the Help of the selection sort algorithm
|
|
||||||
for i in range(len(array)):
|
|
||||||
min_= i
|
|
||||||
for j in range(i+1, len(array)):
|
|
||||||
if array[min_] > array[j]:
|
|
||||||
min_ = j
|
|
||||||
#swap
|
|
||||||
array[i], array[min_] = array[min_], array[i]
|
|
||||||
# main
|
|
||||||
for i in range(len(array)):
|
|
||||||
print(array[i])
|
|
@ -1 +0,0 @@
|
|||||||
<mxfile host="app.diagrams.net" modified="2022-05-05T12:35:58.899Z" agent="5.0 (Windows)" etag="9hpcv2ziGHfhq2m_BAw5" version="18.0.0" type="device"><diagram id="oKeNR1mCrY6Sv_lApMwD" name="Page-1">7VhNc9owEP01nmkPyVg2NnAMDm0O6bQdpmmTm7A3tlphUSGHj1/flSVjO4SEzjTgzPRipCftaiW99zA4fjRbfZR0nn0SCXDHc5OV4186ntcnAT41sLZA3zdAKlliIFIDE7YBC7oWLVgCi9ZEJQRXbN4GY5HnEKsWRqUUy/a0e8Hbq85pCjvAJKZ8F/3OEpUZdOD1a/wKWJpVK5NwaEZmtJpsd7LIaCKWDcgfO34khVCmNVtFwPXZVedi4j7sGd0WJiFXhwTc3PCrO5583oyKr9++FHwDw8mZ3cYD5YXdsOOFHPONEvaAzVQ3b0CmHFic4czNki3iDHJ9peUT5EKVjSkwg9zRjOuGyYMFNVI9kT2huY4yK+BVey6ud08zWSZbMsDnqJhOuW5MhFRVjql8nPXxWuWxq3V1l5Dg1dou5slEKnLKxzU6kqLIE9AH5mKvnnMtxBxBguBPUGpteUoLJRDK1IzbUVgx9UOHnwe2d2uT6fblqtlZV51cyXUjSHdvq3y6U4eVvSrO7E9vai8jLLQQhYzhGRpUyqIyBfXMvHDLW9Q7iBlgPRgngVPFHtp1UKu8dDuvJic2LD//gqtkh6sXUtK1E4wCHweiofaaaOgipyPfxdlRr0+c4HKHB+1bXmZMwWROywNaoom1b9QuClLB6vlz3j0XG9AjPRNiPTDoW0tY1o5CgtBgWcNNQveVjnJ4iOxzJ/Kdi16cocC1LMccZnrHum6Z4EdeaIXS0gtKmUpUsGJpKVSFZcDBJsCMoUgrcaaPW0PXDBfXLGd5Cve6oFGUqvP/FvDPLSA80AIGp7SAcK8FVPe/mJd8rK88/F2Ikio0/pWWl3sWCy6k41/ostPpOxLgKwnW43pBsG28N5yywRWfGkazpZtZseLbW/CfXu/U/kPIzqEcU5lNXW5V+oIySVOXDZm+vjIHByqTuE+z4DjSHHRCmnt1eYwSjPTNa8ieQjrtC753cl/wu/ONTQ7zhUff2O7xfKH6ifyyMXgnfW13T+wMRnNvwx864gye63bNGbxOsOik/DnuKk8ws2Mq0kLZU0jH9POab9zYrf9ELMca/8T64z8=</diagram></mxfile>
|
|
Binary file not shown.
Before Width: | Height: | Size: 15 KiB |
@ -1 +0,0 @@
|
|||||||
<mxfile host="app.diagrams.net" modified="2022-05-12T12:23:06.951Z" agent="5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36 Edg/101.0.1210.39" etag="UWRpgpNDgZNYL8Qyb3L_" version="17.2.1" type="device"><diagram id="FDAoAFaqsUSTd0yCK2Pk" name="Page-1">7Vvfk5sqFP5rfOyOgMbkceNu24feuZ3u3N7bvmTYSIx3VDJINsn+9YWAUaOm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uqI3xh1TE5Sh9ineCAYN4xRZt3t5RKEOm1j90GPsdw2GJoIRT2ZuDOlFHoSZWAmU2U+RFbsW8ZHDGg8IkcdftR6LEBjWBgaoZvFAhq3sHAnrJTIpSvE1xIXMtO2ISwiuXh4XBc4y0gek4UTImcaxm/EfaGegKeWZ/Pg5ML8F+jL0sz2eRorMjSedUQ3ukCiM+f0g6FE17MMzuT025t4dTqmnL4lJ2PH2x7zWLjIzL05rz++CDCgNhh+V6/v/8zre3AUXJrXbwd1muuAvgtgAdd5vm1cB18LFXZHDsZuTQ3NFkCjFxDKYR6DaabuGIgo2o6boMcneBbgqWfzMSvEIhea2W9AYKhPi+UhaGjVPSV4lIJBow6NTs4ajRm9qHRpR6TuRfALah8RVBcpSnxYgAbgNtFg/ooAMnvz/CloAObQMPRvGIbR0P9HDKt8g4/OhwZRrP4fpfYI1b/M0O0P</diagram></mxfile>
|
|
Binary file not shown.
Before Width: | Height: | Size: 30 KiB |
@ -1 +0,0 @@
|
|||||||
<mxfile host="app.diagrams.net" modified="2022-05-05T12:25:59.185Z" agent="5.0 (Windows)" etag="zLYe7e7hk7v4KPXEtLL9" version="18.0.0" type="device"><diagram id="_qOt0WykFTrCSzvU5MhP" name="Page-1">7VlNc5swEP01zLSHdCwwNj7GOGkPTtsZT6fNUQYZ1AByhIjt/PquQOIj/iJNXDxNcvBoV1qt2H3vIceG5cbrzxwvwxvmk8gwe/7asCaGaQ6RDZ/SsVGOoVU4Ak79woUqx4w+EuXsKW9GfZI2FgrGIkGXTafHkoR4ouHDnLNVc9mCRc2sSxyQLcfMw9G29yf1RVh4HXNY+b8QGoQ6MxqMipkY68XqSdIQ+2xVc1lXhuVyxkQxitcuiWTtdF2KuOs9s+XBOElEmwBnzMffvy2/ZnT1o7+mk+n03rpQzXjAUaYe2DAHEew39ukDDAM5TDMvJLDqhiY0zmIYZYkvowgXOEuLSR035zpMe+BItc127A/9hXpRIWFCILxHeCpIAoOZgGcg+zbKqyo2ulXEh84pk3ERsoAlOLqqvGPO4OBE1qMHVrVmytgSnAicv4kQGwVDnAkGrlDEkZolayp+yfBPtrJu1WZyPFnXjY02EsE3tSBp3ur9pFGF5ZaOK55PPtTehitXyjLukQNd1sTBPCDiwDqzhCXQmbCYwHkgjpMIC/rQPAdWxArKdRX2YKDg9wwooi0oXnKON4Y9dgBc7lB+AFxdlH84hj3ZQkCzv6uQCjJb4rw0K1CnZi9VOsAwWR+u8HZFVIBlK24rcbMGyl5VUoE0/8OaTOh1r15E+zl89nFasDrOSuplSQq8oLIqkoBTCkx8GbsLrVgY0LyxG+R5KUlzzhcpVcJGvpAmj1n7pO9K0FIJzJZK0O9SCcy9SqD7ny5x0mj54D5jOVSwdxfkzb3wWMS4YV3KYwfzD8iWugGGadvl4GOBKRWs8VQs/OtM9QRHMuWilstbXdVKjBfJm9DfSYbmwjNTRdPqWhWHnSpEXR9KtTiiEKiuDzW5OL1C9FsqxKBLheifgUJIxu4hoFvdWF7hohLhOYnG5bHd4tSwjXWd/52GtQh1zdrR+bzXUTvWPnmv946wdsESUevmaNTo5quwedCSzU6XbB7svbSe9u3bjWZISdgrHPpCcOAacBopeQK+F0kJGp6blCC0Vbd3LXmuljgttQT1dqPj34iJ8/bEJFeNA1eR/0pMuv82odXszUEsv9buBlJ3EFvQKKr5F45HPE8WR3B2R2ozc8fu273TgPKU//gDs/qRIJ+r/dJiXf0B</diagram></mxfile>
|
|
Binary file not shown.
Before Width: | Height: | Size: 14 KiB |
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user