ExamBank Scot · N5 Computing Science question bank · All N5 Computing Science questions

N5 Computing Science 2015 Question 17

10 marks · Floating-point representation

Explain how the value in the variable productCost will be stored in the computer. The program is tested but stops running after a few lines. An error is highlighted. Name the type of translator being used. State one disadvantage of using this type of translator. When all errors are removed, the completed program is translated. A section of the translated code is shown below. 1 0 1 1 0 0 0 1 0 0 1 0 1 1 1 0 1 1 1 1 0 1 0 1 0 1 1 0 1 1 1 0 State the type of programming language the code has been translated into. A diagram of a computer system is shown below. Address Bus Registers Main Backing Control Memory Storage Units Data Bus ALU Input/Output Devices The following part of the program is executed. … Line 9 SET productVat TO productCost * vatRate Name the part of the computer system that will carry out each of the following tasks during the execution of this line of code. Carries the location of productCost in main memory. Transfers the value of productCost from main memory to the processor. Performs the VAT calculation. The program is backed-up onto an external hard drive which is connected to the computer using an interface. Describe two purposes of an interface. Purpose 1 Purpose 2 Pseudocode for a short program is written to calculate VAT on products. Part of the pseudocode is shown below. … Line 7 SET vatRate TO 0.2 Line 8 RECEIVE productCost FROM (REAL) KEYBOARD Line 9 SET productVat TO productCost * vatRate

Marking scheme

Mantissa and exponent 1 mark for floating point Interpreter Any one for one mark • Additional RAM required • Increased processing required (could run more slowly) • Loops translated multiple times If compiler is answered at (b) (i) then accept: • time wasted switching between editor and compiled code during testing • location of errors often not as clear Machine Code or Binary Address Bus Data Bus Arithmetic Logic Unit (ALU) Any two for one mark each • Temporary storage of data • Handling of status signals • Data conversion - serial to parallel • Voltage conversion • Communication between two devices Not: ‘connect’ two devices

Previous question: N5 Computing Science 2015 Question 16

Next question: N5 Computing Science 2015 Question 18