Types of Programming Language (OCR A Level Computer Science)

Exam Questions

22 mins3 questions
19 marks

A computer uses a stack data structure, implemented using an array, to store numbers entered by the user.

The array is zero based and has 100 locations.

The program is amended to include the use of several queue data structures.

Discuss the use of object-oriented programming and procedural programming to create and manipulate the queue data structures.

You should include the following in your answer:

  • the features of object-oriented programming

  • the features of procedural programming

  • the benefits of using object-oriented instead of procedural programming when creating several queue structures.

Did this page help you?

21 mark

A charity uses a desktop computer to record financial donations that it receives. The computer contains a single core, 2.4GHz processor with 2MB cache.

Fig. 1 shows assembly code written using the Little Man Computer (LMC). The program calculates and outputs the total amount that is donated to the charity in any particular day. Depending on the amount, an additional bonus may be added to each amount donated.

Assembly language code snippet with labels: start, nobonus, bonus; includes actions like INP, SUB, ADD, OUT, BRA, with variables hundred, twenty, donation.

Write LMC code that will reset the value of the memory location labelled total to zero and then stop the program.

Did this page help you?

312 marks

In assembly language, different modes of addressing memory can be used.

Discuss the different modes used. You should include:

  • How the operand value is determined

  • What an operand of 27 would refer to in that mode

  • The reasons for requiring multiple modes of addressing

Did this page help you?