• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 4 fuera de 38 páginas
Examen

AQA A LEVEL Computer Science PAPER 2

Document preview thumbnail
Vista previa 4 fuera de 38 páginas

AQA A LEVEL Computer Science PAPER 2

Vista previa del contenido

AQA A LEVEL COMPUTER SCIENCE PAPER 2



AQA A LEVEL Computer
Science PAPER 2


AQA A LEVEL Computer
Science PAPER 2
H046-FREV-P2-2.3
INSTRUCTIONS TO CANDIDATES
• Write your name, centre number and candidate number in the boxes above. Please write clearly and in capital letters.
• Use black ink. HB pencil may be used for graphs and diagrams only.
• Answer all the questions, unless your teacher tells you otherwise.
• Read each question carefully. Make sure you know what you have to do before starting your answer.
• Where space is provided below the question, please write your answer there.
• You may use additional paper, or a specific Answer sheet if one is provided, but you must clearly show your candidate
number, centre number and question number(s).



INFORMATION FOR CANDIDATES
• The quality of written communication is assessed in questions marked with either a pencil or an asterisk. In History and
Geography a Quality of extended response question is marked with an asterisk, while a pencil is used for questions in
which Spelling, punctuation and grammar and the use of specialist terminology is assessed.
• The number of marks is given in brackets [ ] at the end of each question or part question.
• The total number of marks for this paper is 91.
• The total number of marks may take into account some 'either/or' question choices.


1(a) A program corrects the grammar in a line of text. The text is read in from a text file.


The function, getText, needs to:
• take the file name as a parameter
• open the file
• read the line of data in the text file into one string • return the string of data.

, Write the function getText.




[4]

(b) The procedure, fullStop, needs to:


• ask for a file name as input
• read the data from the file using the function getText
• replace the first letter after each full stop with a capital letter if it is currently lower case (if the next character is a space,
it must check each successive character until it finds a letter)
• write the edited data back to the text file.


You can assume the text file only contains upper and lower case letters, spaces and full stops.

,AQA A LEVEL COMPUTER SCIENCE PAPER 2

Part of the ASCII table has been provided:
ASCII Value Character

65 "A"

90 "Z"

97 "a"

122 "z"

32 " " (space)

46 "." (full stop)

The following functions may be used in your answer:


asc(character) returns the ASCII value for a single character, e.g. asc("A") would return 65.


upper(character) returns the single character in upper case, e.g. upper("a") would return “A”.

Write the procedure fullStop.

, (i) Give one reason why a function is used instead of a procedure in this scenario.




[1]


(ii) The parameter can be passed by value or by reference.

Información del documento

Subido en
28 de abril de 2026
Número de páginas
38
Escrito en
2025/2026
Tipo
Examen
Contiene
Preguntas y respuestas
$23.99

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

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.
PrincessKinsley
4.5
(120)
Vendido
237
Seguidores
115
Artículos
4307
Última venta
1 semana hace



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