G11 Unit 2 Exercises

G11 Unit 2 Exercises

11th Grade

16 Qs

quiz-placeholder

Similar activities

AP CSA Java Unit 5 Classes

AP CSA Java Unit 5 Classes

9th - 12th Grade

15 Qs

Inheritance #1

Inheritance #1

10th - 12th Grade

20 Qs

Student led python

Student led python

9th - 12th Grade

11 Qs

Inheritance in python

Inheritance in python

9th - 12th Grade

15 Qs

Perseritje OOP

Perseritje OOP

1st - 12th Grade

17 Qs

Java, part I

Java, part I

11th Grade - University

20 Qs

CS1 Unit 5

CS1 Unit 5

9th - 12th Grade

15 Qs

AP Computer Science A Unit 5

AP Computer Science A Unit 5

9th - 12th Grade

15 Qs

G11 Unit 2 Exercises

G11 Unit 2 Exercises

Assessment

Quiz

Computers

11th Grade

Medium

Created by

Razan Alghamdi undefined

Used 2+ times

FREE Resource

16 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The composition of attributes and methods is defined by

Inheritance

Method

Class

Object

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which statement is true about the inheritance concept in object-oriented programming?

A child class can inherit attributes and methods from multiple parent classes.

Child classes cannot have additional attributes or methods beyond those of the parent

A parent class can inherit from its child class.

Only methods can be inherited from the parent class.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Consider the following code and identify the parent class.

class A:

pass

class B(A):

pass

class C(A):

pass

A

B

C

None

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In Python, what is an example of polymorphism?

Creating classes that inherit from multiple parent classes.

Creating multiple classes with the same name.

Using the len() method on different data types.

Writing multiple functions with different names that perform the same action.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Predict the output of the following program.

class Parent:

def speak(self):

return "Parent Speaking"

class Child(Parent):

def speak(self):

return "Child Speaking"

obj = Child()

print(obj.speak())

Child Speaking

An error will be raised

None of the above

Parent Speaking

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will happen if a method is not found in the Child class but is present in the parent class?

The program will throw an error.

The method from the parent class will be executed.

The program will terminate.

The method from the child class will be executed.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which feature of OOP allows the reusability of code?

Inheritance

Class

Method

Object

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?