Online Examination System 2012

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Farhan786
F
Farhan786
Community Contributor
Quizzes Created: 1 | Total Attempts: 317
| Attempts: 317 | Questions: 20
Please wait...
Question 1 / 20
0 %
0/100
Score 0/100
1. Which is a logical abstract base class for a class called "footballPlayer"? 

Explanation

The logical abstract base class for a class called "footballPlayer" would be "Team". This is because a football player is typically a part of a team and the team serves as the higher-level concept or category that the football player belongs to.

Submit
Please wait...
About This Quiz
Online Examination System 2012 - Quiz

This 2012 Online Examination System quiz assesses knowledge in computer science, focusing on data structures like queues and linked lists. It evaluates understanding of computational complexity and programming... see morelogic, essential for students and professionals in the field. see less

2. _________is a relationship 

Explanation

Inheritance is a relationship in object-oriented programming where one class inherits the properties and methods of another class. This allows the subclass to reuse the code from the superclass and add its own unique functionality. Inheritance promotes code reusability, as it allows for the creation of specialized classes that inherit common attributes and behaviors from a more general class.

Submit
3. A derived class is

Explanation

A derived class is a class that inherits data members and member functions from a base class. This means that the derived class can access and use the same data members and member functions as the base class. It does not inherit constructors and destructors, as those are specific to each class and need to be defined separately.

Submit
4.
______ means that both the data and the methods which may access it are defined together in the same unit. 

Explanation

Encapsulation means that both the data and the methods which may access it are defined together in the same unit. This allows for better organization and control over the data, as it is encapsulated within the unit and only accessible through the defined methods. This helps to prevent direct access to the data from external sources and ensures that any changes to the data are done through the appropriate methods, providing better security and maintainability of the code.

Submit
5. Suppose that the Test class does not have an overloaded assignment operator. What happens when an assignment a=b; is given for two Test objects a and b? 

Explanation

When an assignment a=b; is given for two Test objects a and b, the copy constructor is used. This is because in the absence of an overloaded assignment operator, the default assignment operator provided by the compiler performs a member-wise copy of the data from the source object (b) to the destination object (a). This requires the use of the copy constructor to create a new object (a) with the same values as the source object (b).

Submit
6.
An application uses encapsulation to achieve ________

Explanation

Encapsulation is a concept in object-oriented programming that involves bundling data and methods together into a single unit called an object. This helps in achieving information hiding, where the internal details and implementation of an object are hidden from the outside world. By encapsulating data and methods, an application can control access to its internal state and ensure that it is only accessed and modified through defined methods. This helps in maintaining data integrity and allows for easier maintenance and modification of the code. Therefore, the correct answer is information hiding.

Submit
7.
Can two classes contain member functions with the same name? 

Explanation

Yes, two classes can contain member functions with the same name, but only if the two classes have the same name. This is because member functions are identified by their class name, so if two classes have the same name, their member functions can have the same name as well. However, if the classes have different names, their member functions must also have different names to avoid conflicts.

Submit
8. Can two classes contain member functions with the same name?

Explanation

Yes, this is always allowed. In object-oriented programming, it is possible for two classes to contain member functions with the same name. This is known as function overloading, where different classes can have functions with the same name but different parameters or return types. The compiler can differentiate between these functions based on their signatures, allowing for more flexible and expressive code.

Submit
9. Time taken for addition of element in queue is 

Explanation

The time taken for the addition of an element in a queue is O(n). This means that the time complexity is directly proportional to the number of elements in the queue. As the number of elements increases, the time taken for adding an element also increases. This is because in a queue, new elements are added at the rear end, and if the queue is already full, additional memory needs to be allocated and all the existing elements need to be shifted to accommodate the new element. Therefore, the time complexity for adding an element in a queue is O(n).

Submit
10. Maintaining the state of an object is called____. 

Explanation

Serialization is the process of converting an object into a format that can be stored, transmitted, or reconstructed later. It involves converting the object's state into a byte stream, which can then be saved to a file or sent over a network. By serializing an object, its state is maintained and can be restored at a later time. Therefore, serialization is the correct answer for the given question.

Submit
11. If a catch statement is written to catch exception objects of a base class type, it can also catch all _____ derived from that base class 

Explanation

If a catch statement is written to catch exception objects of a base class type, it can also catch all exceptions derived from that base class. This is because when an exception is derived from a base class, it inherits the properties and behaviors of that base class. Therefore, if a catch statement is designed to catch exceptions for objects, it will be able to handle any exception object that is derived from the base class.

Submit
12. Which is a logical abstract base class for a class called "CricketPlayer"? 

Explanation

The logical abstract base class for a class called "CricketPlayer" would be "Sports" or "Team". This is because a cricket player is a type of sports player and is also a member of a team. However, "Cricket" cannot be the logical abstract base class as it represents the specific sport itself, rather than a general category that includes the concept of a cricket player.

Submit
13.
Consider a linked list implemented of a queue with two pointers: front and rear. What is the time needed to insert element in a queue of length of n? 

Explanation

The correct answer is O(n). In a linked list implementation of a queue, inserting an element involves updating the rear pointer to point to the new element. This operation takes constant time, regardless of the length of the queue. Therefore, the time complexity for inserting an element in a queue of length n is O(1), not O(log2n).

Submit
14.
Peer-to-peer relationship is a type of _________. 

Explanation

A peer-to-peer relationship refers to a type of connection or link between two or more peers, where each peer has equal privileges and responsibilities. This relationship is characterized by a decentralized structure, where peers can communicate and share resources directly with each other without the need for a central authority. Therefore, the correct answer is "Link".

Submit
15. Association in UML can be represented by: 

Explanation

In UML, association represents a relationship between two classes. It is depicted by a plane line with no shape on either end. This indicates that there is a connection between the two classes, but it does not specify the nature or direction of the relationship. The absence of any shape on either end signifies that the association is not navigable from either class.

Submit
16. A class is_____ 

Explanation

An abstract type refers to a class that cannot be instantiated directly, but serves as a base for other classes to inherit from. It provides a common interface and defines common behavior that derived classes can implement. Abstract types are typically used to define common characteristics and behavior for a group of related classes.

Submit
17. Consider a linked list of n elements. What is the time taken to insert an element pointer ? 

Explanation

The time taken to insert an element pointer in a linked list of n elements is O(n log2n). This means that the time complexity of the insertion operation is directly proportional to the number of elements in the linked list, multiplied by the logarithm (base 2) of the number of elements. This suggests that as the number of elements in the linked list increases, the time taken to insert an element pointer will also increase, but at a slower rate than linearly.

Submit
18. The statement that tests to see if sum is equal to 10 and total is less than 20, and if so, prints the text string "incorrect.", is 

Explanation

The correct answer is "if( (sum == 10) ¦¦ (total

Submit
19.  
In object orientated programming a class of objects can _____________ properties from another class of objects 

Explanation

In object-oriented programming, when a class of objects "utilizes" properties from another class of objects, it means that it is using or making use of those properties. This can be done through inheritance, where one class inherits the properties and methods of another class. By utilizing the properties, the class can access and manipulate the data or behavior defined in the other class, making the code more efficient and reusable.

Submit
20.
Reusability can be achieved through. 

Explanation

Composition is a design principle in object-oriented programming that allows objects to be composed of other objects. It promotes reusability by creating relationships between classes where one class contains another class as a member variable. This allows the containing class to reuse the functionality of the contained class without inheriting from it. Inheritance, on the other hand, allows for code reuse by creating a parent-child relationship between classes. Association is a looser relationship between classes that allows objects to interact, but does not promote code reuse in the same way as composition. Therefore, composition is the correct answer for achieving reusability.

Submit
View My Results

Quiz Review Timeline (Updated): Mar 21, 2023 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 21, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Mar 26, 2012
    Quiz Created by
    Farhan786
Cancel
  • All
    All (20)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
Which is a logical abstract base class for a class called...
_________is a relationship 
A derived class is
______ means that both the data and the methods which may access it...
Suppose that the Test class does not have an overloaded assignment...
An application uses encapsulation to achieve ________
Can two classes contain member functions with the same name? 
Can two classes contain member functions with the same name?
Time taken for addition of element in queue is 
Maintaining the state of an object is called____. 
If a catch statement is written to catch exception objects of a base...
Which is a logical abstract base class for a class called...
Consider a linked list implemented of a queue with two pointers: front...
Peer-to-peer relationship is a type of _________. 
Association in UML can be represented by: 
A class is_____ 
Consider a linked list of n elements. What is the time taken to insert...
The statement that tests to see if sum is equal to 10 and total is...
 ...
Reusability can be achieved through. 
Alert!

Advertisement