A programmer has written the VB.Net program in Figure 5 to add up the numbers between one and five - AQA - GCSE Computer Science - Question 14 - 2021 - Paper 1
Question 14
A programmer has written the VB.Net program in Figure 5 to add up the numbers between one and five.
Dim total As Integer = 0
Dim number As Integer = 0
For number = ... show full transcript
Worked Solution & Example Answer:A programmer has written the VB.Net program in Figure 5 to add up the numbers between one and five - AQA - GCSE Computer Science - Question 14 - 2021 - Paper 1
Step 1
B
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
Option B is the correct choice as it initializes a product variable to 1, uses a loop to multiply all numbers from 1 to 5 by updating the product variable, and then outputs the product. The code will correctly compute the multiplication of numbers between one and five.