Unit 6: B2 Programming
Topic 6.1: Programming fundamentals Questions
Practice 20 exam-style questions for IB Computer Science Topic 6.1. Review the question stems below, then unlock the full Question Bank to access markschemes, model answers, and AI grading.
1State2 marks
2026
State four data types commonly available in a programming language.
Markscheme and model answer locked
Unlock Question2Choose1 mark
2026
Choose what happens to a local variable when its function returns.
Markscheme and model answer locked
Unlock Question3Identify2 marks
2026
Identify the most appropriate data type for each of: a count of students, a price, a name, and whether a book is on loan.
Markscheme and model answer locked
Unlock Question5Distinguish2 marks
2026
Distinguish between a variable and a constant.
Markscheme and model answer locked
Unlock Question6Determine2 marks
2026
Determine the value and type of the result of 7 / 2 in a language where division of two integers gives an integer.
Markscheme and model answer locked
Unlock Question7Suggest3 marks
2026
Suggest what a program should do when a cast from text to integer fails.
Markscheme and model answer locked
Unlock Question8Choose1 mark
2026
Choose the most appropriate data type for storing whether a student has paid.
Markscheme and model answer locked
Unlock Question9Distinguish2 marks
2026
Distinguish between testing and debugging.
Markscheme and model answer locked
Unlock Question10Outline2 marks
2026
Outline what a breakpoint does.
Markscheme and model answer locked
Unlock Question11Explain4 marks
2026
Explain why a debugger is more effective than adding output statements.
Markscheme and model answer locked
Unlock Question12Choose1 mark
2026
Choose the best first step when a fault is reported.
Markscheme and model answer locked
Unlock Question13Explain3 marks
2026
Explain why strings are often treated as immutable in modern languages.
Markscheme and model answer locked
Unlock Question14Determine3 marks
2026
Determine the output of: SET s TO 'DATABASE'; SET r TO ''; FOR i FROM 1 TO length of s: IF character i of s ≠ 'A' THEN SET r TO r + character i of s; END IF; END FOR; OUTPUT r.
Markscheme and model answer locked
Unlock Question15Distinguish3 marks
2026
Distinguish between a run-time error and a logic error.
Markscheme and model answer locked
Unlock Question16Construct4 marks
2026
Write a Python program that outputs whether a string called s is a palindrome.
Markscheme and model answer locked
Unlock Question17Construct4 marks
2026
Write a Java program that outputs how many times the letter A appears in a string called s.
Markscheme and model answer locked
Unlock Question18Outline2 marks
2026
Outline what stepping through code means.
Markscheme and model answer locked
Unlock Question19Choose1 mark
2026
Choose the substring of 'PROGRAM' from position 3 to position 5, counting the first character as position 1.
Markscheme and model answer locked
Unlock Question20Explain4 marks
2026
Explain why local variables are preferred to global ones.
Markscheme and model answer locked
Unlock QuestionReady to practice Topic 6.1?
Get instant AI feedback on your answers, view detailed markschemes, and track your progress across all IB Computer Science topics.
Start Practising Now