Tag: OOP

OOP – Inheritance – Q&A

Question 1[2 marks] Class File:​ private filename​ //Constructor for the File class procedure new(strFilename):​ filename = strFilename​ public procedure rename(strFilename)​ if strfilename!=””:​ filename = strFilename​ Class MP3 inherits File:​ private title​ private artist​ private duration​ //Constructor for the MP3 class

OOP – Encapsulation – Q&A

Question 1[2 marks] class Padlock: private key private locked //Constructor for the Padlock class: procedure new(str_key,bool_locked): key = str_key locked = bool_locked public function unlock(combination): if combination==key: locked = False return True else: return False public procedure lock(): locked =

Multimedia Library (OOP Concepts)

In this blog post, we will write a computer program to create and maintain a multimedia library of books, CDs and DVDs. The aim of this programming task is to demonstrate some key Object-Oriented Programming concepts such as: Creating Classes

MP3 Playlist Class

The aim of this challenge is to implement a Class in Python to maintain an MP3 Playlist. This class could be used when developing the software for a music App on a smartphone or an mp3 player. This MP3 playlist

Shopping Basket Class

One of the key features of any e-commerce website is the shopping basket. It is used to let the end-users add products to their basket before proceeding to checkout. In this Python challenge we will create a Shopping Basket class

OOP Programming: Classes & Objects

In this blog post we will investigate how to create some basic classes and objects that could be used in a range of programming projects. Classes and Objects are the building blocks of Object-Oriented programs. You can find out about

Stopwatch Class (JavaScript)

In this challenge we will create an interactive stopwatch using HTML, CSS and JavaScript. The aim of this blog post is to use Object Oriented Programming to create our own Stopwatch class. Step 1: Stopwatch Class and its constructor First

Poker Card Game (JavaScript)

In this challenge we will create a one-player game of poker based on the rules of Texas Hold’em Poker. In a game of Texas Hold’em Poker, for each round, five “community cards” are dealt face-up on the “board”. Each player

Object-Oriented Programming – Crossword

Are you confident with your knowledge of key Object-Oriented Programming concepts: Classes & Objects, Inheritance, Encapsulation, Polymorphism and Abstract Classes? You can find our more about OOP concepts on the following page.

Object-Oriented Programming – Terminology

Click on the picture below to check your knowledge of key Object-Oriented Programming concepts: Classes & Objects, Inheritance, Encapsulation, Polymorphism and Abstract Classes.