Computer Science 9608 · 20

Further programming

192 questions. Open a question to solve it and check the official answer.

Reset
2021 May-June · Paper 41 · Q1(b)(i)

Programming paradigms · 4 marks · official answer ready

(i) Write program code to declare the class vendingMachine. You are only required to write program code for the attribute declarations and the constructor. If you are writing in P…

2021 May-June · Paper 41 · Q1(b)(ii)

Programming paradigms · 5 marks · official answer ready

(ii) The method checkValid() takes the food item code as a parameter. It checks the code against each element in items and returns: • –1 if the code is not valid • -2 if the code …

2021 May-June · Paper 41 · Q1(b)(iii)

Programming paradigms · 2 marks · official answer ready

(iii) Four objects of type foodItem are declared with the identifiers: chocolate, sweets, sandwich, apple Write program code to declare an instance of vendingMachine with the iden…

2021 May-June · Paper 42 · Q3(a)

Programming paradigms · 4 marks · official answer ready

(a) Write program code to define the class QuizClass. You are only required to write code for the attribute declarations and constructor. If you are writing in Python, include att…

2021 May-June · Paper 42 · Q3(b)

Programming paradigms · 4 marks · official answer ready

(b) The QuizClass method AddQuestion() takes a question object as a parameter and stores it in the next available location in the array Questions. It returns TRUE if it is success…

2021 May-June · Paper 42 · Q3(c)

Programming paradigms · 5 marks · official answer ready

(c) The first quiz is created with the identifier FirstQuiz. The first question in this quiz is: “What is 100 / 5 ?”. The answer is “20” and the difficulty level is 1. Write progr…

2021 May-June · Paper 42 · Q3(d)

Programming paradigms · 1 mark · official answer ready

(d) The object FirstQuiz contains objects of type QuestionClass. State the name of this OOP feature. ..............................................................................…

2021 May-June · Paper 42 · Q3(e)(i)

Programming paradigms · 2 marks · official answer ready

(i) State when Ejaz should use an interpreter and a compiler. Each answer must be different. Interpreter ..........................................................................…

2021 May-June · Paper 42 · Q3(e)(ii)

Programming paradigms · 2 marks · official answer ready

(ii) Give the name of two facilities that Ejaz can use to debug his program. 1 ....................................................................................................…

2021 May-June · Paper 42 · Q3(e)(iii)

Programming paradigms · 2 marks · official answer ready

(iii) Describe one feature of an editor that Ejaz can use when writing the program. ...............................................................................................…

2021 May-June · Paper 43 · Q1(b)(i)

Programming paradigms · 4 marks · official answer ready

(i) Write program code to declare the class vendingMachine. You are only required to write program code for the attribute declarations and the constructor. If you are writing in P…

2021 May-June · Paper 43 · Q1(b)(ii)

Programming paradigms · 5 marks · official answer ready

(ii) The method checkValid() takes the food item code as a parameter. It checks the code against each element in items and returns: • –1 if the code is not valid • -2 if the code …

2021 May-June · Paper 43 · Q1(b)(iii)

Programming paradigms · 2 marks · official answer ready

(iii) Four objects of type foodItem are declared with the identifiers: chocolate, sweets, sandwich, apple Write program code to declare an instance of vendingMachine with the iden…

2019 October-November · Paper 41 · Q1(e)(i)

Programming paradigms · 4 marks · official answer ready

(i) Write program code for the Constructor() method. Programming language ..................................................................................................... Pro…

2019 October-November · Paper 41 · Q1(e)(ii)

Programming paradigms · 2 marks · official answer ready

(ii) Write program code for the SetFirstName()method. Programming language ..................................................................................................... Pr…

2019 October-November · Paper 41 · Q1(e)(iii)

Programming paradigms · 2 marks · official answer ready

(iii) Write program code for the GetName()method. Programming language ..................................................................................................... Progra…

2019 October-November · Paper 41 · Q1(e)(iv)

Programming paradigms · 6 marks · official answer ready

(iv) The method AddCredits()calculates the number of printing credits a student buys and adds the printing credits to the student’s account. • Credits cost $1 for 25 credits. • If…

2019 October-November · Paper 41 · Q1(e)(v)

Programming paradigms · 2 marks · official answer ready

(v) A global array, StudentAccounts, stores 1000 instances of PrintAccount. Write pseudocode to declare the array StudentAccounts. ................................................…

2019 October-November · Paper 41 · Q1(e)(vi)

Programming paradigms · 8 marks · official answer ready

(vi) The main program has a procedure, CreateID(), that: • takes the first name and last name as parameters • creates PrintID that is a concatenation of: ◦ the first three letters…

2019 October-November · Paper 41 · Q2(e)(i)

Programming paradigms · 13 marks

2 3 5 6 1 1 F 7 8 9 [6] 3 (ii) State what is meant by the critical path in a PERT chart. ..........................................................................................…