1. UNISA
2. 2024
3. INF1511-24-Y
4. Welcome Message 2024 WELCOME TO INF1511 Visual Programming 2024 - The
module will commence on MONDAY 4 March 2024. the module leader for 2024 is Dr
Kgopa and the secondary lecturer is Ms Naidoo..
5. Assessment 6
QUIZ
Assessment 6
Open course index
Back
Time left 0:09:20
Question 1
Answer saved
Marked out of 1.00
Flag question
Question text
The procedure of _____ allows different methods with the same name in different classes to
perform different tasks.
a.polymorphism
b.metamorphism
c.heteromorphism
d.monomorphism
Clear my choice
Question 2
Answer saved
Marked out of 1.00
Flag question
Question text
The Python programming language provides an option for re-useable code in the form of
____
a.instances
b.objects
c.classes
d.orientations
Clear my choice
Question 3
, Answer saved
Marked out of 1.00
Flag question
Question text
Let A and B be objects of class Foo. Which functions are called when print(A + B) is
executed?
a.__str__(), __add__()
b.__str__(), __sum__()
c.__sum__(), __str__()
d.__add__(), __str__()
Clear my choice
Question 4
Answer saved
Marked out of 1.00
Flag question
Question text
What is the output from the execution of the following code?
class triangle:
#setting default values
def __init__(self, x=10, y=10):
self.__base=x
self.__height=y
def calc(self):
area=0.5*self.base*self.height
return (area)
#create an instance
myBase=int(input('Please enter the base length : '))
myHeight=int(input('Please enter the height : '))
myTri=triangle(myBase, myHeight)
print(myTri.base)
print(myTri.height)
myTri.calc()
a.error message
2. 2024
3. INF1511-24-Y
4. Welcome Message 2024 WELCOME TO INF1511 Visual Programming 2024 - The
module will commence on MONDAY 4 March 2024. the module leader for 2024 is Dr
Kgopa and the secondary lecturer is Ms Naidoo..
5. Assessment 6
QUIZ
Assessment 6
Open course index
Back
Time left 0:09:20
Question 1
Answer saved
Marked out of 1.00
Flag question
Question text
The procedure of _____ allows different methods with the same name in different classes to
perform different tasks.
a.polymorphism
b.metamorphism
c.heteromorphism
d.monomorphism
Clear my choice
Question 2
Answer saved
Marked out of 1.00
Flag question
Question text
The Python programming language provides an option for re-useable code in the form of
____
a.instances
b.objects
c.classes
d.orientations
Clear my choice
Question 3
, Answer saved
Marked out of 1.00
Flag question
Question text
Let A and B be objects of class Foo. Which functions are called when print(A + B) is
executed?
a.__str__(), __add__()
b.__str__(), __sum__()
c.__sum__(), __str__()
d.__add__(), __str__()
Clear my choice
Question 4
Answer saved
Marked out of 1.00
Flag question
Question text
What is the output from the execution of the following code?
class triangle:
#setting default values
def __init__(self, x=10, y=10):
self.__base=x
self.__height=y
def calc(self):
area=0.5*self.base*self.height
return (area)
#create an instance
myBase=int(input('Please enter the base length : '))
myHeight=int(input('Please enter the height : '))
myTri=triangle(myBase, myHeight)
print(myTri.base)
print(myTri.height)
myTri.calc()
a.error message