wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

ITC 214 - Data Structures and Algorithm - Pretest

Total questions: 56

Worksheet time: 42mins

Name
Class
Date
1.

The programmer wants to locate the memory address of a certain data.

a)

Casting

b)

Number

c)

Printing

d)

Pointer

e)

String

2.

The programmer wants to store a specific data into a container.

a)

Casting

b)

Number

c)

Printing

d)

String

e)

Variable

3.

The programmer wants to convert data into a different data type.

a)

Casting

b)

Number

c)

Printing

d)

String

e)

Variable

4.

The programmer wants to incorporate arithmetic operations in the code.

a)

Casting

b)

Number

c)

Printing

d)

String

e)

Variable

5.

The programmer wants to ask for the user input.

a)

#include<iostream>

b)

:#include<cmath>

c)

cin

d)

return 0

e)

using namespace std

6.

The programmer wants to include the library that allows arithmetic functions to be used.

a)

#include<iostream>

b)

:#include<cmath>

c)

cin

d)

return 0

e)

using namespace std

7.

The programmer wants to end the code.

a)

#include<iostream>

b)

:#include<cmath>

c)

cin

d)

return 0

e)

using namespace std

8.

The programmer wants to bypass the use of method calls.

a)

#include<iostream>

b)

:#include<cmath>

c)

cin

d)

return 0

e)

using namespace std

9.

The programmer wants to simplify the counter-controlled repetition codes.

a)

For Loop

b)

Void Function

c)

One Way Selection

d)

Value-Returning Function

e)

Switch

10.

The programmer wants to store code without giving back value to the main function.

a)

For Loop

b)

Void Function

c)

One Way Selection

d)

Value-Returning Function

e)

Switch

11.

The programmer wants to select between two different outcomes only.

a)

For Loop

b)

Void Function

c)

One Way Selection

d)

Value-Returning Function

e)

Switch

12.

The programmer wants the main function to receive feedback data from a user defined function.

a)

For Loop

b)

Void Function

c)

One Way Selection

d)

Value-Returning Function

e)

Switch

13.

The programmer wants to evaluate all possible selections at one checking.

a)

For Loop

b)

Void Function

c)

One Way Selection

d)

Value-Returning Function

e)

Switch

14.

The programmer wants to execute a command first, prior the execution of the loop.

a)

Do While Loop

b)

While Loop

c)

For Loop

d)

Switch

e)

Value-Returning Function

15.

The programmer wants to end the selection process after a requirement is met.

a)

Do While Loop

b)

While Loop

c)

For Loop

d)

Switch

e)

Value-Returning Function

16.

The programmer wants to maintain the loop, unless the terminating statement is met.

a)

Do While Loop

b)

While Loop

c)

For Loop

d)

Switch

e)

Value-Returning Function

17.

The programmer wants to ensure that the program does not exit unexpectedly due to errors that may be encountered.

a)

Exception Handling

b)

Class

c)

Array

d)

Constructor

e)

Object

18.

The programmer wants to store several values of different data types in a single container.

a)

Exception Handling

b)

Class

c)

Array

d)

Constructor

e)

Object

19.

The programmer wants to store several values of the same data type in a single container.

a)

Exception Handling

b)

Class

c)

Array

d)

Constructor

e)

Object

20.

The programmer wants to store a user defined function inside a class.

a)

Exception Handling

b)

Class

c)

Array

d)

Constructor

e)

Object

21.

The programmer wants to replace the value of a private variable.

a)

Setter

b)

Getter

c)

Inheritance

d)

Object

e)

Constructor

22.

The programmer wants to retrieve the value of a private variable.

a)

Setter

b)

Getter

c)

Inheritance

d)

Object

e)

Constructor

23.

The programmer wants to override the variables of another class.

a)

Setter

b)

Getter

c)

Inheritance

d)

Object

e)

Constructor

24.

The programmer wants to use the variables stored in a class.

a)

Setter

b)

Getter

c)

Inheritance

d)

Object

e)

Constructor

25.

If {string name = "Slime"}, which of the following string code lines produces the output 5?

a)

cout << name[0] << endl;

b)

cout << name.substr(2) << endl;

c)

cout << name.find("ime") << endl;

d)

cout << name.length() << endl;

26.

If {string name = "Slime"}, which of the following string code lines produces the output S?

a)

cout << name[0] << endl;

b)

cout << name.substr(2) << endl;

c)

cout << name.find("ime") << endl;

d)

cout << name.length() << endl;

27.

If {string name = "Slime"}, which of the following string code lines produces the output 2?

a)

cout << name[0] << endl;

b)

cout << name.substr(2) << endl;

c)

cout << name.find("ime") << endl;

d)

cout << name.length() << endl;

28.

If {string name = "Slime"}, which of the following string code lines produces the output ime?

a)

cout << name[0] << endl;

b)

cout << name.substr(2) << endl;

c)

cout << name.find("ime") << endl;

d)

cout << name.length() << endl;

29.

Which is NOT an advantage in learning data structures?

a)

Data structure provides effective and efficient processing of data.

b)

Data structure helps in the efficient storage of data in the storage device.

c)

Data structure is more helpful in C++ than any other programming language.

d)

Data structure usage encourages reusability.

30.

Which is NOT a valid primitive C++ data type?

a)

Double

b)

Character

c)

Boolean

d)

String

31.

Switch structure does not require the evaluation of a logical expression. Which of the following flow chart describes it?

a)

b)

c)

d)

32.

In a Do While looping structure, the statement executes first, and then the expression is evaluated. Which of the following flow chart describes it?

a)

b)

c)

d)

33.

If statements allow the program to respond to different things and essentially make decisions. Which of the following flow chart describes it?

a)

b)

c)

d)

34.

The For Loop's is typically called a counted or an indexed loop. Which of the following flow chart describes it?

a)

b)

c)

d)

35.

Which of the following is NOT a valid array?

a)

int array[ ] = {1, 2, 3, 4, 5};

b)

char array[ ] = {'1', '2', '3', '4', '5'};

c)

char array[ ] = {a, b, c, d, e};

d)

string array[ ] = {"a", "b", "c", "d", "e"};

36.

Which of the following is NOT a reason why private data members are declared?

a)

It prevents programmers from making mistakes somewhere inside the code.

b)

It ensures that the object can use functions declared in the class inside the main function.

c)

It allows confidentiality of sensitive information such as passwords.

d)

It makes it easy to ensure that the value of a variable is never negative.

37.

The programmer wants to use a data type that allows users to input whole numbers.

a)

Primitive

b)

Non-Primitive

c)

User-Defined

d)

Abstract

38.

The programmer wants to combine existing data types to create a new data type.

a)

Primitive

b)

Non-Primitive

c)

User-Defined

d)

Abstract

39.

The programmer wants to create a data type to filter data through trees and graphs.

a)

Primitive

b)

Non-Primitive

c)

User-Defined

d)

Abstract

40.

The programmer wants to use a data type using #include to enable usage of more than one characters.

a)

Primitive

b)

Non-Primitive

c)

User-Defined

d)

Abstract

41.

The programmer wants to use a data type that can accommodate words or phrases.

a)

Primitive

b)

Non-Primitive

c)

User-Defined

d)

Abstract

42.

The programmer wants to create a data type that can prioritize inputs from pregnant women, persons with disabilities (PWD), and senior citizens.

a)

Primitive

b)

Non-Primitive

c)

User-Defined

d)

Abstract

43.

The programmer wants to combine data types into a single memory address to save up memory storage.

a)

Primitive

b)

Non-Primitive

c)

User-Defined

d)

Abstract

44.

The programmer wants to use a data type that allows users to input decimal points.

a)

Primitive

b)

Non-Primitive

c)

User-Defined

d)

Abstract

45.

The programmer wants to create a new data type to save the value of pi or Euler’s number.

a)

Structure

b)

Typedef Structure

c)

Union

d)

Enumeration

46.

The programmer wants to create a new data type to categorize student data by their respective courses.

a)

Structure

b)

Typedef Structure

c)

Union

d)

Enumeration

47.

The programmer wants to create a new data type that contains related fields such as name, age, birthday, and address.

a)

Structure

b)

Typedef Structure

c)

Union

d)

Enumeration

48.

The programmer wants to create a new data type that allows different number values to be used whether they have decimals or not.

a)

Structure

b)

Typedef Structure

c)

Union

d)

Enumeration

49.

The programmer wants to create a playlist setting that can replay the first song after the last song is played.

a)

Singly

b)

Doubly

c)

Circular

50.

The programmer wants to create a playlist setting that allows user to automatically play the next song after a chosen song is played.

a)

Singly

b)

Doubly

c)

Circular

51.

The programmer wants to create a playlist setting that allows users to manually select songs through previous and next buttons.

a)

Singly

b)

Doubly

c)

Circular

52.

The programmer wants to create a playlist setting that allows users to select albums through left or right swipe.

a)

Singly

b)

Doubly

c)

Circular

53.

The programmer wants to create an undo feature to remove the last action done by the user.

a)

Stack

b)

Queue

54.

The programmer wants to print data in the order they are received.

a)

Stack

b)

Queue

55.

The programmer wants to schedule automatic tasks through their creation dates in which older tasks are executed first.

a)

Stack

b)

Queue

56.

The programmer wants to add a back button in his browser algorithm to revisit the last page accessed by the user.

a)

Stack

b)

Queue