Question 5

AQA Computer Science June 2025 Paper 1A (8525/1A)GCSE8 marks

On the specification

5.1
3.2 Programming
5.2
3.2 Programming
5.3
3.2 Programming
5.4
3.2 Programming
Question text

5 The C# program in Figure 5 gets five numbers and outputs the sum of those box numbers. Figure 5 int num1 = Convert.ToInt32(Console.ReadLine()); int num2 = Convert.ToInt32(Console.ReadLine()); int num3 = Convert.ToInt32(Console.ReadLine()); int num4 = Convert.ToInt32(Console.ReadLine()); int num5 = Convert.ToInt32(Console.ReadLine()); int total = num1 + num2 + num3 + num4 + num5; Console.WriteLine(total); 5.1 An integer data type is used in the program in Figure 5. Describe what is meant by a data type. [1 mark] The variables num1, num2, num3, num4 and num5 in Figure 5 have an integer data type. 5.2 Explain why these variables do not have a string data type. [1 mark] 5.3 The program in Figure 5 needs to be changed to use numbers with a fractional part (a real number). State a data type in C# that should be used. [1 mark] 5.4 Rewrite the program in Figure 5 so that it achieves the same result but uses an box iteration structure that contains only one Console.ReadLine()statement. Your answer must be written in C#. You should use meaningful variable name(s) and C# syntax in your answer. The answer grid below contains vertical lines to help you indent your code. [5 marks]