Figure 7 shows part of a program written in C# - AQA - GCSE Computer Science - Question 16 - 2021 - Paper 1
Question 16
Figure 7 shows part of a program written in C#.
bool validChoice;
int choice;
validChoice = false;
while (validChoice == false)
{
Console.Write("Enter your choi... show full transcript
Worked Solution & Example Answer:Figure 7 shows part of a program written in C# - AQA - GCSE Computer Science - Question 16 - 2021 - Paper 1
Step 1
Normal data
96%
114 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
The test data is 5, which is a valid choice within the range of 1 to 10. Therefore, the expected result is a valid choice message displayed.
Step 2
Invalid data
99%
104 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
The test data can be any value outside the range of 1 to 10 inclusive. For example, inputs like -1 or 11 should prompt an 'Invalid choice' message.
Step 3
Boundary data
96%
101 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
The boundary test data includes values of 0, 1, 10, or 11. Specifically:
If 1 or 10 is entered, the program should display a valid choice message.
If 0 or 11 is entered, an 'Invalid choice' message should be displayed.