ExamBank Scot · N5 Computing Science question bank · All N5 Computing Science questions
12 marks · Design techniques
State another design technique that could be used to design this program. State the type of loop shown in the design above. The design is tested using the following inputs: • 12 adults • 16 children • cake required ‑ Yes. State the venue cost. State the total cost of the party. A personalised party sweatshirt costs £12, with each character of the personalised message costing an additional 25p. Using a design technique of your choice, design a program to store the user’s message and output the total cost of the sweatshirt. The washing label on the sweatshirt has the following symbol. Identify an object used to make this symbol and one of its attributes. Object Attribute Once the program is implemented, state which part of the processor will execute the following tasks. Task Part of processor Calculate cost Transfer the next instruction from memory An event company organises children’s parties. They would like a program to help calculate the costs of parties. Part of the structure diagram design is shown below. Program - Party Cost Is cake Child Get Get Is number of Cost = (Child required? buffet number number adults + number buffet × number = £2.00 of of of children of children) + adults children >20 Cake + Venue yes no yes no Start loop for Venue Venue Cake Cake each child = £0 = £50 = £15.00 = £0 Get dietary requirements
pseudocode/flowchart fixed (£) 0 Accept ‘free’ (£) 47 Accept an answer that is £47 more than part (i) • get message from user • indication of length function to find number of characters from user’s message • calculation: characters * 0.25 + 12 • output cost Bullet 2 could be replaced with a loop (e.g. for each character in message). In this case bullet 3 would be replaced with a running total A calculation, without units, may not mix pounds or pence eg characters * 25 + 12 Object • ellipse/circle • rectangle/rect • line Attribute • x coordinate • y coordinate • line colour • fill colour • line thickness • length of side • radius • layer • transparency/opacity Award 1 mark for object and 1 mark for attribute matching the object given Second mark may still be awarded if attribute matches an incorrect object given: for example text, fill colour Do not allow ‘oval’ or ‘square’ as objects Calculate • ALU/Arithmetic Logic Unit Transfer • CU/Control Unit