Past-paper question · 2016 May-June · Paper 31 · Q6(d)(iv)

Question 6(d)(iv) 2016 · May-June · Paper 31 · 27 marks

Original past-paper question for 6(D)(IV)
Original past-paper question for 6(D)(IV)
Original past-paper question for 6(D)(IV)
Original past-paper question for 6(D)(IV)
Original past-paper question for 6(D)(IV)
Reveal official mark-scheme answer

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

Mark scheme 9691_s16_ms_31.pdf →

Show text version of question

Question 6

Part (d)

(iv)

Question 6

<sentence> ::= <verbPhrase> | <sentence><nounPhrase>

There are three issues which the final database design must address:

Issue 1 - Managers often negotiate a fee which is higher or lower than the set fee.

Issue 2 - Some bands are now able to perform more than one booking on any one date.

Issue 3 - The database is to store data for the venue where the band will perform.

The final design (not showing all of the primary keys) is:

BAND(BandName, Genre, NumberInBand, SetFee, ManagerName)

MANAGER(ManagerName, Telephone)

BOOKING(BandName, BookingDate, BookingTime, AgreedFee, VenueName)

VENUE(VenueName, VenueAddress, Capacity)

(iv)

Complete the table below to show the primary key and any foreign key(s) present in each

database table.

Foreign key(s) Table Primary key (if any)

.............................................................................. BAND BandName ..............................................................................

.............................................................................. MANAGER ManagerName ..............................................................................

.............................................................................. BOOKING ...................................................... ..............................................................................

.............................................................................. VENUE ...................................................... ..............................................................................

[4]

Question 7

Question 3

Part (a)

Convert the following infix expressions into reverse Polish notation:

(i)

x / (a + b)

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

[1]

(ii)

p ^ 2 + (2 + q) / 3

Note: ^ denotes ‘to the power of’

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

[2]

Part (b)

Convert the following reverse Polish expression to infix notation:

3 a b + c + d + e - *

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

[2]

Question 8

Part (c)

The reverse Polish expression RPNString consists of a sequence of characters. Each

character is either:

  • a single character identifier or digit
  • an operator

The following algorithm inputs RPNString and output the corresponding infix expression InfixString.

The algorithm uses a stack data structure, Stack.

INPUT RPNString

WHILE characters in RPNString

ThisChar ← next character

IF ThisChar is an identifier or digit

THEN

Push ThisChar to Stack

ELSE // next character is an operator

Pop item from Stack and store as Temp

InfixString ← Temp

// the & operator concatenates two strings

InfixString ← ThisChar & InfixString

Pop item from Stack and store as Temp

InfixString ← Temp & InfixString

Place brackets around InfixString

Push InfixString to Stack

ENDIF

ENDWHILE

Question 9

Complete the trace table for the input of the reverse Polish expression:

x y +

The first two iterations of the WHILE loop have been done for you.

RPNString ThisChar Stack contents Temp InfixString

x y + x x

y y x

[8]

Question 10

Question 4

Part (a)

A computer system stores integers in 8-bit two’s complement form.

State the two denary numbers represented by Byte 1 and Byte 2.

Byte 1 Byte 2

Byte 1 .......................................................

Byte 2 .......................................................

[2]

Part (b)

Byte 3 and Byte 4 together are used to represent a Binary Coded Decimal (BCD) number.

State the denary number.

Byte 3 Byte 4

Denary .......................................................

[2]

Part (c)

Byte 5 and Byte 6 together represent a 16-bit colour code used in a drawing program.

Byte 5 Byte 6

The drawing program displays the colour code as a hexadecimal number.

State the hexadecimal number for this colour code. .......................................................

[2]

Part (d)

Most computer systems need to store and process real numbers.

A
computer uses two bytes to store a real number.

The first byte (Byte 7) stores the mantissa. The second byte (Byte 8) stores the exponent.

Both mantissa and exponent use two’s complement form.

Byte 7 Byte 8

(i)

State, without any working out, how you can recognise that this 16-bit pattern (Byte 7

and Byte 8) is a negative number.

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

[1]

Question 11

(ii)

State the denary values for the mantissa and the exponent represented by Byte 7 and

Byte 8.

Mantissa ............................................................................................................................

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

Exponent ...........................................................................................................................

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

[2]

(iii)

Calculate the denary value represented by Byte 7 and Byte 8.

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

[1]
Topic relevance

Why this question appears here

91% assigned-topic match · Information representation › Data representation

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 9691_s16_qp_31.pdf

Keep practising this topic