0% found this document useful (0 votes)
38 views

Summative Assessment Answers - OOP - KS4

Uploaded by

silva
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views

Summative Assessment Answers - OOP - KS4

Uploaded by

silva
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

KS4 – Object-oriented programming

Summative Assessment - Answers

Summative assessment – Answers


Object-oriented programming. To complete this
assessment you should have access to the “library tracker”
example program

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

Q3. Which of the following is a method in the Book class?

A. title
B. rent_out
C. author
D. self

Q4. Which of the following is an example of an attribute in the Library class?

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

Page 1 Last updated: 25-01-21


KS4 – Object-oriented programming
Summative Assessment - Answers

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?

A. A method to the Library class


B. A class called Student_ID
C. An attribute in the User class
D. A method in the User class

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?

A. twilight.author = “Stephanie Meyer”


B. twilight.set_author = “Stephanie Meyer”
C. twilight.get_author(“Stephanie Meyer”)
D. twilight.set_author(“Stephanie Meyer”)

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?

Page 2 Last updated: 25-01-21


KS4 – Object-oriented programming
Summative Assessment - Answers

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.

A. Which principle of object-oriented programming would you use to achieve this


new functionality?

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.

This resource is licensed by the Raspberry Pi Foundation under a Creative Commons


Attribution-NonCommercial-ShareAlike 4.0 International license. To view a copy of this
license, visit, see creativecommons.org/licenses/by-nc-sa/4.0/.

Page 3 Last updated: 25-01-21

You might also like