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

N5 Computing Science 2014 Question 16

10 marks · Data types and structures

State the number of variables Jack would require in his program. Using pseudocode or a programming language of your choice, write a program to enter the required data, then calculate and display the profit for the soft drink business. Pseudocode Programming Language OR Jack adapts the program to ensure that water cost can only be entered as always greater than or equal to £0·10 and less than or equal to £0·50 per litre. State the standard algorithm that is used to ensure that data entered is acceptable. Complete the table below to show four different examples of test data for water cost and the type of each example. Test Data Type of Test Data 0·05 0·45 normal 0·10 extreme Jack has been asked to design a program to calculate the potential profit in a soft drink business. The program will store the costs involved in producing and selling one litre of each drink. The following calculations will be used to output the profit made for each litre of drink. Manufacturing Cost = Water Cost + Flavouring Cost + Labour Cost Profit = Selling Price − Manufacturing Cost

Marking scheme

6 Also accept 5 as program could include formula as: Profit = Selling Price – (Water Cost + Flavouring Cost + Labour) therefore Manufacturing Cost variable not required. 4 values input – Water Cost, Flavour Cost, Labour Cost, Selling Price (2 marks) (Award 2 or 3 values input (1 mark)) Manufacturing Cost = Water Cost + Flavouring Cost + Labour (1 mark) Profit = Selling Price – Manufacturing Cost (1 mark) Output of Profit (1 mark) If calculation combined into 1 line then award 2 marks Ignore whether candidates ticks pseudocode box or complete program language box. Candidates are asked to “write a program” and therefore must include details on the various inputs and calculations. For example: Get the 4 inputs Would be awarded no marks (Input) Validation Type of Test Data exceptional normal extreme extreme Test Data (Flavouring) 0.05 0.45 0.10 0.50

Previous question: N5 Computing Science 2014 Question 15

Next question: N5 Computing Science 2014 Question 17