EmSAT Computer Science 5 — Questions and Answers
Question 1: What is the purpose of a compiler in programming?
- To execute code line by line
- To translate high-level source code into machine code (Correct answer)
- To debug runtime errors automatically
- To manage memory allocation
Correct answer: To translate high-level source code into machine code
A compiler translates an entire high-level language program into machine code before execution.
Question 2: Which network topology connects all devices to a single central cable?
- Star
- Ring
- Bus (Correct answer)
- Mesh
Correct answer: Bus
In a bus topology, all devices share a single communication cable called the backbone.
Question 3: What does the acronym SQL stand for?
- Sequential Query Language
- Structured Query Language (Correct answer)
- Simple Query Logic
- System Query Layer
Correct answer: Structured Query Language
SQL stands for Structured Query Language, used to manage and query relational databases.
Question 4: Which of the following is an example of volatile memory?
- Hard Disk Drive
- SSD
- RAM (Correct answer)
- ROM
Correct answer: RAM
RAM (Random Access Memory) is volatile, meaning it loses its data when power is removed.
Question 5: In Python, what will print(type(3.14)) output?
- <class 'int'>
- <class 'str'>
- <class 'float'> (Correct answer)
- <class 'double'>
Correct answer: <class 'float'>
3.14 is a floating-point number, so Python identifies its type as 'float'.
Question 6: Which logical gate outputs TRUE only when both inputs are TRUE?
- OR gate
- NOT gate
- XOR gate
- AND gate (Correct answer)
Correct answer: AND gate
An AND gate outputs TRUE (1) only when all inputs are TRUE (1).
Question 7: What is the function of a DNS server?
- Assigns IP addresses to devices dynamically
- Translates domain names into IP addresses (Correct answer)
- Encrypts data transmitted over the internet
- Filters web traffic for security
Correct answer: Translates domain names into IP addresses
A DNS (Domain Name System) server translates human-readable domain names into numerical IP addresses.
What is the purpose of a compiler in programming?