Garantie de satisfaction à 100% Disponible immédiatement après paiement En ligne et en PDF Tu n'es attaché à rien 4,6 TrustPilot
logo-home
Examen

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

Note
-
Vendu
-
Pages
98
Grade
A+
Publié le
12-01-2024
Écrit 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}");

Montrer plus Lire moins
Établissement
Computer Science
Cours
Computer Science











Oups ! Impossible de charger votre document. Réessayez ou contactez le support.

École, étude et sujet

Établissement
Computer Science
Cours
Computer Science

Infos sur le Document

Publié le
12 janvier 2024
Nombre de pages
98
Écrit en
2023/2024
Type
Examen
Contient
Seulement des questions

Sujets

€9,97
Accéder à l'intégralité du document:

Garantie de satisfaction à 100%
Disponible immédiatement après paiement
En ligne et en PDF
Tu n'es attaché à rien

Faites connaissance avec le vendeur

Seller avatar
Les scores de réputation sont basés sur le nombre de documents qu'un vendeur a vendus contre paiement ainsi que sur les avis qu'il a reçu pour ces documents. Il y a trois niveaux: Bronze, Argent et Or. Plus la réputation est bonne, plus vous pouvez faire confiance sur la qualité du travail des vendeurs.
twishfrancis Kaplan University
S'abonner Vous devez être connecté afin de suivre les étudiants ou les cours
Vendu
202
Membre depuis
2 année
Nombre de followers
42
Documents
10607
Dernière vente
4 heures de cela
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!!!

Lire la suite Lire moins
4,0

38 revues

5
22
4
6
3
4
2
0
1
6

Récemment consulté par vous

Pourquoi les étudiants choisissent Stuvia

Créé par d'autres étudiants, vérifié par les avis

Une qualité sur laquelle compter : rédigé par des étudiants qui ont réussi et évalué par d'autres qui ont utilisé ce document.

Le document ne convient pas ? Choisis un autre document

Aucun souci ! Tu peux sélectionner directement un autre document qui correspond mieux à ce que tu cherches.

Paye comme tu veux, apprends aussitôt

Aucun abonnement, aucun engagement. Paye selon tes habitudes par carte de crédit et télécharge ton document PDF instantanément.

Student with book image

“Acheté, téléchargé et réussi. C'est aussi simple que ça.”

Alisha Student

Foire aux questions