07 Midterm Prep
07 Midterm Prep
Carol V. Alexandru-Funakoshi
October 31, 2023
1
• 3 Kprim questions (2 points each)
• 6 programming tasks (6, 6, 7, 8, 12 and 15 points)
• You can navigate the entire exam from the beginning and you can jump back and forth
between tasks, as long as you don't end the exam.
Mange your time!
2
Let's update last weeks example with abstract:
class Shape():
def __init__(self, cord_x, cord_y, color):
self.cord_x = cord_x
self.cord_y = cord_y
self.color = color
def calculate_area(self):
pass
class Circle(Shape):
def __init__(self, cord_x, cord_y, color, radius):
super().__init__(cord_x, cord_y, color)
self.radius = radius
def calculate_area(self):
return pi * self.radius**2
class Rectangle(Shape):
def __init__(self, cord_x, cord_y, color, width, length):
super().__init__(cord_x, cord_y, color)
self.width = width
self.length=length
def calculate_area(self):
return self.width * self.length
314.1592653589793
100000
3
• Modify and extend tasks from ACCESS by yourself. For example, you could invert the
requirements for many existing tasks.
• Just come up with arbitrary challenges for yourself. It's probabl the best way to practice.
[ ]: