CS101 – Introduction to Computing: Midterm Important Subjective (33 Solved Q&As)
Computer Science • Read every solved subjective question with its model answer directly on this page. Free, no login required.
All 664 Midterm Packs · CS101 Course Page · CS101 MCQ Pack (173 MCQs)
-
What is the stored-program concept? Who introduced the idea of storing a program in main memory?
Topic: Computer Basics & History • 3 marks marks
The stored-program concept means that a computer's program (its instructions) is stored in its main memory along with the data, instead of the machine being rewired for every new task. The CPU fetches instructions from memory one by one and executes them, so the same machine can perform different tasks simply by loading a different program. This idea was introduced by John von Neumann, and computers based on this design are called von Neumann machines.
-
Write a short note on ENIAC.
Topic: Computer Basics & History • 2 marks marks
ENIAC stands for Electronic Numerical Integrator and Calculator. It was one of the first general-purpose electronic computers, built in the 1940s by John W. Mauchly and J. Presper Eckert. It was a huge machine built from vacuum tubes and had to be programmed by setting switches and plugging cables, which made it slow and laborious to reconfigure for a new problem.
-
Describe the problem-solving phases presented by G. Polya in 1945.
Topic: Computer Basics & History • 3 marks marks
In 1945 the mathematician G. Polya presented problem solving in four phases: (1) Understand the problem - identify what is given and what is required. (2) Devise a plan - find a strategy or method for solving it. (3) Carry out the plan - execute the steps carefully. (4) Look back - check the result and review the solution. These phases form the basis of algorithm development in computing.
-
Why were the computers of the 1940s and 1950s not very flexible or efficient?
Topic: Computer Basics & History • 3 marks marks
The computers of the 1940s and 1950s were not flexible or efficient because they did not store programs in memory. For every new problem the machine had to be physically reconfigured - switches had to be set and cables plugged and unplugged by hand. This setup took a great deal of time and effort, and until it was set up again the machine could perform only the one task it was wired for.
-
Define bit and byte. How is a textual symbol (character) represented inside a computer?
Topic: Data Representation & Number Systems • 3 marks marks
A bit (short for binary digit) is the smallest unit of data in a computer; it can hold only one of two values, 0 or 1 (representing false or true). A byte is a group of 8 bits. Inside the computer, every textual symbol is represented by a unique bit pattern - letters, digits and even the space are each assigned a distinct code of bits (as in ASCII), so all text is stored and processed in the form of bit patterns. A long string of bits is often called a stream.
-
Convert the binary number 101101 into decimal. Show your working.
Topic: Data Representation & Number Systems • 3 marks marks
101101 = 1x2^5 + 0x2^4 + 1x2^3 + 1x2^2 + 0x2^1 + 1x2^0 = 32 + 0 + 8 + 4 + 0 + 1 = 45. So 101101 (binary) = 45 (decimal).
-
Convert the decimal number 25 into binary. Show your working.
Topic: Data Representation & Number Systems • 2 marks marks
Divide by 2 repeatedly and read the remainders from bottom to top: 25/2 = 12 remainder 1; 12/2 = 6 remainder 0; 6/2 = 3 remainder 0; 3/2 = 1 remainder 1; 1/2 = 0 remainder 1. So 25 (decimal) = 11001 (binary).
-
What is normalized form in floating-point representation? Why is it used?
Topic: Data Representation & Number Systems • 3 marks marks
In floating-point representation the same value can be written in several ways by moving the radix point and adjusting the exponent. The normalized form is the standard form in which the radix point is placed in a fixed position (immediately following the first non-zero digit of the mantissa). It is used because it eliminates the possibility of multiple representations for the same value - every value then has exactly one representation, which makes storage and comparison consistent.
-
What are truncation errors? How do they arise in floating-point representation?
Topic: Data Representation & Number Systems • 3 marks marks
Some numbers have non-terminating (endless) expansions in binary, just as 1/3 has an endless expansion in decimal. A computer has only a fixed number of bits for the mantissa, so such an expansion must be cut off (truncated) at some point. The value actually stored is therefore only an approximation of the true value, and this small error is called a truncation error. (Note: non-terminating expansions cause truncation errors, not overflow.)
-
What is a machine cycle? Name and briefly explain its steps.
Topic: CPU, Memory & Storage • 3 marks marks
The machine cycle is the basic cycle that the CPU repeats continuously while executing a program. It has three steps: (1) Fetch - the CPU retrieves the next instruction from main memory. (2) Decode - the CPU interprets the instruction to determine what operation is required. (3) Execute - the CPU performs the operation, and then begins the next cycle. Bit patterns for these steps move between the CPU and main memory over the bus.
-
Differentiate between RAM and ROM. (Any three points)
Topic: CPU, Memory & Storage • 3 marks marks
(1) RAM (Random Access Memory) is volatile - its contents are lost when the power is switched off; ROM (Read Only Memory) is non-volatile and retains its contents without power. (2) RAM can be read from and written to during normal use, so it holds the programs and data currently being used; ROM is normally only read and holds fixed start-up (bootstrap) instructions. (3) RAM is the computer's main working memory, while ROM is used for permanent firmware.
-
What is virtual memory? How is it created by paging?
Topic: CPU, Memory & Storage • 3 marks marks
Virtual memory is the large, fictional (imaginary) memory space created by paging. The operating system divides programs and memory into fixed-size blocks called pages; pages that are not currently needed are kept on the disk and are swapped into main memory only when required. In this way the system behaves as if it had much more main memory than is physically installed.
-
Differentiate between the RISC and CISC design approaches.
Topic: CPU, Memory & Storage • 3 marks marks
RISC (Reduced Instruction Set Computer) is the design approach in which a CPU is designed to execute a minimal set of simple machine instructions; the emphasis is on fast, simple instructions. CISC (Complex Instruction Set Computer) is the opposite approach: the CPU provides a large set of complex instructions, each capable of performing more work. The key distinguishing point is the size and complexity of the instruction set - minimal in RISC, large and complex in CISC.
-
What is an SSD? How does it differ from a traditional hard disk (HDD)?
Topic: CPU, Memory & Storage • 2 marks marks
SSD stands for Solid State Disk (Drive). It stores data in flash memory chips and has no moving parts. A traditional hard disk, in contrast, stores data on spinning magnetic platters and needs a moving read/write head to access it. Because it has no moving parts, an SSD is faster, quieter and more resistant to shocks than an HDD.
-
What is an operating system? Write any four functions (responsibilities) of an operating system.
Topic: Operating Systems & Software • 5 marks marks
An operating system is the system software that controls the overall operation of a computer, manages its resources and acts as the interface between the user/applications and the hardware. Its important functions include: (1) Resource allocation - allocating the machine's resources (CPU time, memory, printers, etc.) to the processes in the system, and keeping track of whether each resource (e.g. the printer) has been allocated or not. (2) Security - protecting the machine's resources from unauthorized access. (3) Process management - starting, scheduling and terminating processes. (4) Memory management - keeping track of which parts of memory are in use and which are free, including managing virtual memory. (5) File management - organising, storing, retrieving and protecting files. (Any four.) System software itself consists of two categories: the operating system and utility software.
-
Differentiate between system software and application software.
Topic: Operating Systems & Software • 3 marks marks
System software consists of the programs that control the operation of the computer itself; it has two categories - the operating system and utility software. Application software consists of programs designed to perform tasks particular to the machine's utilization, i.e. the end-user's own jobs, such as word processing, spreadsheets and games. In short, system software serves the computer, while application software serves the user's tasks.
-
What is a process? Why is a process called a dynamic activity?
Topic: Operating Systems & Software • 3 marks marks
A process is a program in execution - the program together with its current state (the values in the CPU registers, the program counter and the memory it is using). A process is called a dynamic activity because it keeps changing with time: as the program executes, its state changes continuously from moment to moment. This is unlike a program stored on disk, which is merely a static set of instructions.
-
What is deadlock? Explain with a suitable example.
Topic: Operating Systems & Software • 3 marks marks
Deadlock is a problem that can arise during resource allocation in which two (or more) processes are each holding a resource that the other needs, so neither can proceed. Example: Process A has been allocated the printer and is waiting for the CD drive, while Process B has been allocated the CD drive and is waiting for the printer. Both wait forever and work comes to a halt, unless the operating system intervenes.
-
What is a GUI? How does it make programs easier to use?
Topic: Operating Systems & Software • 2 marks marks
GUI stands for Graphical User Interface. It uses graphics - windows, icons, menus and a pointer (mouse) - to represent programs, files and options on the screen. Instead of memorising and typing text commands, the user simply points and clicks, which makes programs much easier to learn and use. Windows is an example of an operating system that uses graphics (a GUI) to make programs easier to use.
-
What is an internet? Why is the Internet called a 'network of networks'?
Topic: Internet, Web & Networking • 3 marks marks
An internet is a collection of networks (LANs and WANs) connected together so that machines on one network can communicate with machines on another. The Internet is called a network of networks because it is not a single network: it consists of a very large number of smaller networks, constructed and connected by Internet Service Providers (ISPs) and joined together through routers into one worldwide system. (WWW - World Wide Web - is a service that runs over the Internet, not the Internet itself.)
-
What is a router? What is the role of a forwarding table in a router?
Topic: Internet, Web & Networking • 3 marks marks
A router is the device that handles the connection between networks in an internet; it forwards messages from one network towards their destination. Each router maintains a forwarding table, which contains the router's knowledge about the direction in which messages should be sent for different destinations. When a message (packet) arrives, the router consults its forwarding table to decide in which direction to forward it next.
-
What are packets? Why are long messages divided into packets before transmission?
Topic: Internet, Web & Networking • 3 marks marks
Packets are the small segments into which long messages are divided for transmission over a network; the transport layer divides long messages into these small segments. Dividing a message into packets makes transmission efficient and reliable: the packets can travel through the network (possibly by different routes), one long message does not block the network for others, and if a packet is lost or damaged only that small packet needs to be sent again. At the destination, the packets are reassembled into the original message.
-
What is a protocol? Why are protocols needed in a computer network?
Topic: Internet, Web & Networking • 2 marks marks
A protocol is a set of rules by which activities are conducted in a network - the rules that govern how machines exchange messages and cooperate with each other. Protocols are needed so that devices and software from different manufacturers can understand one another and the network can function reliably; without common rules, communication between machines would break down.
-
Differentiate between LAN and WAN.
Topic: Internet, Web & Networking • 3 marks marks
LAN (Local Area Network) connects machines within a small, limited area, such as a single building or office; it is usually owned by one organisation and provides high data-transfer speeds. WAN (Wide Area Network) connects machines over a large geographical area - across cities or countries - by linking many LANs together; it generally relies on third-party communication links and is slower than a LAN. The Internet is built by interconnecting LANs and WANs.
-
What is an IP address? Which of the following is NOT a valid IP address, and why? (a) 192.168.1.1 (b) 192.168.1.0.1
Topic: Internet, Web & Networking • 3 marks marks
An IP address is the unique address assigned to a machine on an IP network so that messages can be delivered to it. An IPv4 address consists of four numbers (each between 0 and 255) separated by dots, for example 192.168.1.1. The address 192.168.1.0.1 is NOT a valid IP address, because it contains five numbers instead of four. (The first part of a web address is resolved through the domain name system; the topmost level of a domain name is its TLD - Top Level Domain.)
-
Differentiate between POP3 and IMAP.
Topic: Email, Search & Web Technologies • 3 marks marks
POP3 (Post Office Protocol 3) is the protocol that helps to store the email messages on a local machine while retrieving them from the receiving server - the mail is downloaded to the user's own computer. IMAP (Internet Message Access Protocol) keeps the messages stored on the server itself and allows the user to view and manage them there, so the same mailbox can be accessed from different machines. (Note: the protocol associated with storing mail on the local machine is POP3, not IMAP.)
-
Name the protocols associated with the transfer of email. Which protocol is NOT associated with mail transfer, and what is its role?
Topic: Email, Search & Web Technologies • 3 marks marks
The protocols associated with the transfer of email are SMTP (Simple Mail Transfer Protocol - used to send mail from a client to a server and between servers), POP3 and IMAP (used to retrieve mail from the receiving server). MIME (Multipurpose Internet Mail Extensions) is NOT associated with the transfer of email messages; its role is only to extend the format of messages, so that attachments and non-text content (such as images and audio) can be included in an email.
-
Differentiate between client-side scripting and server-side scripting, giving one example of each.
Topic: Email, Search & Web Technologies • 3 marks marks
In client-side scripting, the script runs in the user's own browser on the client machine - for example JavaScript (Java applets and HTML also belong to the client side). In server-side scripting, the script runs on the web server and only the resulting page is sent to the browser - for example PHP (Personal Home Page). Client-side scripting responds quickly without loading the server, while server-side scripting is used for tasks such as accessing databases on the server.
-
How can you search for an exact phrase on Google?
Topic: Email, Search & Web Technologies • 2 marks marks
To search for an exact phrase on Google, enclose the phrase in quotation marks (" "). The search engine then returns only those pages in which the words appear together, in the same order, as one phrase. For example, searching for "Introduction to Computing" finds pages containing that exact phrase, rather than pages containing the words scattered separately. (A phrase can also be searched even when one word at a particular location is not known.)
-
Define an algorithm. Why is an algorithm said to be abstract and distinct from its representation?
Topic: Algorithms, Programming & Security • 3 marks marks
An algorithm is a well-defined set of steps (instructions) that describes how to solve a problem or perform a task. An algorithm is abstract and distinct from its representation because the underlying sequence of steps remains the same however it is written down: the same algorithm can be represented in plain English, as a flowchart, in pseudocode, or in any programming language, without the algorithm itself changing.
-
What is a primitive, in the context of algorithm representation?
Topic: Algorithms, Programming & Security • 2 marks marks
A primitive is a well-defined building block from which algorithm representations can be constructed - an elementary step whose meaning is understood exactly by whoever (or whatever) is to execute the algorithm, so that it needs no further explanation. Establishing a set of such primitives gives a language in which algorithms can be expressed precisely and unambiguously. (For example, in Python the keyword 'def' is used to define a function - one of the language's basic building blocks.)
-
'A program that is believed to be correct and a program that is correct - the two are the same.' Comment.
Topic: Algorithms, Programming & Security • 2 marks marks
The two are not necessarily the same. A program may be believed to be correct because it has produced correct results in the tests performed so far, yet it may still contain errors that appear only in situations that have not been tested. Belief is not proof: a program is correct only if it actually produces the correct result in every case.
-
What is destructive software? How does an intruder use it? Also name one protective measure.
Topic: Algorithms, Programming & Security • 3 marks marks
Destructive software is malicious software designed to harm a computer system - for example, to destroy or corrupt data or to damage programs. Once an intruder (or perhaps an authorized user with malicious intent) gains access to a computer system, the next step is usually to explore the system, looking for information of interest or for places to insert destructive software. A common protective measure is antivirus software, which is used to detect and remove the presence of known viruses and other infections; computer misuse is also covered by law, e.g. the Computer Fraud and Abuse Act, passed in 1984.