BOLINGO H P Comp Science

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 56

1. List the main characteristics of the computer.

 Answer:
 Processing Power
 Storage Capacity
 Connectivity
 Input Devices
 Output Devices
 Memory
 Speed
 Accuracy
2. Define a supercomputer.
 Answer:
 A supercomputer is an extremely powerful computing machine with high
processing capabilities, designed to handle complex calculations and tasks at
incredibly fast speeds.
3. What are the four classifications of computers based on their size?
 Answer:
 Supercomputers
 Mainframe Computers
 Minicomputers
 Microcomputers
4. Describe the following:
 (a) Program
 A program is a set of instructions that directs a computer on how to perform
specific tasks or operations.
 (b) Hardware
 Hardware refers to the physical components of a computer system, such as the
central processing unit (CPU), memory, and peripherals.
 (c) Software
 Software encompasses the programs, applications, and data that instruct and
control the hardware to perform tasks.
 (d) ALU (Arithmetic Logic Unit)
 ALU is the part of the CPU responsible for performing arithmetic and logic
operations.
 (e) CU (Control Unit)
 CU manages and coordinates the operations of the computer's components,
ensuring instructions are executed.
 (f) CPU (Central Processing Unit)
 CPU is the core component responsible for executing instructions and performing
calculations.
 (g) Data
 Data represents raw facts and figures, which, when processed, provide meaningful
information.
5. Compare the distinctions between the first, second, third, fourth, and fifth generations of
computers.
 Answer:
 First Generation: Vacuum tubes, machine language.
 Second Generation: Transistors, assembly language.
 Third Generation: Integrated circuits, high-level languages.
 Fourth Generation: Microprocessors, personal computers.
 Fifth Generation: Artificial Intelligence, natural language processing.
6. What brand of computer did you assemble and disassemble?
 Answer:
 Unfortunately, I don't have personal experiences or preferences as I am a machine
learning model and don't physically interact with computers.
7. Explain how you would connect both a data projector and monitor to a single computer.
 Answer:
 Connect the monitor to the computer's primary display output.
 Connect the data projector to another available display output (VGA, HDMI,
etc.).
 Adjust display settings in the computer's operating system to extend or duplicate
the desktop.
8. Depending on the permanence of the instructions or data written on ROM, there are four
Types of Read-Only Memory. Summarize them.
 Answer:
 ROM (Read-Only Memory) types:
1. MROM (Mask ROM): Permanently programmed during manufacturing.
2. PROM (Programmable ROM): Can be programmed once by the user.
3. EPROM (Erasable Programmable ROM): User-programmable and
erasable using UV light.
4. EEPROM (Electrically Erasable Programmable ROM): User-
programmable and erasable using electrical signals.
9. Compare Disk Defragmenter and Scan Disk/Check Now.
 Answer:
 Disk Defragmenter: Reorganizes fragmented data on a disk for improved
performance.
 Scan Disk/Check Now: Checks for and fixes disk errors, ensuring data integrity.
10. Determine the role of Disk Cleanup.
 Answer:
 Disk Cleanup removes unnecessary files from the computer's hard drive, freeing
up space and potentially improving performance.

I'll continue with the remaining questions in the next response.


Continuing from the previous response:

11. Elaborate responsibilities and role of a technician in computer repairing.


 Answer:
 Diagnosing hardware and software issues.
 Repairing or replacing faulty components.
 Installing and configuring hardware and software.
 Performing system upgrades.
 Troubleshooting network problems.
 Providing technical support to users.
 Conducting preventive maintenance.
12. What is computer ergonomics?
 Answer:
 Computer ergonomics involves designing and arranging computer workspaces to
optimize efficiency, comfort, and safety for users.
13. Describe common health conditions arising from prolonged use of computers and
electronic devices.
 Answer:
 Eye strain and discomfort (Computer Vision Syndrome).
 Repetitive Strain Injuries (RSIs) such as carpal tunnel syndrome.
 Back and neck pain.
 Headaches.
 Fatigue.
 Poor posture-related issues.
14. Summarize ethical issues that should be addressed at the individual, social, and political
levels in computer ethics.
 Answer:
 Individual: Privacy, honesty in software use.
 Social: Access to technology, digital divide.
 Political: Cybersecurity policies, internet censorship.
15. Identify some of the causes of health risks such as Computer Vision Syndrome (CVS), back
pain, and failure of the endocrine system.
 Answer:
 Prolonged screen exposure.
 Poor posture and ergonomics.
 Inadequate breaks and eye rest.
 Lack of physical activity.
 Inadequate lighting.
16. Explain the concept of ergonomics in terms of keyboard layout, office furniture, and
adjustable computer displays.
 Answer:
 Keyboard Layout: Designed for comfortable and efficient typing.
 Office Furniture: Adjustable chairs and desks for proper posture.
 Adjustable Computer Displays: Allow users to customize screen height and angle
for optimal viewing.
17. Which of the following is designed to control the operations of a computer? Explain it.
 Answer:
 b) System Software: System software manages hardware components and
provides a platform for application software to run.
18. Explain major types of computer software, their uses, and examples.
 Answer:
 System Software: Manages hardware, e.g., operating systems.
 Application Software: Performs specific tasks, e.g., word processors.
 Utility Software: Maintains and optimizes system performance, e.g., antivirus.
 Programming Software: Facilitates programming, e.g., compilers.
19. Explain disk formatting in terms of a computer.
 Answer:
 Disk formatting involves preparing a storage medium (hard drive, USB) for data
storage by creating a file system and erasing existing data.
20. Select the appropriate command used to scan all system files and repair corrupted ones
where possible.
 Answer:
 b) CHKDSK
21. Explain proprietary software.
 Answer:
 Proprietary software is commercial software with restrictions on use, distribution,
and modification. Users typically need to pay for a license.
22. Discuss the functions of system software.
 Answer:
 Managing hardware resources.
 Providing a user interface.
 Facilitating communication between software and hardware.
 Managing files and security.
23. Number system:
 a) 1001112 into the decimal system.
 Answer:
1×25+1×24+1×23+1×21=32+16+8+2=58101×25+1×24+1×23+1×21
=32+16+8+2=5810
 b) Convert 432010 into the octal system.
 Answer: 43201010=150121843201010=1501218
 c) Convert 10101111002 to the hexadecimal system.
 Answer: 10101111002=5��1610101111002=5AC16
 d) Convert 30010 into the binary system base-2.
 Answer: 30010=100101100230010=1001011002
 e) Convert 5BC16 into the decimal system.
 Answer: 5��16=1468105BC16=146810
 f) Convert 1448 into the hexadecimal system.
1. Answer: 144810=59816144810=59816
List the main characteristics of the computer.
 Answer:
 Processing Power
 Storage Capacity
 Connectivity
 Input Devices
 Output Devices
 Memory
 Speed
 Accuracy
2. Define a supercomputer.
 Answer:
 A supercomputer is an extremely powerful computing machine with high
processing capabilities, designed to handle complex calculations and tasks at
incredibly fast speeds.
3. What are the four classifications of computers based on their size?
 Answer:
 Supercomputers
 Mainframe Computers
 Minicomputers
 Microcomputers
4. Describe the following:
 (a) Program
 A program is a set of instructions that directs a computer on how to perform
specific tasks or operations.
 (b) Hardware
 Hardware refers to the physical components of a computer system, such as the
central processing unit (CPU), memory, and peripherals.
 (c) Software
 Software encompasses the programs, applications, and data that instruct and
control the hardware to perform tasks.
 (d) ALU (Arithmetic Logic Unit)
 ALU is the part of the CPU responsible for performing arithmetic and logic
operations.
 (e) CU (Control Unit)
 CU manages and coordinates the operations of the computer's components,
ensuring instructions are executed.
 (f) CPU (Central Processing Unit)
 CPU is the core component responsible for executing instructions and performing
calculations.
 (g) Data
 Data represents raw facts and figures, which, when processed, provide meaningful
information.
5. Compare the distinctions between the first, second, third, fourth, and fifth generations of
computers.
 Answer:
 First Generation: Vacuum tubes, machine language.
 Second Generation: Transistors, assembly language.
 Third Generation: Integrated circuits, high-level languages.
 Fourth Generation: Microprocessors, personal computers.
 Fifth Generation: Artificial Intelligence, natural language processing.
6. What brand of computer did you assemble and disassemble?
 Answer:
 Unfortunately, I don't have personal experiences or preferences as I am a machine
learning model and don't physically interact with computers.
7. Explain how you would connect both a data projector and monitor to a single computer.
 Answer:
 Connect the monitor to the computer's primary display output.
 Connect the data projector to another available display output (VGA, HDMI,
etc.).
 Adjust display settings in the computer's operating system to extend or duplicate
the desktop.
8. Depending on the permanence of the instructions or data written on ROM, there are four
Types of Read-Only Memory. Summarize them.
 Answer:
 ROM (Read-Only Memory) types:
1. MROM (Mask ROM): Permanently programmed during manufacturing.
2. PROM (Programmable ROM): Can be programmed once by the user.
3. EPROM (Erasable Programmable ROM): User-programmable and
erasable using UV light.
4. EEPROM (Electrically Erasable Programmable ROM): User-
programmable and erasable using electrical signals.
9. Compare Disk Defragmenter and Scan Disk/Check Now.
 Answer:
 Disk Defragmenter: Reorganizes fragmented data on a disk for improved
performance.
 Scan Disk/Check Now: Checks for and fixes disk errors, ensuring data integrity.
10. Determine the role of Disk Cleanup.
 Answer:
 Disk Cleanup removes unnecessary files from the computer's hard drive, freeing
up space and potentially improving performance.

I'll continue with the remaining questions in the next response.


Continuing from the previous response:

11. Elaborate responsibilities and role of a technician in computer repairing.


 Answer:
 Diagnosing hardware and software issues.
 Repairing or replacing faulty components.
 Installing and configuring hardware and software.
 Performing system upgrades.
 Troubleshooting network problems.
 Providing technical support to users.
 Conducting preventive maintenance.
12. What is computer ergonomics?
 Answer:
 Computer ergonomics involves designing and arranging computer workspaces to
optimize efficiency, comfort, and safety for users.
13. Describe common health conditions arising from prolonged use of computers and
electronic devices.
 Answer:
 Eye strain and discomfort (Computer Vision Syndrome).
 Repetitive Strain Injuries (RSIs) such as carpal tunnel syndrome.
 Back and neck pain.
 Headaches.
 Fatigue.
 Poor posture-related issues.
14. Summarize ethical issues that should be addressed at the individual, social, and political
levels in computer ethics.
 Answer:
 Individual: Privacy, honesty in software use.
 Social: Access to technology, digital divide.
 Political: Cybersecurity policies, internet censorship.
15. Identify some of the causes of health risks such as Computer Vision Syndrome (CVS), back
pain, and failure of the endocrine system.
 Answer:
 Prolonged screen exposure.
 Poor posture and ergonomics.
 Inadequate breaks and eye rest.
 Lack of physical activity.
 Inadequate lighting.
16. Explain the concept of ergonomics in terms of keyboard layout, office furniture, and
adjustable computer displays.
 Answer:
 Keyboard Layout: Designed for comfortable and efficient typing.
 Office Furniture: Adjustable chairs and desks for proper posture.
 Adjustable Computer Displays: Allow users to customize screen height and angle
for optimal viewing.
17. Which of the following is designed to control the operations of a computer? Explain it.
 Answer:
 b) System Software: System software manages hardware components and
provides a platform for application software to run.
18. Explain major types of computer software, their uses, and examples.
 Answer:
 System Software: Manages hardware, e.g., operating systems.
 Application Software: Performs specific tasks, e.g., word processors.
 Utility Software: Maintains and optimizes system performance, e.g., antivirus.
 Programming Software: Facilitates programming, e.g., compilers.
19. Explain disk formatting in terms of a computer.
 Answer:
 Disk formatting involves preparing a storage medium (hard drive, USB) for data
storage by creating a file system and erasing existing data.
20. Select the appropriate command used to scan all system files and repair corrupted ones
where possible.
 Answer:
 b) CHKDSK
21. Explain proprietary software.
 Answer:
 Proprietary software is commercial software with restrictions on use, distribution,
and modification. Users typically need to pay for a license.
22. Discuss the functions of system software.
 Answer:
 Managing hardware resources.
 Providing a user interface.
 Facilitating communication between software and hardware.
 Managing files and security.
23. Number system:
 a) 1001112 into the decimal system.
 Answer:
1×25+1×24+1×23+1×21=32+16+8+2=58101×25+1×24+1×23+1×21
=32+16+8+2=5810
 b) Convert 432010 into the octal system.
 Answer: 43201010=150121843201010=1501218
 c) Convert 10101111002 to the hexadecimal system.
 Answer: 10101111002=5��1610101111002=5AC16
 d) Convert 30010 into the binary system base-2.
 Answer: 30010=100101100230010=1001011002
 e) Convert 5BC16 into the decimal system.
 Answer: 5��16=1468105BC16=146810
 f) Convert 1448 into the hexadecimal system.
1. Answer: 144810=59816144810=59816
List the main characteristics of the computer.
 Answer:
 Processing Power
 Storage Capacity
 Connectivity
 Input Devices
 Output Devices
 Memory
 Speed
 Accuracy
2. Define a supercomputer.
 Answer:
 A supercomputer is an extremely powerful computing machine with high
processing capabilities, designed to handle complex calculations and tasks at
incredibly fast speeds.
3. What are the four classifications of computers based on their size?
 Answer:
 Supercomputers
 Mainframe Computers
 Minicomputers
 Microcomputers
4. Describe the following:
 (a) Program
 A program is a set of instructions that directs a computer on how to perform
specific tasks or operations.
 (b) Hardware
 Hardware refers to the physical components of a computer system, such as the
central processing unit (CPU), memory, and peripherals.
 (c) Software
 Software encompasses the programs, applications, and data that instruct and
control the hardware to perform tasks.
 (d) ALU (Arithmetic Logic Unit)
 ALU is the part of the CPU responsible for performing arithmetic and logic
operations.
 (e) CU (Control Unit)
 CU manages and coordinates the operations of the computer's components,
ensuring instructions are executed.
 (f) CPU (Central Processing Unit)
 CPU is the core component responsible for executing instructions and performing
calculations.
 (g) Data
 Data represents raw facts and figures, which, when processed, provide meaningful
information.
5. Compare the distinctions between the first, second, third, fourth, and fifth generations of
computers.
 Answer:
 First Generation: Vacuum tubes, machine language.
 Second Generation: Transistors, assembly language.
 Third Generation: Integrated circuits, high-level languages.
 Fourth Generation: Microprocessors, personal computers.
 Fifth Generation: Artificial Intelligence, natural language processing.
6. What brand of computer did you assemble and disassemble?
 Answer:
 Unfortunately, I don't have personal experiences or preferences as I am a machine
learning model and don't physically interact with computers.
7. Explain how you would connect both a data projector and monitor to a single computer.
 Answer:
 Connect the monitor to the computer's primary display output.
 Connect the data projector to another available display output (VGA, HDMI,
etc.).
 Adjust display settings in the computer's operating system to extend or duplicate
the desktop.
8. Depending on the permanence of the instructions or data written on ROM, there are four
Types of Read-Only Memory. Summarize them.
 Answer:
 ROM (Read-Only Memory) types:
1. MROM (Mask ROM): Permanently programmed during manufacturing.
2. PROM (Programmable ROM): Can be programmed once by the user.
3. EPROM (Erasable Programmable ROM): User-programmable and
erasable using UV light.
4. EEPROM (Electrically Erasable Programmable ROM): User-
programmable and erasable using electrical signals.
9. Compare Disk Defragmenter and Scan Disk/Check Now.
 Answer:
 Disk Defragmenter: Reorganizes fragmented data on a disk for improved
performance.
 Scan Disk/Check Now: Checks for and fixes disk errors, ensuring data integrity.
10. Determine the role of Disk Cleanup.
 Answer:
 Disk Cleanup removes unnecessary files from the computer's hard drive, freeing
up space and potentially improving performance.

I'll continue with the remaining questions in the next response.


Continuing from the previous response:

11. Elaborate responsibilities and role of a technician in computer repairing.


 Answer:
 Diagnosing hardware and software issues.
 Repairing or replacing faulty components.
 Installing and configuring hardware and software.
 Performing system upgrades.
 Troubleshooting network problems.
 Providing technical support to users.
 Conducting preventive maintenance.
12. What is computer ergonomics?
 Answer:
 Computer ergonomics involves designing and arranging computer workspaces to
optimize efficiency, comfort, and safety for users.
13. Describe common health conditions arising from prolonged use of computers and
electronic devices.
 Answer:
 Eye strain and discomfort (Computer Vision Syndrome).
 Repetitive Strain Injuries (RSIs) such as carpal tunnel syndrome.
 Back and neck pain.
 Headaches.
 Fatigue.
 Poor posture-related issues.
14. Summarize ethical issues that should be addressed at the individual, social, and political
levels in computer ethics.
 Answer:
 Individual: Privacy, honesty in software use.
 Social: Access to technology, digital divide.
 Political: Cybersecurity policies, internet censorship.
15. Identify some of the causes of health risks such as Computer Vision Syndrome (CVS), back
pain, and failure of the endocrine system.
 Answer:
 Prolonged screen exposure.
 Poor posture and ergonomics.
 Inadequate breaks and eye rest.
 Lack of physical activity.
 Inadequate lighting.
16. Explain the concept of ergonomics in terms of keyboard layout, office furniture, and
adjustable computer displays.
 Answer:
 Keyboard Layout: Designed for comfortable and efficient typing.
 Office Furniture: Adjustable chairs and desks for proper posture.
 Adjustable Computer Displays: Allow users to customize screen height and angle
for optimal viewing.
17. Which of the following is designed to control the operations of a computer? Explain it.
 Answer:
 b) System Software: System software manages hardware components and
provides a platform for application software to run.
18. Explain major types of computer software, their uses, and examples.
 Answer:
 System Software: Manages hardware, e.g., operating systems.
 Application Software: Performs specific tasks, e.g., word processors.
 Utility Software: Maintains and optimizes system performance, e.g., antivirus.
 Programming Software: Facilitates programming, e.g., compilers.
19. Explain disk formatting in terms of a computer.
 Answer:
 Disk formatting involves preparing a storage medium (hard drive, USB) for data
storage by creating a file system and erasing existing data.
20. Select the appropriate command used to scan all system files and repair corrupted ones
where possible.
 Answer:
 b) CHKDSK
21. Explain proprietary software.
 Answer:
 Proprietary software is commercial software with restrictions on use, distribution,
and modification. Users typically need to pay for a license.
22. Discuss the functions of system software.
 Answer:
 Managing hardware resources.
 Providing a user interface.
 Facilitating communication between software and hardware.
 Managing files and security.
23. Number system:
 a) 1001112 into the decimal system.
 Answer:
1×25+1×24+1×23+1×21=32+16+8+2=58101×25+1×24+1×23+1×21
=32+16+8+2=5810
 b) Convert 432010 into the octal system.
 Answer: 43201010=150121843201010=1501218
 c) Convert 10101111002 to the hexadecimal system.
 Answer: 10101111002=5��1610101111002=5AC16
 d) Convert 30010 into the binary system base-2.
 Answer: 30010=100101100230010=1001011002
 e) Convert 5BC16 into the decimal system.
 Answer: 5��16=1468105BC16=146810
 f) Convert 1448 into the hexadecimal system.

Answer: 144810=59816144810=59816
24.What are the 4 Types of Number Systems?

Answer: The four main types of number systems are binary, octal, decimal, and hexadecimal.

25. Describe conversion rules of number systems?

Answer: Conversion rules depend on the source and destination number systems. For example,
to convert binary to decimal, each digit is multiplied by the corresponding power of 2, and the
results are summed.

26. Explain the uses of each number system?

Answer:

 Binary: Used internally by almost all modern computers.


 Octal and Hexadecimal: Convenient for representing binary-coded values in a more compact
form.
 Decimal: Widely used in everyday human activities.

27. What is the Importance of Number Systems?

Answer: Number systems provide a way to represent and manipulate numeric values. They are
fundamental to computer science, digital electronics, and mathematics.

28. Solve the following number system:

Answer: a) (1056)16=(100000110100)2=(4104)8(1056)16=(100000110100)2
=(4104)8 b) (1001001100)2=(1104)10(1001001100)2=(1104)10 c)
101012=(53)8101012=(53)8 d) 2�16=(44)102C16=(44)10 e)
(0.65625)10=(0.10101)2(0.65625)10=(0.10101)2 f)
(1011011110.11001010011)2=(537.31259)8(1011011110.11001010011)2
=(537.31259)8 g) (6327.4051)8=(3415.125)10(6327.4051)8=(3415.125)10

29. Determine the value of k in the following binary arithmetic operations:

Answer: a. 100110−�=0010102100110−k=0010102, �=0111002k=0111002 b.


�×11012=10000012k×11012=10000012, �=1012k=1012

30. What are the basic logic elements?

Answer: Basic logic elements include logic gates such as AND, OR, NOT, NAND, NOR, and
XOR.

31. What is a truth table?

Answer: A truth table is a table used in logic to represent the outcomes of all possible
combinations of input values in a logical function.

32. Examine the AND gate where one of the inputs is 1. By using the truth table, investigate
the possible outputs and hence simplify the expression �⋅1x⋅1.

Answer: The AND gate output is 1 only when both inputs are 1. So, �⋅1=�x⋅1=x.

33. A student makes a mistake somewhere in the process of simplifying the following
Boolean expression:

�⋅�+�⋅(�+�)A⋅B+A⋅(B+C)

��+�(�+�)AB+A(B+C)

��+��+��AB+AB+AC

Determine where the mistake was made, and what the proper sequence of steps should be
to simplify the original expression.

Answer: The mistake is in the second line. The correct simplification is ��+��AB+AC.

34. Write a short note on NAND Gate.


Answer: A NAND gate is a digital logic gate that performs the operation of the AND gate
followed by a NOT gate. Its output is complement of the AND gate output.

35. What are derived gates?

Answer: Derived gates are logic gates that can be constructed using other basic gates. Examples
include XOR and XNOR gates.

36.Fundamental Gates Truth Table:


 The truth tables for fundamental gates are as follows:
a) AND Gate:

A | B | Output
--|---|-------
0|0| 0
0|1| 0
1|0| 0
1|1| 1
b) OR Gate:
A | B | Output
--|---|-------
0|0| 0
0|1| 1
1|0| 1
1|1| 1
c) NOT Gate:
A | Output
--|-------
0| 1
1| 0
 These truth tables define the output of each gate based on the input
values.

37. Write a short note on XNOR gate.

Answer: An XNOR gate is a digital logic gate that outputs true (1) only when the number of true
inputs is even. It is also known as an equivalence gate.
38. Reason out why the NAND and NOR are called universal gates?

Answer: NAND and NOR gates are called universal gates because any logical function can be
implemented using combinations of NAND or NOR gates.

39. Explain the fundamental gates with expression and truth table.

Answer:

 AND Gate: �=�⋅�Q=A⋅B, Truth Table:


A B Q
0 0 0
0 1 0
1 0 0
1 1 1
 OR Gate: �=�+�Q=A+B, Truth Table:
A B Q
0 0 0
0 1 1
1 0 1
1 1 1
 NOT Gate: �=�‾Q=A, Truth Table:
A Q
0 1
1 0

40. How AND and OR can be realized using NAND and NOR gate.

Answer:

 AND using NAND: �=�⋅�‾‾Q=A⋅B


 OR using NOR: �=�+�‾‾Q=A+B

41. Explain the Derived gates with expression and truth table.

Answer:

 XOR Gate: �=�⊕�Q=A⊕B, Truth Table:


A B Q
0 0 0
0 1 1
1 0 1
1 1 0
 XNOR Gate: �=�⊕�‾Q=A⊕B, Truth Table:
A B Q
0 0 1

42.Define an algorithm:
 An algorithm is a step-by-step procedure or set of rules designed to
perform a specific task or solve a particular problem.
43.Distinguish between an algorithm and a process:
 An algorithm is a set of step-by-step instructions to perform a specific
task, while a process is the execution of those instructions.
44.When do you say that a problem is algorithmic in nature?
 A problem is algorithmic if it can be solved using a sequence of well-
defined steps or procedures.
45.What is the form and meaning of an assignment statement?
 The form of an assignment statement is variable = expression,
where a value is assigned to a variable. The meaning is to store the
result of the expression in the variable.
46.Difference between assignment operator and equality operator:
 The assignment operator (=) is used to assign a value to a variable, while
the equality operator (==) is used to compare two values for equality.
47.Difference between an algorithm and a program:
 An algorithm is a step-by-step procedure to solve a problem, while a
program is a set of instructions written in a programming language that
implements an algorithm.
48.Differences between conditional and iterative statements:
 Conditional statements (like if) make decisions based on a condition,
while iterative statements (like for or while) repeat a set of instructions
as long as a condition is true.
49.Who developed C++?
 (b) Bjarne Stroustrup
50.Original name given to C++:
 (c) C with Classes
51.Who coined C++?
 (a) Rick Mascitti
52.The smallest individual unit in a program:
 (d) Tokens
53.Extraction operator of C++:
 (b) <<
54.Which statement is not true?
 (b) Reserved words or keywords can be used as an identifier name.
55.Valid string literal:
 (d) "1232"
56.Program written in high-level language is called:
 (b) Source code
57.Operator to access reference of a variable:
 (c) &
58.Alternate to endl command:
 (d) \n
59.Draw a flowchart that accepts the name and marks obtained by a student
in Computer Project. Display the grades.
60.Algorithm to calculate even numbers between 0 and 99:
for i = 0 to 99 do
if i is even then
print i
61.Algorithm to generate even numbers between 1000 and 2000 and print
total sum:
sum = 0
for i = 1000 to 2000 do
if i is even then
print i
sum = sum + i
print "Total Sum:", sum
62.Algorithm to find out if a number is odd or even:
input num
if num mod 2 equals 0 then
print "Even"
else
print "Odd"
63.Flowchart to find the largest among three different numbers entered by
the user.
[Start]
|
V
[Input A, B, C]
|
V
/- A > B -\
| |
| /- A > C -\ (A is largest)
| | | /
\---| |---|
\-- A <= C --/
|
V
/- B > C -\
| |
| (B is largest)
\---| |
\-----/
|
V
(C is largest)
|
V
[End]
64.Characteristics of a good algorithm:
 Clear: The algorithm should be easy to understand.
 Correct: The algorithm should produce correct results.
 Efficient: The algorithm should use resources effectively.
 Finiteness: The algorithm should terminate after a finite number of
steps.
65.Pseudocode, algorithm, and flowchart to find the area of a rectangle:
input length, width
area = length * width
print "Area:", area
66.Pseudocode, algorithm, and flowchart to calculate the area and
circumference of a circle:
input radius
area = π * radius^2
circumference = 2 * π * radius
print "Area:", area
print "Circumference:", circumference
67.Pseudocode, algorithm, and flowchart to find simple interest
input principal, rate, time
interest = (principal * rate * time) / 100
print "Simple Interest:", interest
68.Pseudocode, algorithm, and flowchart to check if a given number is
positive, negative, or zero:
input num
if num > 0 then
print "Positive"
else if num < 0 then
print "Negative"
else
print "Zero"
69.Pseudocode, algorithm, and flowchart to print all natural numbers up to
n:
input n
for i = 1 to n do
print i
70.Pseudocode, algorithm, and flowchart to print n odd numbers:
input n
count = 0
i=1
while count < n do
if i is odd then
print i
count = count + 1
i=i+1
71.Pseudocode, algorithm, and flowchart to print n even numbers
input n
count = 0
i=1
while count < n do
if i is even then
print i
count = count + 1
i=i+1
72.Pseudocode, algorithm, and flowchart to print squares of a number:
input n
for i = 1 to n do
print i^2
73.Pseudocode, algorithm, and flowchart to print cubes of a number:
input n
for i = 1 to n do
print i^3
74.Pseudocode, algorithm, and flowchart to print factorial of a given
number:
input n
factorial = 1
for i = 1 to n do
factorial = factorial * i
print "Factorial:", factorial
75.Traversal in an Array:
 Traversal in an array means visiting each element in the array once. It
can be done using loops or recursion.
76.Strings:
 Strings are sequences of characters. In programming, they are often
used to represent text.
77.Syntax to declare a two-dimensional array:
 In C++, the syntax is data_type array_name[row_size]
[column_size];
78.Define an Array:
 An array is a data structure that stores a collection of elements of the
same type under a single name.
79.Write short notes of an Array of strings:
 An array of strings is a collection of strings arranged in a linear order within a
single variable. Each element of the array is a string, and they are accessed
using an index. This structure allows for the storage and manipulation of
multiple strings in a systematic way.
80.Define an array named Customers and initialize it with the waiting list
numbers. Develop pseudocode for reading and writing the elements into
the customer array:
Array Customers[6]
Customers = [64, 25, 69, 67, 80, 85]

// Pseudocode for reading elements:


for i from 0 to 5
read Customers[i]

// Pseudocode for writing elements:


for i from 0 to 5
write Customers[i]
90.Differentiate between a computer program and software:
 A computer program is a set of instructions written in a programming
language that is executed by a computer to perform a specific task. Software,
on the other hand, is a broader term encompassing programs, documentation,
and data associated with the operation of a computer system.
91.Explain how the evolution of computers has influenced a paradigm shift
in computer programming:
 The evolution of computers has led to shifts in programming paradigms due
to changes in hardware capabilities and the need for more efficient and
scalable software. For example, the transition from assembly language to
high-level languages, and from procedural to object-oriented and functional
programming, reflects these paradigm shifts.
92.List three examples of object-oriented programming languages:
 Examples of object-oriented programming languages include:
1. Java
2. C++
3. Python
93.Differentiate between procedural programming and functional
programming paradigms:
 Procedural programming focuses on procedures or routines that operate on
data, emphasizing step-by-step execution. Functional programming, in
contrast, treats computation as the evaluation of mathematical functions and
avoids changing state and mutable data.
94.Explain why knowledge of programming language characteristics can
benefit the whole computing community:
 Understanding programming language characteristics is essential for choosing
the right language for specific tasks, optimizing code, and ensuring efficient
program execution. It enhances collaboration and communication among
programmers and contributes to the development of robust and scalable
software.
95.Explain the importance of the following compiler utilities: (a) Pre-
processor. (b) Linker:
 (a) Pre-processor: The pre-processor handles tasks like macro expansion and
file inclusion before actual compilation. It helps in code modularization and
facilitates conditional compilation.
 (b) Linker: The linker combines object files and resolves symbolic references,
producing an executable program. It links various parts of the code, including
libraries, ensuring a coherent and functional final executable.
96. Study the sample C++ code below and identify possible syntax errors:

#include<iostreams>
using namespace std;
{
cout >> “Rwanda is a Beautiful Country”;
return 0;
}.
ANS;
Syntax errors:
 <iostreams> should be <iostream>.
 >> should be << for the cout statement.

97.Write a C++ program that allows the user to enter marks for three
subjects. The program should calculate, then display the total and mean
score of the three subjects;
#include<iostream>
using namespace std;

int main() {
int subject1, subject2, subject3;

cout << "Enter marks for subject 1: ";


cin >> subject1;
cout << "Enter marks for subject 2: ";
cin >> subject2;
cout << "Enter marks for subject 3: ";
cin >> subject3;

int total = subject1 + subject2 + subject3;


float mean = total / 3.0;

cout << "Total marks: " << total << endl;


cout << "Mean score: " << mean << endl;

return 0;
}
98.Write a C++ program to check whether a character is Vowel or
Consonant:
#include<iostream>
using namespace std;

int main() {
char ch;

cout << "Enter a character: ";


cin >> ch;

if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u' ||


ch == 'A' || ch == 'E' || ch == 'I' || ch == 'O' || ch == 'U') {
cout << ch << " is a Vowel." << endl;
} else {
cout << ch << " is a Consonant." << endl;
}

return 0;
}
99.Write a C++ program to find the sum of positive numbers. If the user
enters a negative number, the loop ends. The negative number entered is
not added to the sum:
#include<iostream>
using namespace std;

int main() {
int num, sum = 0;

do {
cout << "Enter a number (enter a negative number to end): ";
cin >> num;

if (num >= 0) {
sum += num;
}
} while (num >= 0);

cout << "Sum of positive numbers: " << sum << endl;

return 0;
}
100. What is meant by a token? Name the token available in C++:
 A token is the smallest unit in a program that holds meaning. In C++, tokens
include keywords, identifiers, constants, string literals, operators, and
punctuation symbols.
101. What are keywords? Can keywords be used as identifiers?
 Keywords are reserved words in a programming language that have a predefined
meaning and cannot be used as identifiers (names for variables, functions, etc.).
Examples in C++ include "int," "if," and "while."
102. The following constants are of which type? - (i) 39: Integer - (ii) 032: Octal Integer
- (iii) 0XCAFE: Hexadecimal Integer - (iv) 04.14: Floating-point
103. Write the following real constants into the exponent form: - (i) 23.197:
2.3197e+001 - (ii) 7.214: 7.214e+000 - (iii) 0.00005: 5.0e-005 - (iv) 0.319: 3.19e-001
104. Describe the differences between keywords and identifiers? - Keywords are
reserved words with predefined meanings in a programming language, while identifiers
are names given to variables, functions, etc. Identifiers must follow certain rules but can't
be the same as keywords.
105. Is C++ case sensitive? What is meant by the term “case sensitive”? - Yes, C++ is
case-sensitive. "Case sensitive" means that the language distinguishes between
uppercase and lowercase letters. For example, "Variable" and "variable" are considered
different in a case-sensitive language.
106. What is the difference between “Run time error” and “Syntax error”? - Syntax
errors occur during the compilation of the program and indicate a violation of the
language's rules. Runtime errors occur during the execution of the program when a
statement is encountered that the computer cannot execute.
107. What are the differences between “Logical error” and “Syntax error”? - A logical
error is a mistake in the program's design, leading to incorrect results. Syntax errors, on
the other hand, are mistakes in the code's structure, violating the language's rules.
108. Write about Binary operators used in C++. - Binary operators operate on two
operands. Examples in C++ include arithmetic operators (+, -, *, /), relational operators
(==, !=, <, >), and logical operators (&&, ||).
109. What are the types of Errors? - Errors in programming can be categorized into
three main types: Syntax errors, Runtime errors, and Logical errors.
110. What is the use of setw() format manipulator? - setw() is used to set the
width of the field in the output. It's part of the <iomanip> library in C++.
111. Suppose x and y are two double-type variables that you want to add as integers
and assign to an integer variable. Construct a C++ statement for doing so. - int
result = static_cast<int>(x + y);
112. Write C++ programs to interchange the values of two variables. - a. Using a third
variable:
#include<iostream>
using namespace std;
int main() {
int a, b, temp;
// Input values of a and b
cout << "Enter values of a and b: ";
cin >> a >> b;
// Interchange values using a third variable
temp = a;
a = b;
b = temp;
// Output the swapped values
cout << "After swapping: a = " << a << ", b = " << b << endl;
return 0;
}

113. What is a null statement and compound statement? - A null statement is an empty
statement denoted by a semicolon (;). It represents no operation. A compound
statement is a block of statements enclosed in curly braces {}.

114. Selection Statement: A selection statement in programming is used to make


decisions based on a condition. It allows the program to execute different statements
depending on whether a specific condition is true or false. In C++, there are two types
of selection statements: if-else and switch.
115. Convert if-else to a Single Conditional Statement:

a = (x >= 10) ? (m + 5) : m;

116. C++ Program to Print Multiplication Table:


#include <iostream>
using namespace std;

int main() {
int num;
cout << "Enter a number: ";
cin >> num;

for (int i = 1; i <= 10; ++i) {


cout << num << " * " << i << " = " << num * i << endl;
}

return 0;
}
117. C++ Program for Arithmetic Operation:
#include <iostream>
using namespace std;

int main() {
double num1, num2;
char op;

cout << "Enter two numbers: ";


cin >> num1 >> num2;
cout << "Enter an operator (+, -, *, /): ";
cin >> op;

switch (op) {
case '+':
cout << "Result: " << num1 + num2;
break;
case '-':
cout << "Result: " << num1 - num2;
break;
case '*':
cout << "Result: " << num1 * num2;
break;
case '/':
if (num2 != 0)
cout << "Result: " << num1 / num2;
else
cout << "Cannot divide by zero!";
break;
default:
cout << "Invalid operator!";
}

return 0;
}
118. Functions: Functions are blocks of code that perform a specific task and can be
called from other parts of the program. They help in modularizing the code and
promoting code reusability.
119. Importance of Void Data Type: The void data type is used to indicate that a
function does not return any value. It is important when a function is designed to
perform a task without producing a result.
120. Built-in Functions: Built-in functions are functions that are provided by the
programming language or its standard libraries. They perform common operations and
are available for use without the need for additional code.
121. Array Declaration vs. Initialization:
 Array Declaration: Informs the compiler about the array's size and data type.
 Array Initialization: Assigns initial values to the array elements.
122. C++ Program for Sum and Average of 1D Array:
#include <iostream>
using namespace std;

int main() {
const int size = 5;
int arr[size] = {5, 10, 15, 20, 25};

int sum = 0;
for (int i = 0; i < size; ++i) {
sum += arr[i];
}

cout << "Sum: " << sum << endl;


cout << "Average: " << static_cast<double>(sum) / size << endl;

return 0;
}
123. C++ Program for Largest and Smallest Element in Array:
#include <iostream>
using namespace std;

int main() {
const int size = 5;
int arr[size] = {15, 8, 22, 10, 17};

int largest = arr[0], smallest = arr[0];

for (int i = 1; i < size; ++i) {


if (arr[i] > largest) {
largest = arr[i];
} else if (arr[i] < smallest) {
smallest = arr[i];
}
}

cout << "Largest: " << largest << endl;


cout << "Smallest: " << smallest << endl;

return 0;
}
124. C++ Program to Swap First and Last Element:
#include <iostream>
using namespace std;

int main() {
const int size = 4;
int arr[size] = {10, 20, 30, 40};

// Swap
int temp = arr[0];
arr[0] = arr[size - 1];
arr[size - 1] = temp;

// Display the swapped array


for (int i = 0; i < size; ++i) {
cout << arr[i] << " ";
}

return 0;
}
125. Output of Program: The output is 30.
126. Output of Program: The output is C. AB.
127. Operating System: The correct answer is C) System Software.
128. Usage of Operating Systems: The correct answer is D) All the above.
129. Security Management Features in OS: Security features include user
authentication, access control, encryption, and auditing to protect data and system
resources.
130. Multi-Processing: Multi-processing is the concurrent execution of two or more
processes.
131. Different Operating Systems: Examples include Windows, macOS, Linux, and
Unix.
132. Mobile Operating Systems: Examples include Android, iOS, and HarmonyOS.

136. Various Formatting Tags in HTML: HTML provides a variety of formatting tags
to structure and style content. Some common formatting tags include:
 <b>: Bold text
 <i>: Italic text
 <u>: Underlined text
 <strong>: Strong importance, often rendered as bold
 <em>: Emphasized text, often rendered as italic
 <sub>: Subscript text
 <sup>: Superscript text
 <ins>: Inserted text (used in conjunction with <del> for highlighting changes)
137. Comments in HTML:
 Comments in HTML are used to add notes or remarks that are not displayed on the
webpage.
 Comment tags: <!-- Your comment here -->.
 Comments help developers understand the code, and they are ignored by browsers
when rendering the page.
138. Container Elements vs. Empty Elements:
 Container Elements: These are HTML elements that can contain content and other
HTML elements. Examples include <div>, <p>, <ul>, and <table>.
 Empty Elements: These are elements that do not have content or closing tags. They are
self-closing. Examples include <img>, <br>, and <input>.
 The syntax for an empty element is usually <tagname> or <tagname />.
139. HTML Code for Displaying a Page:
<!DOCTYPE html>
<html>
<head>
<title>Sample Page</title>
</head>
<body>
<h1>Welcome to My Page</h1>
<p>This is a sample page.</p>
<!-- Add more content as needed -->
</body>
</html>
140. Three Main Ways to Apply CSS Styles to a Web Page:
 Inline Styles:
<p style="color: blue; font-size: 16px;">This is a paragraph with inline styles.</p>
 Internal Styles (within the <style> tag in the <head> section):
<head>
<style>
p{
color: green;
font-size: 18px;
}
</style>
</head>
 External Styles (using an external CSS file):
<head>
<link rel="stylesheet" type="text/css" href="styles.css">
</head>
In the "styles.css" file:

p{

color: red;

font-size: 20px;

142. Advantages of Cascading Style Sheets (CSS):


 Consistency: CSS allows for consistent styling across multiple pages of a website.
Changes made to the style in one place affect the entire site, ensuring a uniform look
and feel.
 Separation of Concerns: CSS separates the structure (HTML) from the presentation
(styling). This enhances maintainability and allows developers to focus on specific
aspects without affecting others.
 Reusability: Styles defined in CSS can be reused across different elements and pages.
This promotes code reusability and reduces redundancy.
 Easy Maintenance: Centralized styles make it easier to update the appearance of a
website. Modifications to the styling can be applied globally by changing the CSS rules.
 Bandwidth Efficiency: External style sheets can be cached by browsers, reducing the
amount of data transferred between the server and client on subsequent visits. This
enhances performance and saves bandwidth.
143. Data Structures for Characteristics:
 a) Singly Linked List: Each element contains the location of the next element in the
sequence.
 b) Queue: Data can only be inserted at the Rear and removed from the Front.
 c) Stack: Both Insertion and Deletion are made at the Top.
 d) Array: Stores data of the same type and size.
 e) Linked List: Data is sequentially organized, and for N number of data, we have N-1
number of links to join data.

145. Algorithm to Display Factorial Numbers:


Algorithm: DisplayFactorials

Input: A non-negative integer n

Output: Display factorials from 0 to n

1. Initialize variables i, factorial, and n.


2. Read the value of n.
3. Set i = 0.
4. Repeat steps 5-8 while i <= n:
5. Set factorial = 1.
6. Initialize variable j = 1.
7. Repeat steps 8-9 while j <= i:
8. Set factorial = factorial * j.
9. Increment j.
10. Display "Factorial of", i, "is", factorial.
11. Increment i.
12. End.
146. Difference between One-Dimensional Array and Two-Dimensional Array:
 One-Dimensional Array:
 Represents a collection of elements of the same data type arranged in a linear
sequence.
 Accessed using a single index or subscript.
 Example: int arr[5];
 Two-Dimensional Array:
 Represents a table of elements organized in rows and columns.
 Accessed using two indices or subscripts (row index and column index).
 Example: int matrix[3][3];
147. Selection Sort:
 Definition: Selection sort is a simple sorting algorithm that repeatedly selects the
smallest (or largest) element from the unsorted portion of the array and swaps it with
the first unsorted element.
 Algorithm:
1. Find the minimum element in the unsorted array.
2. Swap the found minimum element with the first element.
3. Move the boundary between the sorted and unsorted subarrays.
148. Two Approaches to Searching using Complex Data Structure:
 Binary Search Tree (BST): Involves constructing a binary search tree and searching for
the element based on the binary search tree properties.
 Hashing: Involves using a hash function to map keys to locations, providing a direct
method to locate the desired element.
149. Flowchart to Solve Quadratic Equation:
 The flowchart involves steps to input the coefficients of the quadratic equation, calculate
the discriminant, and then determine and display the roots based on the discriminant.
150. Factors to Consider Before Choosing Network Topology:
 Scalability
 Reliability
 Cost
 Performance
 Flexibility
151. Difference between Access Point and Hub:
 Access Point (AP): Connects wireless devices to a wired network using Wi-Fi. Acts as a
bridge between wireless and wired networks.
 Hub: Connects multiple devices in a LAN, but operates at the physical layer and simply
broadcasts data to all connected devices.
152. Client-Server Network Diagram:
 Components: Client, Server, Network (connecting them).
 Role: Clients request services or resources, and servers provide those services or
resources.
153. Guided and Unguided Media:
 Guided Media: Physical transmission media that guide the data signals along a specific
path (e.g., coaxial cable, fiber optic cable).
 Unguided Media: Transmission media that do not guide the signals along a specific
path and use methods like broadcasting (e.g., radio waves, microwave).
154. Bandwidth:
 Definition: The maximum rate of data transfer across a network or communication
channel.
 Example: A network with a bandwidth of 100 Mbps can transmit data at a maximum rate
of 100 megabits per second.
155. Characteristics of WAN:
 Covers a large geographical area.
 Involves multiple LANs connected over long distances.
 Relies on public and private data networks.
 Utilizes various communication technologies.
 Supports a wide range of data transfer rates.
156. Appropriate Cable for Device Connections:
 a. PC to PC: Crossover Cable
 b. Router to Router: Crossover Cable
 c. Switch to Router: Straight-Through Cable
 d. PC to Hub or PC to Switch: Straight-Through Cable
157. Contrast STP over UTP:
 STP (Shielded Twisted Pair):
 Has additional shielding to reduce electromagnetic interference.
 Provides better protection against external signals.
 UTP (Unshielded Twisted Pair):
 Lacks additional shielding.
 More susceptible to external interference.
 Commonly used in networking due to cost-effectiveness.

159. Investigating Slowness in Website Loading:


 Possible Reasons:
 Network Issues: Check for network congestion or connectivity
problems.
 Server Load: The web server hosting the site might be experiencing
high traffic.
 Large Page Elements: Heavy images or complex scripts can slow down
loading.
 Browser Issues: Clear browser cache, check for browser extensions, or
try a different browser.
 Website Design: Inefficient coding or too many external resources can
impact performance.
160. Popularity of Relational Database Model:
 Justification:
 Data Integrity: Ensures accuracy and consistency of data through
relationships.
 Structured Query Language (SQL): Standardized language for
managing and querying relational databases.
 Normalization: Reduces data redundancy and improves efficiency.
 ACID Properties: Ensures reliable and secure transactions.
 Maturity and Support: Relational databases have been widely adopted
and are well-supported.
161. Improving Shop Management with a Database: i. Improvements for
Mr. Mugabo:
 Implement a database system for recording sales, debts, and products.
 Use software that facilitates easy calculations and reporting. ii. Database
Approaches Replacing Manual System:
 Relational Database: Organizes data into structured tables with
relationships.
 Database Management System (DBMS): Software for efficient
database management. iii. Replacement of Useless Hard Copy Files:
 Use the database for storage, reducing the need for manual paper
records.
162. Explanation of Database Benefits: a. Control Data Redundancy:
 Avoids duplication of data by organizing it in a structured manner. b.
Data Consistency:
 Ensures uniformity and accuracy of data across the database. c. Data
Recovery After Breakdown:
 Enables the recovery of data in case of system failures through backups.
163. Comparison: Computerized vs Non-Computerized Database:
 Computerized Database:
 Faster access to information.
 Reduced data redundancy.
 Improved data accuracy.
 Enhanced security measures.
 Easier data manipulation and reporting.
 Non-Computerized Database:
 Slower retrieval of information.
 Higher risk of data redundancy.
 Prone to human errors.
 Limited security features.
 Manual effort for data manipulation and reporting.
164. Planning a Digital Database for Groupe Scolaire Nderonziza:
 Identify data requirements (student information, transcripts).
 Design a relational database schema with tables for students, courses, grades,
etc.
 Implement relationships between tables.
 Choose a suitable Database Management System (DBMS).
 Develop a user-friendly interface for data entry and retrieval.
165. Complexity of the Given Database Structure:
 Anomalies:
 Update Anomaly: Changes to one item's details may require multiple
updates.
 Insertion Anomaly: Inability to insert a new item without complete
customer details.
 Deletion Anomaly: Deleting an item may lead to loss of customer
details.
 Solution:
 Normalize the database by creating separate tables for customers,
orders, and items.
166. Database with Eight Fields and 100 Records: a. Entities:
 Each record represents a single entity (e.g., a customer). b. Attributes:
 Eight fields represent eight attributes for each entity. c. Individual
Pieces of Data:
 8 fields x 100 records = 800 individual pieces of data.
168,Entities:

 Employee:
 Attributes: EmployeeID (Primary Key), FirstName, LastName, DateOfBirth, Gender,
Position, DepartmentID (Foreign Key), HireDate, Salary, etc.
 Department:
 Attributes: DepartmentID (Primary Key), DepartmentName, Location, etc.

Relationships:

 WorksIn:
 Connects Employee to Department using DepartmentID as a Foreign Key in the
Employee entity.

Entity-Relationship Diagram (ERD):

+---------------------+ +---------------------+

| Employee | | Department |

+---------------------+ +---------------------+

| EmployeeID (PK) | | DepartmentID (PK) |

| FirstName |1 | DepartmentName |

| LastName |---------| Location |

| DateOfBirth | +---------------------+

| Gender |

| Position | +---------------------+

| DepartmentID (FK) |<--------| WorksIn |

| HireDate | +---------------------+

| Salary |

+---------------------+
 EmployeeID serves as the primary key for the Employee entity.
 DepartmentID acts as a foreign key in the Employee entity, establishing a relationship
with the Department entity.
 The WorksIn relationship connects the Employee and Department entities, indicating
that an employee works in a specific department.

169. A database of an employee is identified by EmpId, FirstName, Surname, Address


and Birthdate while a project is identified by its ProjectId and ProjectName. Draw the
diagram representing the Entity Relationship
Certainly! Below is an Entity-Relationship Diagram (ERD) representing the relationship
between an employee and a project based on the given information:

Entities:

 Employee:
 Attributes: EmpId (Primary Key), FirstName, Surname, Address, Birthdate
 Project:
 Attributes: ProjectId (Primary Key), ProjectName

Relationship:

 WorksOn:
 Connects Employee to Project indicating that an employee works on a project.
 Attributes: Role (e.g., project manager, developer, etc.)

Entity-Relationship Diagram (ERD):

+---------------------+ +---------------------+

| Employee | | Project |

+---------------------+ +---------------------+

| EmpId (PK) | | ProjectId (PK) |

| FirstName |1 | ProjectName |

| Surname |---------| |
| Address | +---------------------+

| Birthdate |

+---------------------+

| WorksOn

+-------------------------+

| WorksOn |

+-------------------------+

| EmpId (FK) |

| ProjectId (FK) |

| Role |

| |

+-------------------------

EmpId and ProjectId are primary keys for the Employee and Project entities,
respectively.

 The WorksOn relationship represents the association between employees and projects.
 Role is an attribute of the relationship, indicating the role an employee plays in a
particular project.
This ERD illustrates that an employee can work on multiple projects, and a project can
involve multiple employees, capturing the relationship between employees and projects
in a database.

172. Differentiate RDB and RDBMS:


 RDB (Relational Database): It represents a database based on the relational model,
consisting of tables with rows and columns.
 RDBMS (Relational Database Management System): It is software that manages
relational databases, providing functionalities like data retrieval, insertion, deletion, and
updating.
173. Define quaternary relationships:
 Quaternary relationships involve four entities connected by a relationship. They are less
common and more complex than binary or ternary relationships.
174. Differentiate entity and relationship:
 Entity: It is a real-world object represented by data. It can be a person, place, event, or
concept.
 Relationship: It describes the association between entities, illustrating how they are
connected or interact.

175. University Database ER Diagram:


 Entities:
 Professor (Attributes: SSN, Name, Age, Rank, Research Specialty)
 Project (Attributes: Project Number, Sponsor Name, Starting Date, Ending Date,
Budget)
 Graduate Student (Attributes: SSN, Name, Age, Degree Program)
 Department (Attributes: Department Number, Department Name, Main Office)
 Relationships:
 WorksOn (between Professor and Project)
 Manages (between Professor and Project)
 CoInvestigators (between Project and Professor)
 ResearchAssistants (between Project and Graduate Student)
 Supervises (between Professor and Graduate Student)
 Advises (between Graduate Student and more senior Graduate Student)
 Runs (between Department and Professor)
 WorksIn (between Professor and Department)
 Key and Participation Constraints:
 Professor SSN is a key.
 Project Number is a key.
 Graduate Student SSN is a key.
 Department Number is a key.
 Participation constraints are indicated by lines connecting entities in
relationships.
176. Difference between Internet, Intranet, and Extranet:
 Internet: Publicly accessible global network.
 Intranet: Private network within an organization for internal communication.
 Extranet: Extension of an intranet, allowing limited external access for specific purposes.
177. Full forms:
 a) LED: Light Emitting Diode
 b) RJ-45: Registered Jack-45
 c) Wi-Fi: Wireless Fidelity
 d) BNC: Bayonet Neill-Concelman
 e) UTP: Unshielded Twisted Pair
178. Define an ISP and three ISPs operating in Rwanda:
 ISP (Internet Service Provider): A company providing internet access.
 ISPs in Rwanda: Liquid Telecom, MTN Rwanda, Tigo Rwanda.
179. Common ports on a laptop:
 USB ports, HDMI port, Ethernet port, Audio Jack, SD Card slot, Thunderbolt port.
180. Considerations for choosing computer cleaning materials and products:
 Compatibility, anti-static, lint-free, alcohol-free, recommended by manufacturer.
181. Procedures for laptop care:
 Keep clean, use surge protectors, avoid liquid exposure, update software, handle with
care.
182. Areas where mobile employees can maximize devices:
 Field data collection, virtual meetings, project management, document access, customer
relationship management.
183. Potentially hazardous conditions for a laptop:
 Overheating, liquid exposure, physical shocks, malware attacks, poor ventilation.
184. What is a queue? Two main components:
 A queue is a data structure following FIFO. Components: Front (head) and Rear (tail).
185. C++ Program for Fibonacci series:
 See previous response for the code.
186. Operations of data structures:
 Insertion, deletion, traversal, searching, sorting.
187. Binary search operation:
 Algorithm to find the position of a target value in a sorted array.
188. Algorithm for binary search:
 Pseudocode provided in the previous response.
189. Binary tree and array representation for given data:
 The tree structure and representations depend on the pivot choice and are not
provided.
190. Compute F(3), F(4), F(5) for Fibonacci series:
 See previous response for the computations.
191. Differences between Searching and Sorting in an array:
 Searching is finding a specific element, sorting is arranging elements.
192. Syntax to print two-dimensional array elements in C++:
 See previous response for the syntax.
193. Comparison between linear search and binary search:
 See previous response for the comparison.
194. Bubble sort algorithm:
 See previous response for the explanation.
195. Properties of Computer Network:
 Scalability, reliability, speed, security, flexibility.
196. Unit of bandwidth in a network:
 Hertz (Hz).
197. Full forms:
 a. b/s: Bits per Second
 b. NT: Windows NT (New Technology)
 c. VPN: Virtual Private Network
 d. DNS: Domain Name System
 e. IoT: Internet of Things
198. Example of IP address:
 a. Class A: 10.0.0.1
 b. Class B: 172.16.0.1
 c. Class C: 192.168.0.1
199. Bluetooth and devices:
 Bluetooth is a wireless technology for connecting devices.
 Devices: Headphones, smartphones, laptops.

200. Distinguish between network and internet with a clear example:


 Network: It is a collection of interconnected devices for sharing resources.
 Internet: It is a global network that connects networks worldwide, providing access to
information and services on a larger scale.

201. Half-Duplex vs. Full-Duplex:


 Half-Duplex: Communication can occur in both directions, but not simultaneously. It is
like a two-way radio where only one party can speak at a time.
 Full-Duplex: Communication can occur in both directions simultaneously. It is like a
telephone conversation where both parties can speak and listen at the same time.
202. Infrared TV Remote Control:
 Infrared signals used in TV remote controls are specific to each device, using unique
codes. These codes are designed not to interfere with other nearby devices, ensuring
that signals from one remote control do not affect the operation of another.
203. Roles of Network Administrator:
 a) Network Planning and Design
 b) Network Installation and Configuration
 c) Security Management
 d) Troubleshooting and Maintenance
 e) User Support and Training
204. Moving NIC Cards and MAC Address:
 No, the MAC address is tied to the network interface card (NIC) and is not transferred
when moving the NIC card to another PC. The MAC address is a hardware-specific
identifier.
205. Why a Switch Cannot Broadcast to All Devices:
 A switch operates at the data link layer (Layer 2) of the OSI model and uses MAC
addresses to forward frames to specific devices. Unlike a hub, a switch does not
broadcast data to all devices; instead, it selectively forwards data only to the device for
which it is intended.
206. Difference Between Straight Through Cable and Crossover Cable:
 Straight Through Cable: Used to connect different types of devices, e.g., computer to
switch. Both ends have the same wiring configuration.
 Crossover Cable: Used to connect similar devices, e.g., computer to computer. The
wiring at one end is reversed, allowing the transmit and receive signals to cross over.
207. IP Address (192.168.2.143/22):
 a. Class: Class C
 b. Network ID: 192.168.2.0, Host ID: 143
 c. Subnet Mask: 255.255.252.0 (22 bits for the network)
 d. Bits Reserved for Network: 22
 e. Hosts: 2^(32-22) - 2 = 1022 hosts
208. Detriment of Using Computer Network Within School:
 Possible issues include security risks, unauthorized access, network congestion, and
dependence on technology.
209. Effect of Disconnection of Shared Resource from Network:
 Users may lose access to shared data, leading to disruptions in collaboration and
workflow.
210. Technologies for Remote Access to Organization's Data:
 Virtual Private Network (VPN), Cloud Services, Remote Desktop Services (RDS), and
Secure File Transfer Protocols.
211. Steps to Locate MAC Address:
 a. For Windows: Open Command Prompt, type "ipconfig/all," and find the Physical
Address.
 b. For Mac: Go to System Preferences, Network, select the network interface, and click
"Advanced" to find the MAC address.
212. Topology for Connecting Computers and Printer:
 Topology: Star Topology
 Explanation: In a star topology, all computers are connected to a central
hub or switch, and the printer is also connected to the central hub. This
central hub manages the communication between all the computers and
the printer. It provides a centralized and efficient way to connect
devices.
213. Relational Database Model:
 Explanation: The relational database model is a database model based on the
principles of set theory and mathematical relations. It organizes data into
tables (relations) with rows and columns, where each row represents a record
and each column represents an attribute. Relationships between tables are
established using keys.
214. Roles of Database:
a.Database Administrator
b. Database Designer
c. Data Analyst
d. Data Architect
e. Database Developer
f. Data Entry Clerk
g. Data Modeler
h. Database Security Administrator
i. Database Tester
j. Database Performance Analyst

215.Database Models:

1. Hierarchical Model: Represents data in a tree-like structure.

2. Network Model: Represents data as a graph with nodes and edges.

3. Relational Model: Represents data in tables with rows and columns.
216. Areas Where Database is Used:
.Business and Finance
.Healthcare
.Education
.Government
.E-commerce
.Social Media
.Telecommunications
.Manufacturing
.Research
.Human Resources
217. Data Duplication:
 Definition: Data duplication refers to the presence of redundant or repeated
data in a database.
218. Reasons for Data Duplication:
219. Lack of Normalization
220. Inconsistent Data Entry
221. Data Migration
222. Denormalized Data Storage
223. Database Administrator vs. Database Designer:
 Similarities:
 Both roles involve working with databases.
 Both roles require knowledge of database design principles.
 Differences:
 Database Administrator manages and maintains databases, focusing on
performance and security.
 Database Designer designs the structure of databases, focusing on
efficient data organization.
220. Conceptual Level:
 Definition: The conceptual level is the highest level of abstraction in a
database system. It represents the overall structure and organization of data
without specifying implementation details.
221. Tuple vs. Attribute:
 Tuple: A row in a relational table representing a record.
 Attribute: A column in a relational table representing a data element.
222. Relation in a Database:
 Definition: A relation is a table in a relational database. It consists of rows and
columns where each row represents a record, and each column represents an
attribute.
223. Database Normalization:
 Definition: Database normalization is the process of organizing data in a
database to reduce redundancy and improve data integrity. It involves
dividing large tables into smaller, related tables.
224. Benefits and Limitations of Relational DBMS:
 Benefits:
 Data Integrity
 Data Consistency
 Query Flexibility
 Limitations:
 Performance Degradation with Large Databases
 Complexity in Managing Relationships
225. Benefits of Database Design Steps:

1. Reduced Data Redundancy

2. Improved Data Integrity

3. Enhanced Query Performance

4. Better Data Consistency
226. Symbols Used in Entity Relationship Diagram (ERD):

1. Rectangle: Entity

2. Diamond: Relationship

3. Oval: Attribute

4. Double Oval: Multivalued Attribute

5. Line: Relationship Connection
227. Composite vs. Multivalued Attribute:
 Composite Attribute: An attribute composed of multiple sub-attributes.
 Multivalued Attribute: An attribute that can have multiple values for a single
entity.
228. Primary Key:
 Definition: A primary key is a unique identifier for a record in a database table.
 Example: EmployeeID in an Employee table.
229. Ternary vs. Binary Relationships:
 Ternary Relationship: Involves three entities.
 Binary Relationship: Involves two entities.
230. Many-to-One Relationship:
 Definition: Many instances of one entity are related to one instance of another
entity.
 Example: Many employees work in one department.
231. Weak Entity:
 Definition: An entity that depends on another entity for its existence and does
not have a primary key attribute.
 Example: "Address" entity dependent on "Person" entity.
232. Ways to Avoid Redundancy in a Database:
a. Normalize Tables
b .Use Foreign Keys
c. Use Unique Constraints
d. Denormalize Selectively
233. Referential Integrity:
 Definition: Ensures that relationships between tables remain consistent.
Foreign key values must match primary key values.
234. Abbreviations:
 a. RDBMS: Relational Database Management System
 b. TFP: Thin Film Transistor
 c. ERD: Entity Relationship Diagram
 d. SQL: Structured Query Language
 e. 3NF: Third Normal Form
235. Purpose of Devices in WLAN:
 a) Access Point: Connects wireless devices to a wired network.
 b) Switch: Connects multiple devices within a local network, enabling communication.
 c) Router: Manages data traffic between different networks, ensuring proper routing.
236. Peer-to-Peer vs. Client-Server Network:
 Peer-to-Peer: Each device can act as both a client and a server. Suitable for small
networks.
 Client-Server: Centralized server provides resources, and clients request and use those
resources. Suitable for larger networks.
237. Bounded vs. Unbounded Media:
 Bounded (Guided) Media Examples:
 Twisted Pair Cable
 Coaxial Cable
 Fiber Optic Cable
 Unbounded (Unguided) Media Examples:
 Wireless Signals (e.g., Wi-Fi)
 Infrared Signals
 Radio Waves
238. Advantages of Fiber Optic over Twisted Pair Cables:
 Higher Bandwidth
 Greater Data Transmission Distance
 Immunity to Electromagnetic Interference
 Lighter and Thinner
239. Two Dimensional Array:
 Declaration Syntax: datatype arrayName[row_size][column_size];
240. DBMS (Database Management System):
 Software for managing databases.
 Examples: MySQL, Oracle, Microsoft SQL Server, PostgreSQL.
241. Switch Statement Code Rewrite:
switch(k) {
case 1: Day = "Monday"; break;
case 2: Day = "Tuesday"; break;
case 3: Day = "Wednesday"; break;
default: Day = "-";
}
242. While Loop Code Rewrite and Output:
int i = 1, j = 0;
while (i <= 6) {
cout << i++ << "\t";
i++;
j += 2;
}
cout << "\n finished";

Output: 1 3 5 finished

243. Four Roles of CPU:


 Fetch: Retrieve instructions from memory.
 Decode: Interpret the instructions.
 Execute: Perform the operation.
 Write: Store results back in memory.
244. Topology for Connecting Computers and Printer:
 Topology: Star Topology
 Centralized connection through a hub or switch.
245. Advantages of Computer Network:
 Resource Sharing
 Communication
 Cost Efficiency
 Centralized Data Management
246. Algorithm for Squaring a Number:
Input: Number
Output: Square of the Number

1. Read the number from the user.


2. Square = Number * Number.
3. Display the square.
247. Differentiation:
 a) Cardinality vs. Degree: Cardinality is the number of instances, while degree is the
number of attributes.
 b) Primary Key vs. Foreign Key: Primary key uniquely identifies a record in a table,
while a foreign key links a record to a key in another table.
248. Function:
 a) Function: A named block of code designed to perform a specific task.
 b) Syntax:
return_type function_name(parameters) {
// Function body
}
249. CLI vs. GUI:
 CLI (Command Line Interface) uses text commands, while GUI (Graphical User Interface)
uses graphical elements.
250. AND Gate Truth Table:
 Four possible combinations (2 inputs): 0 AND 0 = 0, 0 AND 1 = 0, 1 AND 0 = 0, 1 AND 1
= 1.
251. HTML Code for Weekly Days:
<ul>
<li>Saturday</li>
<li>Sunday</li>
<li>Monday</li>
<li>Tuesday</li>
<li>Wednesday</li>
<li>Thursday</li>
<li>Friday</li>
</ul>
252. C++ Program for Average Marks:

#include <iostream>
#include <algorithm> // Required for sorting array elements

int main() {
const int numStudents = 5;
int marks[numStudents];
std::cout << "Enter marks for " << numStudents << " students:\n";
for (int i = 0; i < numStudents; ++i) {
std::cout << "Enter marks for student " << i + 1 << ": ";
std::cin >> marks[i];
}

// Calculate average marks


int sum = 0;
for (int i = 0; i < numStudents; ++i) {
sum += marks[i];
}
double average = static_cast<double>(sum) / numStudents;

// Display average marks


std::cout << "Average marks: " << average << std::endl;

// Display array elements in descending order


std::sort(marks, marks + numStudents, std::greater<int>());

std::cout << "Array elements in descending order:\n";


for (int i = 0; i < numStudents; ++i) {
std::cout << "Student " << i + 1 << ": " << marks[i] << std::endl;
}

return 0;
}
253. C++ Program for Swapping Numbers:

#include <iostream>
void swapNumbers(int &a, int &b) {
int temp = a;
a = b;
b = temp;
}

int main() {
int num1, num2;
std::cout << "Enter the first number: ";
std::cin >> num1;
std::cout << "Enter the second number: ";
std::cin >> num2;
std::cout << "Original numbers: " << "Num1 = " << num1 << ", Num2 = " <<
num2 << std::endl;
swapNumbers(num1, num2);
std::cout << "Swapped numbers: " << "Num1 = " << num1 << ", Num2 = " <<
num2 << std::endl;

return 0;
}
254. Major Types of Software:
 System Software (e.g., Operating System)
 Application Software (e.g., Word Processors, Web Browsers)
255. Tree Traversal and Path:
 a) Order: In-order, Pre-order, Post-order
 b) Path between 50 and 86: Not specified (needs tree structure).
256. C++ Program for Palindrome Check:

#include <iostream>

bool isPalindrome(int num) {


int originalNum = num, reversedNum = 0, remainder;

while (num > 0) {


remainder = num % 10;
reversedNum = reversedNum * 10 + remainder;
num /= 10;
}

return originalNum == reversedNum;


}

int main() {
int number;

// Input
std::cout << "Enter a number: ";
std::cin >> number;

// Check if palindrome
if (isPalindrome(number)) {
std::cout << number << " is a palindrome." << std::endl;
} else {
std::cout << number << " is not a palindrome." << std::endl;
}

return 0;
}

257. Binary and Decimal Operations:

Adding in 2's complement:

Step 1: Represent 5 and 3 in 4-bit binary:

5 = 0101

3 = 0011

Step 2: Add the binary numbers:


0101 + 0011 -------- 1000

The result is 1000 in 4-bit binary, which is -8 in decimal using 2's complement.

b) Converting (1200.011)8 to decimal:

(1200.011)8 = 1 *8^3 + 2* 8^2 + 0 *8^1 + 0* 8^0 + 0 *8^-1 + 1* 8^-2 + 1 *8^-3 = 512 + 128 + 0 + 0 + 0 + 0.125 +
0.015625 = 640.140625

So, (1200.011)8 is equivalent to (640.140625)10 in decimal.

c) Subtracting (11110.1101)2 from (111111.1111)2:

111111.1111 - 11110.1101 ---------------- 111101.0010

The result is (111101.0010)2.

d) Converting (14AC)16 to decimal:

(14AC)16 = 1 *16^3 + 4* 16^2 + 10 *16^1 + 12* 16^0 = 4096 + 1024 + 160 + 12 = 5292

So, (14AC)16 is equivalent to (5292)10 in decimal.

e) Converting (123A)16 to decimal:

(123A)16 = 1 *16^3 + 2* 16^2 + 3 *16^1 + 10* 16^0 = 4096 + 512 + 48 + 10 = 4666

So, (123A)16 is equivalent to (4666)10 in decimal.

f) Converting (251.35)10 to binary:

Integer part:

251 / 2 = 125 remainder 1


125 / 2 = 62 remainder 1
62 / 2 = 31 remainder 0
31 / 2 = 15 remainder 1
15 / 2 = 7 remainder 1
7 / 2 = 3 remainder 1
3 / 2 = 1 remainder 1
1 / 2 = 0 remainder 1

Reading the remainders upward, the binary representation of the integer part is
11111011.

Fractional part:

0.35 * 2 = 0.7
0.7 * 2 = 1.4
0.4 * 2 = 0.8
0.8 * 2 = 1.6
0.6 * 2 = 1.2

Reading the whole numbers, the binary representation of the fractional part is .01011.

Combining both, the binary representation of (251.35)10 is 11111011.01011.

You might also like