NEW
Font size
WorksheetsITC 214 - Data Structures and Algorithm - Pretest
Total questions: 56
Worksheet time: 42mins
The programmer wants to locate the memory address of a certain data.
Casting
Number
Printing
Pointer
String
The programmer wants to store a specific data into a container.
Casting
Number
Printing
String
Variable
The programmer wants to convert data into a different data type.
Casting
Number
Printing
String
Variable
The programmer wants to incorporate arithmetic operations in the code.
Casting
Number
Printing
String
Variable
The programmer wants to ask for the user input.
#include<iostream>
:#include<cmath>
cin
return 0
using namespace std
The programmer wants to include the library that allows arithmetic functions to be used.
#include<iostream>
:#include<cmath>
cin
return 0
using namespace std
The programmer wants to end the code.
#include<iostream>
:#include<cmath>
cin
return 0
using namespace std
The programmer wants to bypass the use of method calls.
#include<iostream>
:#include<cmath>
cin
return 0
using namespace std
The programmer wants to simplify the counter-controlled repetition codes.
For Loop
Void Function
One Way Selection
Value-Returning Function
Switch
The programmer wants to store code without giving back value to the main function.
For Loop
Void Function
One Way Selection
Value-Returning Function
Switch
The programmer wants to select between two different outcomes only.
For Loop
Void Function
One Way Selection
Value-Returning Function
Switch
The programmer wants the main function to receive feedback data from a user defined function.
For Loop
Void Function
One Way Selection
Value-Returning Function
Switch
The programmer wants to evaluate all possible selections at one checking.
For Loop
Void Function
One Way Selection
Value-Returning Function
Switch
The programmer wants to execute a command first, prior the execution of the loop.
Do While Loop
While Loop
For Loop
Switch
Value-Returning Function
The programmer wants to end the selection process after a requirement is met.
Do While Loop
While Loop
For Loop
Switch
Value-Returning Function
The programmer wants to maintain the loop, unless the terminating statement is met.
Do While Loop
While Loop
For Loop
Switch
Value-Returning Function
The programmer wants to ensure that the program does not exit unexpectedly due to errors that may be encountered.
Exception Handling
Class
Array
Constructor
Object
The programmer wants to store several values of different data types in a single container.
Exception Handling
Class
Array
Constructor
Object
The programmer wants to store several values of the same data type in a single container.
Exception Handling
Class
Array
Constructor
Object
The programmer wants to store a user defined function inside a class.
Exception Handling
Class
Array
Constructor
Object
The programmer wants to replace the value of a private variable.
Setter
Getter
Inheritance
Object
Constructor
The programmer wants to retrieve the value of a private variable.
Setter
Getter
Inheritance
Object
Constructor
The programmer wants to override the variables of another class.
Setter
Getter
Inheritance
Object
Constructor
The programmer wants to use the variables stored in a class.
Setter
Getter
Inheritance
Object
Constructor
If {string name = "Slime"}, which of the following string code lines produces the output 5?
cout << name[0] << endl;
cout << name.substr(2) << endl;
cout << name.find("ime") << endl;
cout << name.length() << endl;
If {string name = "Slime"}, which of the following string code lines produces the output S?
cout << name[0] << endl;
cout << name.substr(2) << endl;
cout << name.find("ime") << endl;
cout << name.length() << endl;
If {string name = "Slime"}, which of the following string code lines produces the output 2?
cout << name[0] << endl;
cout << name.substr(2) << endl;
cout << name.find("ime") << endl;
cout << name.length() << endl;
If {string name = "Slime"}, which of the following string code lines produces the output ime?
cout << name[0] << endl;
cout << name.substr(2) << endl;
cout << name.find("ime") << endl;
cout << name.length() << endl;
Which is NOT an advantage in learning data structures?
Data structure provides effective and efficient processing of data.
Data structure helps in the efficient storage of data in the storage device.
Data structure is more helpful in C++ than any other programming language.
Data structure usage encourages reusability.
Which is NOT a valid primitive C++ data type?
Double
Character
Boolean
String
Switch structure does not require the evaluation of a logical expression. Which of the following flow chart describes it?
In a Do While looping structure, the statement executes first, and then the expression is evaluated. Which of the following flow chart describes it?
If statements allow the program to respond to different things and essentially make decisions. Which of the following flow chart describes it?
The For Loop's is typically called a counted or an indexed loop. Which of the following flow chart describes it?
Which of the following is NOT a valid array?
int array[ ] = {1, 2, 3, 4, 5};
char array[ ] = {'1', '2', '3', '4', '5'};
char array[ ] = {a, b, c, d, e};
string array[ ] = {"a", "b", "c", "d", "e"};
Which of the following is NOT a reason why private data members are declared?
It prevents programmers from making mistakes somewhere inside the code.
It ensures that the object can use functions declared in the class inside the main function.
It allows confidentiality of sensitive information such as passwords.
It makes it easy to ensure that the value of a variable is never negative.
The programmer wants to use a data type that allows users to input whole numbers.
Primitive
Non-Primitive
User-Defined
Abstract
The programmer wants to combine existing data types to create a new data type.
Primitive
Non-Primitive
User-Defined
Abstract
The programmer wants to create a data type to filter data through trees and graphs.
Primitive
Non-Primitive
User-Defined
Abstract
The programmer wants to use a data type using #include to enable usage of more than one characters.
Primitive
Non-Primitive
User-Defined
Abstract
The programmer wants to use a data type that can accommodate words or phrases.
Primitive
Non-Primitive
User-Defined
Abstract
The programmer wants to create a data type that can prioritize inputs from pregnant women, persons with disabilities (PWD), and senior citizens.
Primitive
Non-Primitive
User-Defined
Abstract
The programmer wants to combine data types into a single memory address to save up memory storage.
Primitive
Non-Primitive
User-Defined
Abstract
The programmer wants to use a data type that allows users to input decimal points.
Primitive
Non-Primitive
User-Defined
Abstract
The programmer wants to create a new data type to save the value of pi or Euler’s number.
Structure
Typedef Structure
Union
Enumeration
The programmer wants to create a new data type to categorize student data by their respective courses.
Structure
Typedef Structure
Union
Enumeration
The programmer wants to create a new data type that contains related fields such as name, age, birthday, and address.
Structure
Typedef Structure
Union
Enumeration
The programmer wants to create a new data type that allows different number values to be used whether they have decimals or not.
Structure
Typedef Structure
Union
Enumeration
The programmer wants to create a playlist setting that can replay the first song after the last song is played.
Singly
Doubly
Circular
The programmer wants to create a playlist setting that allows user to automatically play the next song after a chosen song is played.
Singly
Doubly
Circular
The programmer wants to create a playlist setting that allows users to manually select songs through previous and next buttons.
Singly
Doubly
Circular
The programmer wants to create a playlist setting that allows users to select albums through left or right swipe.
Singly
Doubly
Circular
The programmer wants to create an undo feature to remove the last action done by the user.
Stack
Queue
The programmer wants to print data in the order they are received.
Stack
Queue
The programmer wants to schedule automatic tasks through their creation dates in which older tasks are executed first.
Stack
Queue
The programmer wants to add a back button in his browser algorithm to revisit the last page accessed by the user.
Stack
Queue
