Practice IB Computer Science (First Exam 2027) Topic B2 Programming with authentic exam-style questions for both SL and HL students. This question bank focuses on the exact syllabus content for B2 Programming and mirrors Paper 1, 2 style where relevant.
Get instant solutions, detailed explanations, and build confidence with questions aligned to IB examiner expectations.
Identify two benefits of using NoSQL databases over relational databases.
Identify two benefits of using NoSQL databases over relational databases.
Using the Scanner class, create a class that reads the radius of a circle from a text file and calculates the area. The radius should be a float.
State one reason why a programmer would use file processing in a program.
State one reason why a programmer would use file processing in a program.
Write a program that takes a string input from the user and prints the reversed version of the string using BufferedReader.
Write a program that takes a string input from the user and prints the reversed version of the string using BufferedReader.
Ask the user for their name and write it to a file called names.txt. Use Scanner for input and FileWriter for output. 4 marks
Example code import java.util.Scanner; import java.io.FileWriter; import java.io.IOException; public class SaveName { public static void main(String[] args) throws IOException { Scanner scanner = new Scanner(System.in);
System.out.print("Enter your name: ");
String name = scanner.nextLine();
FileWriter writer = new FileWriter("names.txt");
writer.write(name);
writer.close();
scanner.close();
}
}