100% de satisfacción garantizada Inmediatamente disponible después del pago Leer en línea o como PDF No estas atado a nada 4,6 TrustPilot
logo-home
Examen

AQA GCSE COMPUTER SCIENCE Paper 1 Computational thinking and programming skills – C# 2023

Puntuación
-
Vendido
-
Páginas
98
Grado
A+
Subido en
12-01-2024
Escrito en
2023/2024

Figure 1 shows an algorithm, represented using pseudo-code, which assigns a different value to four variables. Figure 1 country  'United States of America' state  'California' city  'San Francisco' landmark  'Alcatraz Island' . 1 Define the term algorithm. The variable x is assigned a value using the statement: x  LEN(state) Using Figure 1, what is the value of x? Shade one lozenge. What is the result of concatenating the contents of the variables city and landmark in Figure 1? Shade one lozenge. The subroutine SUBSTRING extracts characters from a given string. For example, SUBSTRING(3, 5, 'Computing') would return put The variable y is assigned a value using the statement: y  SUBSTRING(4, 7, landmark) Using Figure 1, what is the value of y? Shade one lozenge. The subroutine POSITION finds the first position of a character in a string. For example, POSITION('Computing', 'p') would return 3 The variable z is assigned a value using the statement: z  POSITION(landmark, 't') Using Figure 1, what value is assigned to z? Shade one lozenge. Figure 2 shows an algorithm that uses integer division which has been represented using pseudo-code. • Line numbers are included but are not part of the algorithm. Figure 2 1 again  True 2 WHILE again = True 3 a  USERINPUT 4 IF a 0 THEN 5 counter  0 6 WHILE a 0 7 a  a DIV 3 8 counter  counter + 1 9 ENDWHILE 10 ELSE 11 again  False 12 ENDIF 13 OUTPUT a 14 ENDWHILE Integer division is the number of times one integer divides into another, with the remainder ignored. For example: • 14 DIV 5 evaluates to 2 • 25 DIV 3 evaluates to 8 11 Do not write outside the box Turn over ► IB/G/Jun23/8525/1A . 1 0 2 Where is iteration first used in the algorithm in Figure 2? Shade one lozenge. Figure 3 shows a program written in C# that calculates the area of a rectangle or the volume of a box from the user inputs. Figure 3 public static int calculate(int width, int length, int height) { if (height == -1) { return width * length; } else { return width * length * height; } } public static void Main() { int numOne, numTwo, numThree, answer; Console.Write("Enter width: "); numOne = Convert.ToInt32(Console.ReadLine()); Console.Write("Enter length: "); numTwo = Convert.ToInt32(Console.ReadLine()); Console.Write("Enter height, -1 to ignore: "); numThree = Convert.ToInt32(Console.ReadLine()); answer = calculate(numOne, numTwo, numThree); if (numThree == -1) { Console.WriteLine($"Area {answer}"); } else { Console.WriteLine($"Volume {answer}");

Mostrar más Leer menos
Institución
Computer Science
Grado
Computer Science











Ups! No podemos cargar tu documento ahora. Inténtalo de nuevo o contacta con soporte.

Escuela, estudio y materia

Institución
Computer Science
Grado
Computer Science

Información del documento

Subido en
12 de enero de 2024
Número de páginas
98
Escrito en
2023/2024
Tipo
Examen
Contiene
Solo preguntas

Temas

$11.49
Accede al documento completo:

100% de satisfacción garantizada
Inmediatamente disponible después del pago
Leer en línea o como PDF
No estas atado a nada

Conoce al vendedor

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
twishfrancis Kaplan University
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
208
Miembro desde
2 año
Número de seguidores
43
Documentos
10603
Última venta
2 semanas hace
SmartStudy Hub

Discover top-quality study materials at SmartStudy Hub. From concise summaries to exam guides, I offer resources designed to boost your grades. Trust in my expertise and elevate your academic performance today! NB: I do assignments too. Struggling to meet your academic deadlines? I\'ve got you covered! I\'ll ensure papers are delivered on time, each time. Don\'t let deadlines stress you out- let\'s work together to achieve your academic goals! WELCOME!!!

Lee mas Leer menos
4.0

38 reseñas

5
22
4
6
3
4
2
0
1
6

Documentos populares

Recientemente visto por ti

Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes