ExamBank Scot · N5 Computing Science question bank · All N5 Computing Science questions
16 marks · Development process and analysis
Describe two processes that will be carried out by the program. Process 1 Process 2 The user interface design is implemented. It contains a bit-mapped graphic and some text. Describe how a bit-mapped graphic would be stored. State a standard code used to represent text characters and the number of bits used to store each character. Standard code Number of bits State the data types that will be required to store the values of the following inputs. The current meter reading Check box if eligible for £5 discount The current meter reading of 15007·11 would be stored in a computer system using floating-point representation as shown below. 0·1500711 × 10⁵ Identify the mantissa and exponent in the above floating-point representation. Mantissa Exponent The program uses input validation. … Line 13 REPEAT Line 14 RECEIVE currentReading FROM <the touch screen keyboard> Line 15 IF currentReading < previousReading THEN Line 16 SEND "Reading too low. Please re-enter" TO DISPLAY Line 17 END IF Line 18 Using a programming language of your choice, complete Line 18. Ensure that only acceptable values can be entered for the current meter reading. Line 18 Another part of the program is shown below. … Line 25 SET meterDifference TO currentReading − previousReading Line 26 SET cost TO (meterDifference*unitCost)/100 … Using a programming language of your choice, write the code to • subtract £5 from the cost if the discount check box is selected • display the calculated electricity cost to two decimal places. A smart phone app is needed to calculate the cost of electricity. The following information will be entered by the user. • Previous meter reading • Current meter reading • Unit cost • Discount eligibility A possible user interface for the app is shown below. Electricity Cost Calculator Previous Meter Reading Units Current Meter Reading Units Unit Cost Pence Check box if eligible for £5 discount Electricity Cost 15007∙11 - 13823∙57 = 1183∙54 units used 1183∙54 units at 2∙835 pence per unit = £33∙553359 Final bill: £33∙55
Any two descriptions from • units used calculated (current-previous) • cost of units used calculated (units used * cost of unit) • check if the discount should be applied • subtract the discount • final bill is calculated • final cost is rounded • validate the input(s) No mark awarded for stating the ‘units used’, subtraction the wrong way round: previous-current One mark each for • pixels • each pixel stored as a binary value One mark each for • ASCII • 8 (or 7) Accept alternative answers such as • Unicode • 8 or 16 One mark each for • real • Boolean Do not accept: float, single, double Do not accept: yes, no, true, false One mark each for • 1500711 • 5 One mark each for • ending the loop • currentReading > previousReading OR currentReading >= previousReading If a candidate writes a pre- conditional loop award one each for • currentReading < previousReading • while rather than “end loop”. No marks for flow chart or structure diagram. One mark each for • IF • condition showing if the discount is selected • assignment of discounted cost within IF (cost – 5) • display with round to 2dp Allow formatted output to 2dp Allow assignment decrement abbreviation: cost=-5 Cost may be reassigned to a different variable name. For example: discount = cost – 5 No marks for flow chart or structure diagram.