Practice IB Computer Science (CS) Topic 4.1 General Principles with authentic exam-style questions for both SL and HL students. This question bank focuses on the exact syllabus content for 4.1 General Principles and mirrors Paper 1, 2, 3 style where relevant.
Get instant solutions, detailed explanations, and build confidence with questions aligned to IB examiner expectations.
A company has 600 employees whose names are currently stored using an array called NAMES. The names are stored as surname, first name. For example: Smith, Jane, Uysal, Rafael, Ahmed, Ishmael, Jonsonn, Sara, ...
The names in the array are kept in a random order. However, it would be more useful if they were kept in alphabetical order.
The company's staff list is now organized in arrays in alphabetical order.
A binary search was used to find a specific name in the surname array.
Describe the process a binary search would follow to find a record in the surname array.
Outline one benefit of using sub-programmes to implement your algorithms from the sorting and searching parts of this question.
Construct a pseudocode algorithm that will store the surnames in one array and first names in another.
Construct a pseudocode algorithm that will sort the surnames into alphabetical order using the bubble sort method. The order of the first names must also be changed so that they keep the same index as their corresponding surname.
IB Computer Science SL Paper 1
Construct a logic diagram for the following expression. NOT A OR (A AND B)
Jackson City University has a Music Department that provides music lessons to students in a number of high schools in the city. The Jackson City University Music Department teachers visit the different schools in the city to teach students a range of musical instruments. The following diagram shows an unnormalized table of student data. | Student_
ID | First_
Name | Family__
Name | Date_of_
birth | Student_Choice | School | School__
Post_Code | School_
phone_no |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| 305 | JOE | PARKAR | | VIOLIN,
PERCUSSION | Tampines | 512233 | 065544335,
065544336 |
| 306 | MARY | ALCHIN | | GUITAR,
KEYBOARD | Arab
Street | 198876 | 065543213 |
| 307 | RAM | WONG | | GUITAR | Bedok | 467501 | 06543321,
065433222 |
| 308 | KATE | MOHAMA | | PERCUSSION | Simei | 512233 | 065444412 |
| 309 | RYAN | TAN | | GUITAR | Seng
Kang | 208563 | 065667898 |
| 310 | PHILIP | BALMER | | VIOLIN | Orchard | 309893 | 065756379 |
| 311 | MIKE | MOSES | | GUITAR | Clementi | 308978 | 065745677 |
| | | | | | | | |
Explain one benefit of normalizing a database.
Identify three ways that incorrect data could be prevented from being added into the School_phone_no field.
Outline what would be necessary to make the above unnormalized table conform to 1st Normal Form (1NF).
Construct the 3rd Normal Form (3NF) of the unnormalized relation shown above.
Explain the difference between 2nd Normal Form (2NF) and 3rd Normal Form (3NF).
Construct a trace table, starting from the initial values and , for the following algorithm
A = 2
B = 7
loop while B >= A
A = A + 1
output(B - A)
B = B - 1
end loop
A navigation system uses a graph (consisting of nodes and weighted edges) to represent a city's road network for route planning.
Explain three ways this abstract representation improves the performance or functionality of the route-finding algorithm compared to using a raw, high-resolution satellite image of the city.