BOLINGO H P Comp Science
BOLINGO H P Comp Science
BOLINGO H P Comp Science
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.
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.
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.
Answer:
Answer: Number systems provide a way to represent and manipulate numeric values. They are
fundamental to computer science, digital electronics, and mathematics.
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
Answer: Basic logic elements include logic gates such as AND, OR, NOT, NAND, NOR, and
XOR.
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.
Answer: Derived gates are logic gates that can be constructed using other basic gates. Examples
include XOR and XNOR gates.
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.
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:
40. How AND and OR can be realized using NAND and NOR gate.
Answer:
41. Explain the Derived gates with expression and truth table.
Answer:
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]
#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;
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;
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 {}.
a = (x >= 10) ? (m + 5) : m;
int main() {
int num;
cout << "Enter a number: ";
cin >> num;
return 0;
}
117. C++ Program for Arithmetic Operation:
#include <iostream>
using namespace std;
int main() {
double num1, num2;
char 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];
}
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};
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;
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;
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.
+---------------------+ +---------------------+
| Employee | | Department |
+---------------------+ +---------------------+
| FirstName |1 | DepartmentName |
| DateOfBirth | +---------------------+
| Gender |
| Position | +---------------------+
| 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.
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.)
+---------------------+ +---------------------+
| Employee | | Project |
+---------------------+ +---------------------+
| 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.
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
#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];
}
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>
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;
}
5 = 0101
3 = 0011
The result is 1000 in 4-bit binary, which is -8 in decimal using 2's complement.
(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
(14AC)16 = 1 *16^3 + 4* 16^2 + 10 *16^1 + 12* 16^0 = 4096 + 1024 + 160 + 12 = 5292
Integer part:
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.