Skip to content
VUBuddy

CS304P Quiz 4 Set 3

Object Oriented Programming (Practical) PDF 853 KBUpdated 23 Oct 2026
Quiz CS304P Quiz 4 Set 3 PDF 853 KB
vubuddy.com
Type
Quiz
Course
CS304P Object Oriented Programming (Practical)
Size
PDF 853 KB
Updated
23 Oct 2026
Free download 0 of 3 used today
Download free · 853 KB

You get 3 free files a day on the website. Add the Chrome extension for 30 a day.

Unlimited downloads in the Android app Get it free on Google Play

Preview text

Text from pages 1, 2, 3 of 5. Download the file for all 5 pages.

Q1. Everything in LISP is considered as a __________.

  1. Class
  2. Function
  3. Symbol
  4. Object

Correct answer: Symbol

Q2. While eliminating repeated elements of list in PROLOG, each element should be replaced with:

  1. Next element
  2. Blank space
  3. Single copy of the same element
  4. Previous element

Correct answer: Single copy of the same element

Q3. How many times the value of a PROLOG variable can be changed after first assignment?

  1. Many times
  2. Once
  3. Zero (Can not be changed)
  4. Twice

Correct answer: Zero (Can not be changed)

Q4. Which of the following are the types of constants in PROLOG?

  1. float and numbers
  2. short and char
  3. atoms and numbers
  4. single and decimal

Correct answer: atoms and numbers

Q5. All the variables in PROLOG clauses/predicates are:

  1. Strongly typed
  2. Local
  3. Global
  4. Generic

Correct answer: Global

Q6. In a PROLOG program, the names of all relationships and objects must begin with:

  1. Dollar sign ($)
  2. Lowercase letter
  3. Uppercase letter
  4. Underscore

Correct answer: Lowercase letter

Q7. Which of the following statement in LISP is used to list all properties of symbol ‘k’?

  1. >(get all ‘k)
  2. >(get ‘k)
  3. >(obtain all ‘k)
  4. >(symbol-plist ‘k)

Correct answer: >(symbol-plist ‘k)

Q8. The correct way to write Goal for following statement in PROLOG is _________________. "Which medicine relieves in diarrhea?"

  1. diarrhea (relieves, M).
  2. relieves (M, diarrhea).
  3. M (diarrhea, relieves).
  4. M (relieves, diarrhea).

Correct answer: relieves (M, diarrhea).

Q9. Basic elements of a program in PROLOG are:

  1. Entities and objects
  2. Rules and queries
  3. Facts and figures
  4. Predicates and rules

Correct answer: Predicates and rules

Q10. Following statement in PROLOG is considered as ______________________. "unsuitable_for(Person, Drug) :- aggravates(Drug, Condition), suffers_from(Person, Condition)."

  1. Rule
  2. Goal
  3. Variable
  4. Fact

Correct answer: Rule

Q11. Which of the following function is used to add an element to the end of a vector?

  1. back()
  2. end()
  3. insert()
  4. push_back()

Correct answer: push_back()

Q12. How can you define a class template in C++?

  1. template<class T> MyClass { ... };
  2. template<type T> class MyClass { ... };
  3. template<typename T> class MyClass { ... };
  4. template<name T> class MyClass { ... };

Correct answer: template<typename T> class MyClass { ... };

Q13. A class with pure virtual function is called ________ class.

  1. normal
  2. concrete
  3. abstract
  4. solid

Correct answer: abstract

Q14. In case of public inheritance between Base class A and Derived class B, which of the folllowing data members of Base class will be hidden in Derived class?

  1. protected
  2. public
  3. both public and private
  4. private

Correct answer: private

Q15. Which of the following is the correct syntax for creating a template class X friend of a template class Y?

  1. friend X;
  2. friend X<T>;
  3. X<T>;
  4. X<T> friend;

Correct answer: friend X<T>;

Q16. There are ________ types of inheritance in C++.

  1. 1
  2. 4
  3. 3
  4. 2

Correct answer: 4

Q17. Which of the following is the correct syntax to declare a vector of type int?

  1. sampleVector vector<int> ;
  2. int <vector> sampleVector;
  3. vector<int> sampleVector;
  4. vector {int} sampleVector;

Correct answer: vector<int> sampleVector;

Q18. Which of the following is not the correct type of inheritance in C++?

  1. protected
  2. secret
  3. private
  4. public

Correct answer: secret

All CS304P files →
CS304P Object Oriented Programming (Practical) All CS304P handouts, past papers, quizzes and MCQs in one place. Open course page

Get more out of VUBuddy, for free

Android app Free on Google Play
  • Unlimited downloads
  • The explanation behind every MCQ answer
  • Study offline on slow data
Get the Android app
Chrome extension Free on the Chrome Web Store
  • 30 downloads a day instead of 3
  • Sign in and buy Pro Semester here
Add to Chrome

One Pro Semester membership works in both the extension and the app.