IGCSE Computer Science – Practice Questions
Q1: Input 30 student marks → Pass/Fail/Merit → Count Passes and fails.
Q2. Keep asking for a password until valid (≥8 chars, no spaces).
Q3. Shop with menu → Add costs → Stop at 0.
Q4. 5 temps → highest, lowest, count below 0.
Q5. A program repeatedly asks for a student’s mark (0–100).
• If the mark is below 50, output "Fail".
• If the mark is between 50 and 69, output "Pass".
• If the mark is 70 or above, output "Distinction".
• Keep a count of how many marks fall in each category.
• After each input, ask "Do you want to enter another mark? (Y/N)".
• Stop if the user enters N or n.
At the end, output the counts for Fail, Pass, and Distinction.
Q6. Write pseudocode for a simple ATM program that starts with a balance of 1000.
• The user is shown a menu: Deposit money
Withdraw money
Check balance
• Use a CASE statement to process the choice.
• For withdrawal, ensure the balance never goes below 0 (output "Insufficient
funds" if needed).
• After each transaction, ask "Do you want another transaction? (Y/N)".
• Stop if the user enters N or n.
Q7. A program repeatedly asks the user for a password.
• The correct password is "CS123".
• The user has at most 3 attempts to enter it correctly.
• If correct, output "Access Granted".
• If wrong after 3 attempts, output "Account Locked".
• After each attempt, if the user wants, they can stop early by entering Y or y.
Q8. Write pseudocode for a small shopping cart program:
• The user can enter items with prices.
• If the price is greater than 500, give a 10% discount.
• Keep a running total of all items.
• After each item, ask "Do you want to add another item? (Y/N)".
• Stop if the user enters N or n.
At the end, output the total bill.
Q9. Write pseudo code to repeatedly input numbers until the user chooses to stop.
For each number:
• If it is negative, add it to NegativeSum.
• If it is positive, add it to PositiveSum.
• If it is 0, ignore it.
• After each number, ask "Do you want to continue? (Y/N)".
• At the end, output:
The total of negative numbers
The total of positive numbers
The overall total of all numbers
Q10. A bookstore sells the following five items:
• Novel – 1200
• Notebook – 150
• Pen – 50
• Pencil – 20
• Diary – 500
Task:
Write a program that starts by entering each item.
You can enter as many items as you need.
Type "end" when you’re finished.
The program will sum up the prices of all items entered.