Skip to content

Commit 898df9d

Browse files
Add files via upload
1 parent 43e6182 commit 898df9d

12 files changed

+145
-0
lines changed

9. Exam/01. Christmas Preparation.py

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
wrapping_paper = int(input())
2+
fabric = int(input())
3+
glue = float(input())
4+
discount = int(input())
5+
6+
total_sum = wrapping_paper * 5.8 + fabric * 7.2 + glue * 1.2
7+
total_sum -= total_sum * discount / 100
8+
9+
print(f"{total_sum:.3f}")

9. Exam/02. Bracelet Stand.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
pocket_money = float(input())
2+
profit_for_day = float(input())
3+
expenses = float(input())
4+
gift_price = float(input())
5+
6+
money_earned = (pocket_money * 5) + (profit_for_day * 5)
7+
total_money = money_earned - expenses
8+
9+
if total_money > gift_price:
10+
print(f"Profit: {total_money:.2f} BGN, the gift has been purchased.")
11+
else:
12+
diff = gift_price - total_money
13+
print(f"Insufficient money: {diff:.2f} BGN.")

9. Exam/03. Santas Holiday.py

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
days = int(input())
2+
room_type = input()
3+
review = input()
4+
5+
price_for_night = 0
6+
7+
if days < 10:
8+
if room_type == "room for one person":
9+
price_for_night = 18
10+
elif room_type == "apartment":
11+
price_for_night = 25 * 0.70
12+
else:
13+
price_for_night = 35 * 0.90
14+
15+
elif 10 <= days <= 15:
16+
if room_type == "room for one person":
17+
price_for_night = 18
18+
elif room_type == "apartment":
19+
price_for_night = 25 * 0.65
20+
else:
21+
price_for_night = 35 * 0.85
22+
23+
else:
24+
if room_type == "room for one person":
25+
price_for_night = 18
26+
elif room_type == "apartment":
27+
price_for_night = 25 * 0.50
28+
else:
29+
price_for_night = 35 * 0.80
30+
31+
total_price = (days - 1) * price_for_night
32+
33+
if review == "positive":
34+
total_price *= 1.25
35+
else:
36+
total_price *= 0.90
37+
38+
print(f'{total_price:.2f}')

9. Exam/04. Workout.py

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from math import ceil
2+
3+
workout_days = int(input())
4+
km_for_day = float(input())
5+
6+
total_km = km_for_day
7+
8+
for day in range(workout_days):
9+
speed_km = int(input())
10+
km_for_day *= ((speed_km / 100) + 1)
11+
total_km += km_for_day
12+
13+
diff = abs(1000 - total_km)
14+
15+
if total_km > 1000:
16+
print(f"You've done a great job running {ceil(diff)} more kilometers!")
17+
else:
18+
print(f"Sorry Mrs. Ivanova, you need to run {ceil(diff)} more kilometers")

9. Exam/05. Hair Salon.py

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
day_goal = int(input())
2+
3+
goal_complete = False
4+
money = 0
5+
6+
while not goal_complete:
7+
command = input()
8+
if command == "closed":
9+
break
10+
11+
elif command == "haircut":
12+
command_2 = input()
13+
if command_2 == "mens":
14+
money += 15
15+
if money >= day_goal:
16+
goal_complete = True
17+
break
18+
19+
elif command_2 == "ladies":
20+
money += 20
21+
if money >= day_goal:
22+
goal_complete = True
23+
break
24+
25+
elif command_2 == "kids":
26+
money += 10
27+
if money >= day_goal:
28+
goal_complete = True
29+
break
30+
31+
elif command == "color":
32+
command_3 = input()
33+
if command_3 == "touch up":
34+
money += 20
35+
if money >= day_goal:
36+
goal_complete = True
37+
break
38+
39+
elif command_3 == "full color":
40+
money += 30
41+
if money >= day_goal:
42+
goal_complete = True
43+
break
44+
45+
diff = day_goal - money
46+
47+
if goal_complete:
48+
print("You have reached your target for the day!")
49+
print(f"Earned money: {money}lv.")
50+
51+
else:
52+
print(f"Target not reached! You need {diff}lv. more.")
53+
print(f"Earned money: {money}lv.")
54+

9. Exam/06. Unique PIN Codes.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
n1 = int(input())
2+
n2 = int(input())
3+
n3 = int(input())
4+
5+
for a in range(1, n1 + 1):
6+
if a % 2 != 0:
7+
continue
8+
for b in range(1, n2 + 1):
9+
if b not in (2, 3, 5, 7):
10+
continue
11+
for c in range(1, n3 + 1):
12+
if c % 2 == 0:
13+
print(f"{a} {b} {c}")
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)