Past-paper question · 2019 October-November · Paper 41 · Q2(e)(vi)

Question 2(e)(vi) 2019 · October-November · Paper 41 · 26 marks

Original past-paper question for 2(E)(VI)
Original past-paper question for 2(E)(VI)
Original past-paper question for 2(E)(VI)
Original past-paper question for 2(E)(VI)
Original past-paper question for 2(E)(VI)
Original past-paper question for 2(E)(VI)
Original past-paper question for 2(E)(VI)
Original past-paper question for 2(E)(VI)
Original past-paper question for 2(E)(VI)
Reveal official mark-scheme answer

The answer for this question is in the official mark scheme: open the mark scheme.

Mark scheme 9608_w19_ms_41.pdf →

Show text version of question

Question 2

Part (e)

(vi)

Question 2

Question 3

Question 5

Question 6

Question 1

Question 1

F

Question 7

Question 8

Question 9

[6]

Question 3

(ii)

State what is meant by the critical path in a PERT chart. ........................................................................................................................................... .....................................................................................................................................

[1]

(iii)

Identify and describe a project planning technique, other than a PERT chart. ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... .....................................................................................................................................

[2]

Part (e)

There are 1000 students at the university. They will each require a printing account.

Students need to buy printing credits that will be added to their account. Each page printed uses one printing credit. The university needs software to keep track of the number of printing credits each student has in their account. The university has decided to implement the software using object-oriented programming (OOP). The following diagram shows the design for the class PrintAccount. This includes the attributes and methods. PrintAccount FirstName : STRING // parameter sent to Constructor() LastName : STRING // parameter sent to Constructor() PrintID : STRING // parameter sent to Constructor() Credits : INTEGER // initialised to 50 Constructor() // instantiates an object of the PrintAccount class, // and assigns initial values to the attributes GetName() // returns FirstName and LastName concatenated // with a space between them GetPrintID() // returns PrintID SetFirstName() // sets the FirstName for a student SetLastName() // sets the LastName for a student SetPrintID() // sets the PrintID for a student AddCredits() // increases the number of credits for a student RemoveCredits() // removes credits from a student account

Question 9

(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 of the first name in lower case ◦ the first three letters of the last name in lower case ◦ the character ‘1’ for example, the name Bill Smith would produce "bilsmi1" • checks if the PrintID created already exists in the global array StudentAccounts: ◦ If PrintID does not exist, it creates an instance of PrintAccount in the next free index in StudentAccounts. ◦ If PrintID does exist, the number is incremented until a unique ID is created, for example, "bilsmi2". It then creates an instance of PrintAccount in the next free index in StudentAccounts. The global variable NumberStudents stores the number of print accounts that have currently been created. Write program code for the procedure CreateID(). Do not write the procedure header. Programming language ..................................................................................................... Program code ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ...........................................................................................................................................

Question 13

........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... .....................................................................................................................................

[8]

Question 14

Question 2

The following table shows part of the instruction set for a processor, which has one general purpose register, the Accumulator (ACC), and an Index Register (IX). Instruction Explanation Op code Operand LDM #n Immediate addressing. Load the number n to ACC. Direct addressing. Load the contents of the location at the given address to LDD <address> ACC. Indirect addressing. The address to be used is at the given address. Load the LDI <address> contents of this second address to ACC. Indexed addressing. Form the address from <address> + the contents of the LDX <address> Index Register. Copy the contents of this calculated address to ACC. LDR #n Immediate addressing. Load the number n to IX. STO <address> Store the contents of ACC at the given address. Indexed addressing. Form the address from <address> + the contents of the STX <address> Index Register. Copy the contents from ACC to this calculated address. ADD <address> Add the contents of the given address to the ACC. INC <register> Add 1 to the contents of the register (ACC or IX). DEC <register> Subtract 1 from the contents of the register (ACC or IX). JMP <address> Jump to the given address. CMP <address> Compare the contents of ACC with the contents of <address>. CMP #n Compare the contents of ACC with number n. JPE <address> Following a compare instruction, jump to <address> if the compare was True. JPN <address> Following a compare instruction, jump to <address> if the compare was False. AND #n Bitwise AND operation of the contents of ACC with the operand. AND <address> Bitwise AND operation of the contents of ACC with the contents of <address>. XOR #n Bitwise XOR operation of the contents of ACC with the operand. XOR <address> Bitwise XOR operation of the contents of ACC with the contents of <address>. OR #n Bitwise OR operation of the contents of ACC with the operand. Bitwise OR operation of the contents of ACC with the contents of <address>. OR <address> <address> can be an absolute address or a symbolic address. Bits in ACC are shifted n places to the left. Zeros are introduced on the right LSL #n hand end. Bits in ACC are shifted n places to the right. Zeros are introduced on the left LSR #n hand end. IN Key in a character and store its ASCII value in ACC. OUT Output to the screen the character whose ASCII value is stored in ACC. END Return control to the operating system.

Question 15

A
programmer writes a program that multiplies two numbers together and outputs the result. The

numbers are stored as NUMONE and NUMTWO. The programmer has started to write the program in the following table. The comment column contains explanations for some of the missing program instructions and data. Complete the program using the given instruction set. Label Op code Operand Comment LOOP: // load the value from ANSWER // add the value from NUMONE // load the value from COUNT // increment the Accumulator // is NUMTWO = COUNT ? // if false, jump to LOOP // load the value from ANSWER // output ANSWER to the screen // end of program NUMONE:

Question 2

NUMTWO:

Question 4

COUNT: 0 ANSWER: 0

[9]

Question 16

Topic relevance

Why this question appears here

98% assigned-topic match · Further programming › Programming paradigms

Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.

Permanent source page: Educate A Change · From 9608_w19_qp_41.pdf

Keep practising this topic