OOP 1: Classes & Objects

OOP 1: Classes & Objects

Assessment

Interactive Video

Computers

12th Grade

Practice Problem

Hard

Created by

Benjamin Simpson-Court

FREE Resource

6 questions

Show all answers

1.

OPEN ENDED QUESTION

3 mins • 1 pt

These "really useful names" are an example of what?

Evaluate responses using AI:

OFF

Answer explanation

Names of variables, fucntions and procedures should be related to their intent/purpose. These are what are commonly referred to as self-documenting identifiers.

2.

FILL IN THE BLANK QUESTION

1 min • 1 pt

Variables defined inside a class, like Name and Breed, are known as properties or __________. They define the data an object will hold.

Answer explanation

In OOP, attributes are variables that define an object's state and characteristics, holding values that are specific to each instance of a class. They are the properties that represent what an object is or has, such as a car's color or a person's name. 

  • State: Attributes define the current state of an object. 

  • Characteristics: They represent the features or characteristics of an object. 

  • Instance-specific: Each object can have different values for the same attribute (e.g., one car's color might be "red," another's "blue"). 

  • Examples: For a Car class, attributes could be color, make, year, or number_of_doors. 

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The line Dim C1 As New Cat does two things. What is the second, most important part?

It declares a variable called C1

It instantiates (creates) a new object from the Cat class in memory

It sets all the properties of the Cat to default values

It runs all the methods inside the Cat class

Answer explanation

Media Image

The line Dim C1 As New Cat does two things: it declares a variable named C1 that can hold a Cat object, and it instantiates a new object of the Cat class, assigning it to the C1 variable. 

1. Declaration

  • Dim C1 As Cat declares a variable named C1.

  • The As Cat part specifies that this variable is of the Cat type, meaning it is designed to hold a reference to an object from the Cat class. 

2. Instantiation

  • New Cat creates a new instance (an object) of the Cat class in memory. This is often done by calling a constructor method, which initializes the object's state.

  • The New keyword performs this object creation and initialization process.

  • The Dim C1 part then assigns the memory address of this newly created Cat object to the variable C1. 

4.

OPEN ENDED QUESTION

3 mins • 3 pts

The lecturer is about to create a second cat object (C2).

In your own words, explain what you think will happen to the Name property of the first cat object (C1) when he sets the name for C2?

Evaluate responses using AI:

OFF

5.

FILL IN THE BLANK QUESTION

1 min • 1 pt

The process of "releasing the memory" that an object was using is often handled automatically by a system called the ________ _________.

Answer explanation

The CLR uses a garbage collection memory management system. In this system, sometimes memory is used by objects that are no longer needed. This state is temporary; the garbage collector releases this memory based on its performance and resource usage heuristics.

Source:

https://learn.microsoft.com/en-us/visualstudio/ide/visual-studio-performance-tips-and-tricks?view=vs-2022

6.

MULTIPLE CHOICE QUESTION

30 sec • Ungraded

  • How confident are you with the difference between a Class and an Object?

  • Very confident (I could explain it to someone else).

  • Confident (I understand the idea).

  • Not very confident (I'm a bit confused).

  • Not confident at all (I'm lost).

Answer explanation

Follow-Up Actions: What Next?

Thank you for your feedback. Please find your recommended next step below, to be completed after class.


A. If you answered: "Very Confident"

  • Challenge Task: You have a solid grasp of the basics. Your task is to apply this knowledge.

  • Action: Before the next lesson, design a new class for a different real-world object (e.g., a Car, a Student, or a BankAccount).

  • On paper or in a document, list:

    1. The Class Name.

    2. At least four Properties (attributes) it should have.

    3. At least two Methods (behaviours) it should be able to perform.


B. If you answered: "Confident"

  • Consolidation Task: You understand the core idea, but it is crucial to secure the new terminology.

  • Action: Review your notes from today's video. Create a precise definition table in your notes for these four key terms:

    1. Class

    2. Object

    3. Property

    4. Method

  • Self-Test: Look at the Visual Basic code from the video and try to label one example of each term.


C. If you answered: "Not Very Confident"

  • Guided Review Task: The concept can be tricky at first. Let's try a different perspective.

  • Action: Find a different (short) video or web page that explains "Classes vs. Objects." A common alternative analogy is the "cookie cutter and the cookie."

  • Write down, in your own words, two different analogies that explain the concept (e.g., the video's "blueprint vs. house" and one new one you have found).


D. If you answered: "Not Confident at All"

  • Intervention Task: Thank you for your honesty. This is a fundamental concept, and it is vital we get it right before moving on.

  • Action: Please send me a quick, private message on Google Classroom or via email before the end of today.

  • Just write "OOP support," and I will send you a different set of starter resources. We can then arrange a 1-to-1 chat to go through it together at a pace that works for you.

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?