High-Rigour Synthesis

Section B Mastery Bank

Deconstructing complex algorithms. Master nested flows, data persistence, and professional problem-solving.

1

Ticket Sales System (6 Marks)

A theater has 500 tickets. Write a program that:
1. Continually asks the user for the number of tickets wanted.
2. If enough tickets remain, print "Booked" and deduct from the total.
3. Else print "Not enough".
4. Stop and print "Sold out" when capacity reaches 0.

2

Voting System (6 Marks)

Continually ask for a vote ("A", "B", or "C"). Stop if user types "END". Print totals at the end.

3

Attendance Register (6 Marks)

Loop through the student list. For each, ask "Present?" (y/n). Count and print total present.

4

Memory Slot (6 Marks)

Ask for a slot number (0-4). If slots[num] is "", set to "B". Else print "Already taken".

5

Charging Time (6 Marks)

Charges 1% every 10 mins. Ask current %. Calc hours and mins to reach 100%.

6

Best Wage (6 Marks)

Compare: Piecework (2.00/bear) vs Hourly (5.00/hour). Print the higher wage.

7

Coffee Order (6 Marks)

M: 3.00, L: 3.50. Add 0.50 if extra is "Shot". Print final price.

8

High Score (7 Marks)

Find the highest score in the list manually. No max() allowed.

9

Log File (6 Marks)

Open "log.txt", write "Log Entry", and close it.

10

Parse Domain (5 Marks)

Extract the domain (everything after '@') from the email string.

11

Nested Star Grid (7 Marks)

Print a 3x3 grid of stars (*). Use nested loops.

12

Time Logic (6 Marks)

Convert 125 seconds into minutes and seconds (e.g., "2m 5s").

13

Manual Swap (2 Marks)

If nums[0] > nums[1], swap them. Print the list.

14

2D List Sum (4 Marks)

Calculate the total sum of all numbers in the 2D matrix.

15

Dictionary Key (1 Mark)

Print the value associated with the key "Name".

16

Dictionary Add (1 Mark)

Add a new key "Score" with value 100 to the dictionary.

17

Vowel Counter (2 Marks)

Count occurrences of 'a', 'e', 'i', 'o', 'u' in the string.

18

Palindrome (2 Marks)

Check if word is the same forwards and backwards. Use slicing [::-1].

19

File Parsing (2 Marks)

Loop through the simulated list of file lines and print each.

20

Logic Menu (3 Marks)

If choice is "1", print "Play". If choice is "2", print "Exit".

21

Email Gatekeeper (2 Marks)

Check if email string contains both "@" and ".". Print "Valid".

22

CSV Shredder (1 Mark)

Split the string "A,B,C" by comma into a list. Print the list.

23

State Swapper (1 Mark)

If state is "Red", set state to "Green". Print the new state.

24

Roshambo Logic (3 Marks)

If p1 is "Rock" and p2 is "Scissors", print "Win".

Exam Mastered!

You have successfully deconstructed the most rigorous challenges in the bank. You are ready for Section B.

Back to Hub