Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Networking and C++

Total questions: 80

Worksheet time: 50mins

Name
Class
Date
1.

Which is not a process state?

a)

waiting

b)

terminated

c)

blocked

d)

redirected

2.

Which of the following is NOT a logical operator in C++ language?

a)

&

b)

&&

c)

||

d)

!

3.

A function can have _____ inside the parenthesis

a)

loops

b)

Arguments/Parameters

c)

Braces

d)

Types

4.

A function that has no return type starts with:

a)

int

b)

void

c)

Arguments

d)

Braces

5.

A function that is not void needs to have a _____ _______

a)

variable calculation

b)

printing statement

c)

Return statement

d)

cout statement

6.

Which of the following is a correct comment?

a)

*/ Comments */

b)

** Comment **

c)

/* Comment */

d)

{ Comment }

7.

What does <= mean?

a)

less than

b)

greater than

c)

less than or equal to

d)

greater than or equal to

8.

What will be the output of the following code?

int i = 0;

while (i < 3)

{

cout << "Number: " << i << endl;

i++;

}

a)

Number: 1

Number: 2

Number: 3

b)

Number: 0

Number: 1

Number: 2

c)

Number: 0

Number: 1

Number: 2

Number: 3

d)

None of the above

9.

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;

}

a)

Apple

Banana

Cherry

None

b)

Banana

Cherry

None

c)

Cherry

None

d)

None

10.

What is the output of this program with a `while` loop?

int num = 6;

while (num >= 1)

{

cout << num << " ";

--num ; }

a)

6 5 4 3 2 1

b)

1 2 3 4 5 6

c)

6 5 4 3 2

d)

Infinite loop

11.

What will be the output of this C++ code using a `do while` loop?

int num = 1;

do

{

cout << num << " ";

num++;

} while (num <= 5);

a)

1 2 3 4 5

b)

1 2 3 4

c)

0 1 2 3 4

d)

None of the above

12.

What is the value of this expression using integer arithmetic:

7 / 4

a)

1

b)

2

c)

1.75

13.

Determine the value of this expression using integer arithmetic:

5 % 7

a)

0

b)

2

c)

5

14.
What HTML element defines the title of the document?
a)
<title>
b)
<head>
c)
<meta>
15.
The content of the web (such as your pictures, text, links) will show up here. 
a)
Head
b)
Body
c)
Style
d)
Folder
16.
What does the tag <br> indicate?
a)
ordered list
b)
image
c)
paragraph
d)
break
17.
HTML tags are always surrounded by
a)
( )
b)
{ }
c)
< >   
d)
"  "
18.

Which code below is correct for a hyperlink

a)

<a>

"https://google.com"

Click Me

</a>

b)

<a>Click Me>

"https://google.com"

</a>

c)

<a herf="https://google.com">

Click Me

</a>

d)

<a href="https://google.com">

Click Me

</a>

19.

You need a closing tag for an image without text

a)

True

b)

False

20.

src attribute in an image tag means what?

a)

Source of the image

b)

Name of the image

c)

Description of the image

d)

Not used with image tag

21.

Which list tag would you use for an ordered list

a)

<h1></h1>

b)

<ol></ol>

c)

<ul></ul>

d)

<a></a>

22.

Which of the following contains a nested list

a)

<ul>

<li>Apples</li>

<li>Cookies</li>

<li>Milk</li>

</ul>

b)

<ul>

<li>Apples</li>

<li>

Cookies

<ul>

<li>Chocolate Chip</li>

<li>Peanut Butter</li>

</ul>

</li>

<li>Milk</li>

</ul>

23.

<th></th> is the code for .....

a)

a table row

b)

a table column

c)

a table header

d)

Thanos

24.

tr

a)

one column on the right

b)

one cell in a table

c)

one row of anything

d)

one column of anything

25.

colspan

a)

can only be used in caption

b)

can be used only in td

c)

can be used only in td or th

d)

be be used only in tr

26.

rowspan

a)

can only be used in caption

b)

can be used only in td

c)

can be used only in td or th

d)

be be used only in tr

27.

The opening caption tag is

a)

<table>

b)

<caption>

c)

<tblcaption>

d)

<figcaption>

28.

What does the HR tag create in HTML?

a)

Highlight region

b)

Header row

c)

Hyperlink reference

d)

Horizontal rule

29.

What is inheritance in C++?

a)

Inheritance in C++ is used to create new classes from existing classes

b)

Inheritance in C++ is a feature that allows a class to access private members of another class

c)

Inheritance in C++ allows a class to inherit properties and behaviors from another class.

d)

Inheritance in C++ is a way to override the properties and behaviors of a class

30.

What is the base class and derived class in C++?

a)

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.

b)

Parent class and child class are concepts in C++

c)

Super class and sub class are concepts in C++

d)

Main class and sub class are concepts in C++

31.

What are the advantages of using inheritance in C++?

a)

Code reusability, polymorphism, and hierarchical relationship between classes

b)

Decreased code organization

c)

Limited code flexibility

d)

Faster code execution

32.

child class is called as

a)

derived class

b)

base class

33.

access specifiers used in inheritance are

a)

public

b)

private

c)

protected

d)

none

34.

Which of the following reduces the number of comparisons in a program ?

a)

(A) Operator overloading

b)

(B) Operations overloading

c)

(C) Function Overloading

d)

(D) Member overloading

35.

Which of the following is invalid prototype for function overloading

a)

(A) void fun (int x); void fun (char ch) ;

b)

(B) void fun (int x); void fun (int y);

c)

(C) void fun (double d); void fun (char ch);

d)

(D) void fun (double d); void fun (int y);

36.

A block of code that performs a ____ purpose is known as a function

a)

Specific

b)

General

37.

function is executed when it is

a)

defined

b)

called

c)

declared

d)

prototyped

38.

This type of variable is defined inside a function and is not accessible outside the function.

a)

global

b)

counter

c)

local

d)

reference

39.

A _________ variable is declared outside all functions.

a)

local

b)

floating-point

c)

counter

d)

global

40.

What is the return type of the function with prototype: "int func(char x, float v, double t);"?

a)

char

b)

int

c)

double

d)

float

41.

A programming mechanism that binds together code and the data it manipulates, and that keeps both safe from outside interference and misuse.

a)

Polymorphism

b)

Inheritance

c)

Encapsulation

d)

Object-Oriented Programming

42.

An _________ is an instance or of a copy of a class.

a)

Class

b)

Attribute

c)

Object

43.

What is inheritance in C++?

a)

Inheritance in C++ is used to create new classes from existing classes

b)

Inheritance in C++ is a feature that allows a class to access private members of another class

c)

Inheritance in C++ allows a class to inherit properties and behaviors from another class.

d)

Inheritance in C++ is a way to override the properties and behaviors of a class

44.
The process of creating a new variable without value
a)
declaration
b)
naming
c)
instantiation
d)
assigning
45.

What is an example of Polymorphism in Method Overloading?

a)

Having multiple methods with the same name but different implementations.

b)

Having multiple methods with different names and different implementations.

c)

Having a single method with multiple implementations.

d)

Having a single method with the same name and the same implementation.

46.

In the provided example of Method Overloading, what does the override keyword do?

a)

It restricts access to the method.

b)

It provides a new implementation for a method that is already defined in the parent class.

c)

It overrides the polymorphic behaviour.

d)

It prevents method overloading.

47.

What do objects instantiated from a class contain?

a)

Class variables

b)

Methods

c)

Predefined Functions

48.

What is a class in the context of Object-Oriented Programming (OOP)?

a)

A blueprint for creating objects.

b)

A specific instance of an object

c)

A method for organising code.

d)

A predefined set of actions

49.

What is the purpose of creating a class in OOP?

a)

To organise code in a modular way.

b)

To generate random numbers.

c)

To read input from a user or file.

50.
Which part of the operating system deals with the movement, editing and deletion of data?
a)
Memory management
b)
File and disk management
c)
User management
d)
User interface
51.

Which one of the following statements about OS is NOT true?

a)

Operating Systems are the interface between computer hardware and the user

b)

The CPU can run multiple processes at the same time

c)

A computer can support several applications being open at the same time

d)

Peripherals require software called "drivers" in order for the OS to control them

52.
Being able to run several applications at the same time is known as�
a)
Multi tasking
b)
Application management
c)
Multi cores
d)
Application control
53.

Which of the following statements about OS is not true:

a)

OS use Memory Management to try and minimise the use of virtual memory

b)

Drivers use protocols to allow devices to communicate with peripherals

c)

The BIOS is used to load the operating system into memory, from backing storage when the computer is turned on

d)

File management in an operating system, is restricted to creating, moving, deleting and editing files & folders.

54.

What is the word that means more then one user can access the computer at the same time?

a)

Multi facet

b)

Multi-core

c)

Multi-user

d)

multiprocessing

55.

GUI "Graphical User Interface" is one type of user interface. Which of the following is another type?

a)

BUI

b)

CMI

c)

TSI

d)

CLI

56.

GUI stands for...

a)

games user interface

b)

Graphical user interface

57.

Windows is an...

a)

Application software

b)

Operating System

58.

Special program which can detect and remove viruses from computer is called

a)

Virus

b)

Anti virus

c)

Group ware

d)

Custom

59.

What is an example of a firewall?

a)

When someone tries to hack your computer

b)

When a certain website might be blocked

c)

Stealing a password

d)

It's literally a wall on fire...easy

60.

Why computer virus is so dangerous ?

a)

It could create a new system inside the old one

b)

It could create data damage

c)

It will help you to spend your time

d)

It could make you richer and famous in a short time

61.

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)

a)

Computer Virus

b)

Anti Virus

c)

Microsoft Word

d)

Window Defender

62.

Where is Virtual Memory Located?

a)

RAM

b)

Flash Drive

c)

Compact Disk

d)

Hard Disk

63.

What is virtual memory?

a)

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).

b)

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.

c)

The range of memory addresses available to process.

d)

The address of a storage location in main memory(RAM).

64.

Memory that uses secondary storage so that it seems like an entire program is running from RAM

a)

Cache Memory

b)

Virtual Memory

c)

Flash Memory

d)

Registers

65.
Virtual memory is used
a)
when the RAM is not enough to contain all of the programs and data currently being used
b)
every other time a program is used
c)
as a secondary storage medium for long term storage of documents
d)
when the CPU is getting overheated
66.

What is the purpose of RAM?

a)

To hold instructions that are currently in use.

b)

To store the boot-up sequence.

67.

what is PROGRAM COUNTER (PC)?

a)

holds the address of memory,where next executable instruction placed

b)

holds the data of memory

c)

16- bit register

d)

it is a memory pointer

68.

which port is used only for INPUT/OUTPUT operation?

a)

PORT 0

b)

PORT 1

c)

PORT 2

d)

PORT 3

69.

PIN number of Vcc (supply)?

a)

1

b)

20

c)

40

d)

10

70.

What is the bit length of upcounting timers in 8051 micro controllers?

a)

4 bits

b)

8 bits

c)

16 bits

d)

32 bits

71.

Which section in IC 8051 is running on external clock source?

a)

TIMER

b)

COUNTER

c)

REGISTER

d)

CLOCK

72.

Which circuits uses micro controller?

a)

computer

b)

multimeter

c)

microprocessor

d)

embedded systems

73.

How many bits are numbered from OOH to 7FH for general-purpose addressable locations in 8051 micro controller?

a)

32 bits

b)

64 bits

c)

128 bits

d)

256 bits

74.

Which is the microprocessor comprises?

a)

Register section

b)

One or more ALU

c)

Control unit

d)

All of the mentioned

75.

The SP is indicated by ________

a)

single pointer

b)

stack pointer

c)

source pointer

d)

destination pointer

76.

Which of the following is true about microprocessors?

a)

It has an internal memory

b)

It has interfacing circuits

c)

It contains ALU, CU, and registers

d)

It uses Harvard architecture

77.

What is the word length of the Pentium-II microprocessor?

a)

8-bit

b)

32-bit

c)

64-bit

d)

16-bit

78.

What is the base class and derived class in C++?

a)

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.

b)

Parent class and child class are concepts in C++

c)

Super class and sub class are concepts in C++

d)

Main class and sub class are concepts in C++

79.

What are the advantages of using inheritance in C++?

a)

Code reusability, polymorphism, and hierarchical relationship between classes

b)

Decreased code organization

c)

Limited code flexibility

d)

Faster code execution

80.

What happens if the word static is placed in front of a member function in C++?

a)

The member function can be called even if we do not create an instance of the class.

b)

It places the member function in the static part of memory

c)

It will cause an error and the program will not compile.

d)

None of the above.