EmSAT Computer Science 4 — Questions and Answers
Question 1: What is the decimal value of the binary number 1011?
- 9
- 10
- 11 (Correct answer)
- 13
Correct answer: 11
1011 in binary = 1×8 + 0×4 + 1×2 + 1×1 = 8 + 0 + 2 + 1 = 11.
Question 2: Which sorting algorithm has a best-case time complexity of O(n)?
- Selection Sort
- Merge Sort
- Bubble Sort (Correct answer)
- Quick Sort
Correct answer: Bubble Sort
Bubble Sort has a best-case complexity of O(n) when the list is already sorted and no swaps are needed.
Question 3: In object-oriented programming, what is encapsulation?
- Inheriting methods from a parent class
- Bundling data and methods that operate on it within a single unit (Correct answer)
- Creating multiple objects from a class
- Overriding a method in a subclass
Correct answer: Bundling data and methods that operate on it within a single unit
Encapsulation bundles data and related methods together and restricts direct access from outside.
Question 4: What does CSS stand for?
- Computer Style Sheets
- Cascading Style Sheets (Correct answer)
- Creative Style Scripts
- Coded Styling System
Correct answer: Cascading Style Sheets
CSS stands for Cascading Style Sheets, used to define the presentation of HTML documents.
Question 5: Which type of malware disguises itself as legitimate software to trick users into installing it?
- Worm
- Ransomware
- Trojan Horse (Correct answer)
- Spyware
Correct answer: Trojan Horse
A Trojan Horse disguises itself as useful software but performs malicious actions once installed.
Question 6: How many bytes are in 1 Kilobyte (KB)?
- 100
- 512
- 1000
- 1024 (Correct answer)
Correct answer: 1024
In computing, 1 Kilobyte = 2^10 = 1024 bytes.
Question 7: In a flowchart, which shape is used to represent a decision?
- Rectangle
- Oval
- Parallelogram
- Diamond (Correct answer)
Correct answer: Diamond
A diamond shape in a flowchart represents a decision point with two or more possible branches.
What is the decimal value of the binary number 1011?