Summative Assessment Answers - OOP - KS4
Summative Assessment Answers - OOP - KS4
Q1. Which of the following are examples of classes used in the example program?
(Choose all that apply)
❏ book.py
✓ User
✓ Library
❏ jane
❏ hunger_games
Q2. Which of the following are examples of objects used in the example program?
(Choose all that apply)
❏ book.py
✓ jane
❏ Library
❏ User
✓ hunger_games
A. title
B. rent_out
C. author
D. self
A. list_books_author
B. add_user
C. books
D. __init__
Q5. The school library wants to add a new feature that will link the Users with their
school library ID cards. The cards have an ID number that is a combination of letters and
numbers e.g 15AG000345. They would like you to add this into the program. What would
you need to add to store this new information?
Q6. To create a new object of the Book class which of the following lines of code would
you use?
A. book_object = Book.__init__(self)
B. book_object = new Book
C. Book()
D. book_object = Book()
Q7. To access the users attribute on an object of the library class called school_library
which of these lines of code would you use?
A. school_library.users
B. school_library.get_user()
C. school_library.get_user
D. school_library return users
Q8. To change the author attribute on an object of the class Book called twilight, which
line of code would you use?
Q9. Some of the classes are linked to one another through association. Which of the
attributes of the Book class is an association with another class from the program?
A. title
B. author
C. genre
D. current_holder
Q10. Which method inside the User class is designed to interact with another class?
A. receive_book()
B. get_author()
C. set_email()
D. __Init__()
Q11. The library wants to make the books easier to sort through by categorising them as
either “Fiction” or “Nonfiction”. They would like you to add to the program and create
new classes to hold specific information about both of these types of book e.g Subject
for Non-Fiction and Series for Fiction books.
Inheritance
B. If you were to make a new class called NonFictionBook derived from the Book
class, one would be a superclass and another a subclass - which label applies to
which class?
Book superclass
NonFictionBook subclass
Resources are updated regularly - the latest version is available at: the-cc.io/curriculum.