Photo AI

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 icon

Question 14

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.png

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

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.

Join the GCSE students using SimpleStudy...

97% of Students

Report Improved Results

98% of Students

Recommend to friends

100,000+

Students Supported

1 Million+

Questions answered

;