Q&A - 101 Computing https://www.101computing.net Boost Your Programming Skills! Wed, 14 Jun 2023 10:15:36 +0000 en-US hourly 1 https://www.101computing.net/wp/wp-content/uploads/cropped-android-chrome-512x512-1-32x32.png Q&A - 101 Computing https://www.101computing.net 32 32 OOP – Inheritance – Q&A https://www.101computing.net/oop-inheritance-qa/ Sun, 13 Mar 2022 16:39:14 +0000 https://www.101computing.net/?p=13789 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…

The post OOP – Inheritance – Q&A first appeared on 101 Computing.

]]>
OOP – Encapsulation – Q&A https://www.101computing.net/oop-encapsulation-qa/ Sun, 13 Mar 2022 16:23:16 +0000 https://www.101computing.net/?p=13732 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 =…

The post OOP – Encapsulation – Q&A first appeared on 101 Computing.

]]>