PLS hints shown in yellow. In the real exam, you must find this in the PLS yourself!
A pizza restaurant calculates order totals. The base prices depend on pizza size.
Prices:
| Size | Code | Price |
|---|---|---|
| Small | S | Β£6.99 |
| Medium | M | Β£9.99 |
| Large | L | Β£12.99 |
Additional rules:
Requirements:
| Size | Toppings | Qty | Delivery | Output |
|---|---|---|---|---|
| M | 2 | 1 | N | Β£12.99 |
| L | 1 | 3 | Y | Β£41.62 |
| S | 0 | 2 | N | Β£13.98 |
A program draws a traffic light with three filled circles (red, amber, green from top to bottom). The program has errors.
Fix these errors:
begin_fil)penup() doesA program converts temperatures between Celsius and Fahrenheit.
Formulas:
F = (C Γ 9/5) + 32C = (F - 32) Γ 5/9Requirements:
| Temp | Direction | Output |
|---|---|---|
| 100 | C | 212.0Β°F |
| 32 | F | 0.0Β°C |
| -300 | C | Invalid temperature |
| -500 | F | Invalid temperature |
A dice game rolls two dice. The score depends on the result:
The game plays 3 rounds and totals the score.
| Round | Dice 1 | Dice 2 | Round Score |
|---|---|---|---|
| 1 | 6 | 6 | 25 |
| 2 | 3 | 3 | 12 |
| 3 | 4 | 2 | 6 |
| Total | 43 | ||
Rearrange the lines. DO NOT change indentation!
A company stores employee data in a file. Each line contains: Name, Hours Worked, Hourly Rate (separated by commas).
Requirements:
calculatePay(hours, rate) that:
Expected calculations:
| Name | Hours | Rate | Pay |
|---|---|---|---|
| Jones | 40 | 15.50 | Β£620.00 |
| Smith | 45 | 12.00 | Β£570.00 |
Smith: 40Γ12 + 5Γ(12Γ1.5) = 480 + 90 = Β£570
A hotel stores room information in a 2D array. Each record contains: Room Number, Type, Price per Night, Available (True/False).
The array is sorted by Room Number.
Write a program to:
| Room | Type | Price | Available |
|---|---|---|---|
| 101 | Single | Β£75 | True |
| 102 | Double | Β£120 | False |
| 201 | Double | Β£120 | True |
| 202 | Suite | Β£250 | True |
β Common Errors
qty > 3instead ofqty >= 3