WorksheetsNetworking and C++
Total questions: 80
Worksheet time: 50mins
Which is not a process state?
waiting
terminated
blocked
redirected
Which of the following is NOT a logical operator in C++ language?
&
&&
||
!
A function can have _____ inside the parenthesis
loops
Arguments/Parameters
Braces
Types
A function that has no return type starts with:
int
void
Arguments
Braces
A function that is not void needs to have a _____ _______
variable calculation
printing statement
Return statement
cout statement
Which of the following is a correct comment?
*/ Comments */
** Comment **
/* Comment */
{ Comment }
What does <= mean?
less than
greater than
less than or equal to
greater than or equal to
What will be the output of the following code?
int i = 0;
while (i < 3)
{
cout << "Number: " << i << endl;
i++;
}
Number: 1
Number: 2
Number: 3
Number: 0
Number: 1
Number: 2
Number: 0
Number: 1
Number: 2
Number: 3
None of the above
What will be the output of the following code using `switch case`?
char ch = 'b';
switch(ch)
{
case 'a': cout << "Apple";
case 'b': cout << "Banana";
case 'c': cout << "Cherry";
default: cout << "None";break;
}
Apple
Banana
Cherry
None
Banana
Cherry
None
Cherry
None
None
What is the output of this program with a `while` loop?
int num = 6;
while (num >= 1)
{
cout << num << " ";
--num ; }
6 5 4 3 2 1
1 2 3 4 5 6
6 5 4 3 2
Infinite loop
What will be the output of this C++ code using a `do while` loop?
int num = 1;
do
{
cout << num << " ";
num++;
} while (num <= 5);
1 2 3 4 5
1 2 3 4
0 1 2 3 4
None of the above
What is the value of this expression using integer arithmetic:
7 / 4
1
2
1.75
Determine the value of this expression using integer arithmetic:
5 % 7
0
2
5
Which code below is correct for a hyperlink
<a>
"https://google.com"
Click Me
</a>
<a>Click Me>
"https://google.com"
</a>
<a herf="https://google.com">
Click Me
</a>
<a href="https://google.com">
Click Me
</a>
You need a closing tag for an image without text
True
False
src attribute in an image tag means what?
Source of the image
Name of the image
Description of the image
Not used with image tag
Which list tag would you use for an ordered list
<h1></h1>
<ol></ol>
<ul></ul>
<a></a>
Which of the following contains a nested list
<ul>
<li>Apples</li>
<li>Cookies</li>
<li>Milk</li>
</ul>
<ul>
<li>Apples</li>
<li>
Cookies
<ul>
<li>Chocolate Chip</li>
<li>Peanut Butter</li>
</ul>
</li>
<li>Milk</li>
</ul>
<th></th> is the code for .....
a table row
a table column
a table header
Thanos
tr
one column on the right
one cell in a table
one row of anything
one column of anything
colspan
can only be used in caption
can be used only in td
can be used only in td or th
be be used only in tr
rowspan
can only be used in caption
can be used only in td
can be used only in td or th
be be used only in tr
The opening caption tag is
<table>
<caption>
<tblcaption>
<figcaption>
What does the HR tag create in HTML?
Highlight region
Header row
Hyperlink reference
Horizontal rule
What is inheritance in C++?
Inheritance in C++ is used to create new classes from existing classes
Inheritance in C++ is a feature that allows a class to access private members of another class
Inheritance in C++ allows a class to inherit properties and behaviors from another class.
Inheritance in C++ is a way to override the properties and behaviors of a class
What is the base class and derived class in C++?
Base class and derived class are concepts in object-oriented programming where the base class is the class being inherited from, and the derived class is the class that inherits from the base class.
Parent class and child class are concepts in C++
Super class and sub class are concepts in C++
Main class and sub class are concepts in C++
What are the advantages of using inheritance in C++?
Code reusability, polymorphism, and hierarchical relationship between classes
Decreased code organization
Limited code flexibility
Faster code execution
child class is called as
derived class
base class
access specifiers used in inheritance are
public
private
protected
none
Which of the following reduces the number of comparisons in a program ?
(A) Operator overloading
(B) Operations overloading
(C) Function Overloading
(D) Member overloading
Which of the following is invalid prototype for function overloading
(A) void fun (int x); void fun (char ch) ;
(B) void fun (int x); void fun (int y);
(C) void fun (double d); void fun (char ch);
(D) void fun (double d); void fun (int y);
A block of code that performs a ____ purpose is known as a function
Specific
General
function is executed when it is
defined
called
declared
prototyped
This type of variable is defined inside a function and is not accessible outside the function.
global
counter
local
reference
A _________ variable is declared outside all functions.
local
floating-point
counter
global
What is the return type of the function with prototype: "int func(char x, float v, double t);"?
char
int
double
float
A programming mechanism that binds together code and the data it manipulates, and that keeps both safe from outside interference and misuse.
Polymorphism
Inheritance
Encapsulation
Object-Oriented Programming
An _________ is an instance or of a copy of a class.
Class
Attribute
Object
What is inheritance in C++?
Inheritance in C++ is used to create new classes from existing classes
Inheritance in C++ is a feature that allows a class to access private members of another class
Inheritance in C++ allows a class to inherit properties and behaviors from another class.
Inheritance in C++ is a way to override the properties and behaviors of a class
What is an example of Polymorphism in Method Overloading?
Having multiple methods with the same name but different implementations.
Having multiple methods with different names and different implementations.
Having a single method with multiple implementations.
Having a single method with the same name and the same implementation.
In the provided example of Method Overloading, what does the override keyword do?
It restricts access to the method.
It provides a new implementation for a method that is already defined in the parent class.
It overrides the polymorphic behaviour.
It prevents method overloading.
What do objects instantiated from a class contain?
Class variables
Methods
Predefined Functions
What is a class in the context of Object-Oriented Programming (OOP)?
A blueprint for creating objects.
A specific instance of an object
A method for organising code.
A predefined set of actions
What is the purpose of creating a class in OOP?
To organise code in a modular way.
To generate random numbers.
To read input from a user or file.
Which one of the following statements about OS is NOT true?
Operating Systems are the interface between computer hardware and the user
The CPU can run multiple processes at the same time
A computer can support several applications being open at the same time
Peripherals require software called "drivers" in order for the OS to control them
Which of the following statements about OS is not true:
OS use Memory Management to try and minimise the use of virtual memory
Drivers use protocols to allow devices to communicate with peripherals
The BIOS is used to load the operating system into memory, from backing storage when the computer is turned on
File management in an operating system, is restricted to creating, moving, deleting and editing files & folders.
What is the word that means more then one user can access the computer at the same time?
Multi facet
Multi-core
Multi-user
multiprocessing
GUI "Graphical User Interface" is one type of user interface. Which of the following is another type?
BUI
CMI
TSI
CLI
GUI stands for...
games user interface
Graphical user interface
Windows is an...
Application software
Operating System
Special program which can detect and remove viruses from computer is called
Virus
Anti virus
Group ware
Custom
What is an example of a firewall?
When someone tries to hack your computer
When a certain website might be blocked
Stealing a password
It's literally a wall on fire...easy
Why computer virus is so dangerous ?
It could create a new system inside the old one
It could create data damage
It will help you to spend your time
It could make you richer and famous in a short time
A ------- is a computer program that can invade computer and perform a variety of functions ranging from annoying(e.g. popping up messages as a joke) to dangerous (e.g. deleting files)
Computer Virus
Anti Virus
Microsoft Word
Window Defender
Where is Virtual Memory Located?
RAM
Flash Drive
Compact Disk
Hard Disk
What is virtual memory?
An address assigned to a location in the Hard Disk that will allow that location to be accessed for collecting contents that has been stored and taken into physical memory(RAM).
A feature of an OS that allows a computer to make up for shortages of physical memory(RAM) by transferring data from RAM to the Hard Disk.
The range of memory addresses available to process.
The address of a storage location in main memory(RAM).
Memory that uses secondary storage so that it seems like an entire program is running from RAM
Cache Memory
Virtual Memory
Flash Memory
Registers
What is the purpose of RAM?
To hold instructions that are currently in use.
To store the boot-up sequence.
what is PROGRAM COUNTER (PC)?
holds the address of memory,where next executable instruction placed
holds the data of memory
16- bit register
it is a memory pointer
which port is used only for INPUT/OUTPUT operation?
PORT 0
PORT 1
PORT 2
PORT 3
PIN number of Vcc (supply)?
1
20
40
10
What is the bit length of upcounting timers in 8051 micro controllers?
4 bits
8 bits
16 bits
32 bits
Which section in IC 8051 is running on external clock source?
TIMER
COUNTER
REGISTER
CLOCK
Which circuits uses micro controller?
computer
multimeter
microprocessor
embedded systems
How many bits are numbered from OOH to 7FH for general-purpose addressable locations in 8051 micro controller?
32 bits
64 bits
128 bits
256 bits
Which is the microprocessor comprises?
Register section
One or more ALU
Control unit
All of the mentioned
The SP is indicated by ________
single pointer
stack pointer
source pointer
destination pointer
Which of the following is true about microprocessors?
It has an internal memory
It has interfacing circuits
It contains ALU, CU, and registers
It uses Harvard architecture
What is the word length of the Pentium-II microprocessor?
8-bit
32-bit
64-bit
16-bit
What is the base class and derived class in C++?
Base class and derived class are concepts in object-oriented programming where the base class is the class being inherited from, and the derived class is the class that inherits from the base class.
Parent class and child class are concepts in C++
Super class and sub class are concepts in C++
Main class and sub class are concepts in C++
What are the advantages of using inheritance in C++?
Code reusability, polymorphism, and hierarchical relationship between classes
Decreased code organization
Limited code flexibility
Faster code execution
What happens if the word static is placed in front of a member function in C++?
The member function can be called even if we do not create an instance of the class.
It places the member function in the static part of memory
It will cause an error and the program will not compile.
None of the above.
