Question 16

AQA Computer Science Specimen Paper 1A (8525/1A)GCSE2 marks

On the specification

3.2 Programming
Question text

16 Figure 7 shows part of a program written in C#. Figure 7 bool validChoice; int choice; validChoice = false; while (validChoice == false) { Console.Write("Enter your choice [1 - 10] "); choice = int.Parse(Console.ReadLine()); if (choice >= 1 & choice <= 10) { validChoice = true; } else { Console.WriteLine("Invalid choice"); } } Console.WriteLine("Valid choice"); Complete the following test plan for the code shown in Figure 7. Test Test data Expected result type Normal 5 Valid choice message displayed data Invalid data Boundary data [2 marks]