Question 5

OCR Computer Science Specimen Paper 1AS5 marks

On the specification

(a)(i)
1.4 Data types, data structures and algorithms
(a)(ii)
2.2 Problem solving and programming1.4 Data types, data structures and algorithms
Question text

5 Burger House is a fast food restaurant which wants to encourage healthy eating amongst its younger diners. (a) (i) Shown below in Fig.2 is the Burger House children’s menu. Children’s Menu Burgers Cheeseburger Grilled chicken burger (Healthy Option) Side Dishes French fries Salad (Healthy Option) Carrot Sticks (Healthy Option) Desserts Chocolate Brownie Fruit Salad (Healthy Option) Fig.2 Children receive a free toy when they select a meal (i.e. one burger, one side dish and one dessert) made up of only healthy options.Desserts Chocolate Brownie Let g be a Boolean value for if a child has chosen a grilled chicken burger. Let Fruit Salads be a Boolean value for if a child has chosen(Healthy Option) salad. Let c be a Boolean value for if a child has chosen carrot sticks. Let f be a Boolean value for if a child has chosen fruit salad. Let t be a Boolean value for whether a child receives a toy. Write an expression using Boolean algebra to determine whether a child receives a toy when they select a meal. t = [3] (ii) Burger House wants to add this logic into its' till system. Complete the code below assuming that g,s,c,f and t are Boolean variables with the same meaning as part (i). t=false if then endif