summaryrefslogtreecommitdiff
path: root/comp/work/6
diff options
context:
space:
mode:
authorstandenboy <standenboy@seacrossedlovers.xyz>2023-12-15 10:19:20 +0000
committerstandenboy <standenboy@seacrossedlovers.xyz>2023-12-15 10:19:20 +0000
commit4a95719d58a708ad55b1389631d6339047f786a0 (patch)
tree26cb6fc2dbe7fa75f57f1d6fb13aff8955772b56 /comp/work/6
added existing work
Diffstat (limited to 'comp/work/6')
-rwxr-xr-xcomp/work/6/5timesTable.py8
-rwxr-xr-xcomp/work/6/cake.py8
-rwxr-xr-xcomp/work/6/iceCream.py29
3 files changed, 45 insertions, 0 deletions
diff --git a/comp/work/6/5timesTable.py b/comp/work/6/5timesTable.py
new file mode 100755
index 0000000..e7be413
--- /dev/null
+++ b/comp/work/6/5timesTable.py
@@ -0,0 +1,8 @@
+num = int(input("number: "))
+
+if num < 0:
+ exit(1)
+
+for i in range(num+1):
+ if (i % 5) == 0:
+ print(i)
diff --git a/comp/work/6/cake.py b/comp/work/6/cake.py
new file mode 100755
index 0000000..23f4e44
--- /dev/null
+++ b/comp/work/6/cake.py
@@ -0,0 +1,8 @@
+while True:
+ eggs = int(input("how many eggs are there: "))
+ if eggs < 8:
+ break
+flour = eggs * 100
+sugar = eggs * 50
+
+print("you will need", flour, "grams and", sugar, "grams")
diff --git a/comp/work/6/iceCream.py b/comp/work/6/iceCream.py
new file mode 100755
index 0000000..10db61c
--- /dev/null
+++ b/comp/work/6/iceCream.py
@@ -0,0 +1,29 @@
+while True:
+ week = input("is it a week day: (yes/no) ").lower()
+ if week == "yes":
+ break
+ elif week == "no":
+ break
+
+while True:
+ temp = int(input("what is the temprature: "))
+ if temp >= 20:
+ if temp <= 45:
+ break
+sold = 0
+if week == "no":
+ if 20 <= temp <= 30:
+ sold = 200
+ elif 31 <= temp <= 38:
+ sold = 300
+ else:
+ sold = 240
+elif week == "yes":
+ if 20 <= temp <= 30:
+ sold = 200/2
+ elif 31 <= temp <= 38:
+ sold = 300/2
+ else:
+ sold = 240/2
+print(sold, "ice creams will be sold")
+