Further programming
192 questions. Open a question to solve it and check the official answer.
Programming paradigms · 3 marks · official answer ready
(i) Create() ........................................................................................................................................... ..........................…
Programming paradigms · 2 marks · official answer ready
(ii) Reset() ........................................................................................................................................... ..........................…
Programming paradigms · 2 marks · official answer ready
(iii) SetState() ........................................................................................................................................... ......................…
Programming paradigms · 2 marks · official answer ready
(iv) SetNewCode() ........................................................................................................................................... .....................…
Programming paradigms · 4 marks · official answer ready
(v) The user must enter a 4-digit code. Write program code for a function Valid(s : STRING)that returns: • TRUE if the input string s consists of exactly 4 digits • FALSE otherwis…
Programming paradigms · 12 marks · official answer ready
(vi) Convert the flowchart to program code for the method StateChange(). Use the properties and methods in the original class definition and the Valid() function from part (v). ME…
Programming paradigms · 4 marks · official answer ready
(vii) The company needs to write a program to simulate a safety deposit box. The program will create an object with identifier ThisSafe, which is an instance of the class SafetyDe…
Programming paradigms · 3 marks · official answer ready
(i) Create() ........................................................................................................................................... ..........................…
Programming paradigms · 2 marks · official answer ready
(ii) SetState() ........................................................................................................................................... .......................…
Programming paradigms · 2 marks · official answer ready
(iii) ReturnCoins() ........................................................................................................................................... ...................…
Programming paradigms · 3 marks · official answer ready
(iv) Each coin inserted must be one of the following: 10, 20, 50 or 100 cents. Write program code for a function ValidCoin(s : STRING) that returns: • TRUE if the input string is …
Programming paradigms · 2 marks · official answer ready
(v) Write program code for the method CoinInserted() ..............................................................................................................................…
Programming paradigms · 12 marks · official answer ready
(vi) Convert the flowchart to program code for the method StateChange(). Use the attributes and methods in the original class definition and the ValidCoin() function from part (iv…
Programming paradigms · 4 marks · official answer ready
(vii) The company needs to write a program to simulate a parking meter. The program will create an object with identifier ParkingMeter, which is an instance of the class TicketMac…
Programming paradigms · 3 marks · official answer ready
(i) Create() ........................................................................................................................................... ..........................…
Programming paradigms · 2 marks · official answer ready
(ii) Reset() ........................................................................................................................................... ..........................…
Programming paradigms · 2 marks · official answer ready
(iii) SetState() ........................................................................................................................................... ......................…
Programming paradigms · 2 marks · official answer ready
(iv) SetNewCode() ........................................................................................................................................... .....................…
Programming paradigms · 4 marks · official answer ready
(v) The user must enter a 4-digit code. Write program code for a function Valid(s : STRING)that returns: • TRUE if the input string s consists of exactly 4 digits • FALSE otherwis…
Programming paradigms · 12 marks · official answer ready
(vi) Convert the flowchart to program code for the method StateChange(). Use the properties and methods in the original class definition and the Valid() function from part (v). ME…
