Computer Science 15 Marks Questions p2
Computer Science 15 Marks Questions p2
Scenario
Questions
Practice
-sockette
QUESTION
11 A times table test will be set up. Before using
the test, the user can set the times table to be
tested and the number of questions to be asked. The
times tables can be any whole number between 2 and
12 inclusive. The number of questions can be between
5 and 10 inclusive. No questions can be the same in
any test. The name of the user should be displayed
with all messages and prompts.
Python
Cambridge IGCSE™ and O Level Computer Science Second Edition Study and Revision Guide
© Hodder & Stoughton Ltd 2022
Cambridge IGCSE™ and O Level Computer Science
Visual Basic:
Module Module1
Sub Main()
Dim Name, Choice As String
Dim Table, Questions, QuestionNumber, Right, Answer As Integer
Dim ReTest As Boolean
' set up staring conditions
Console.Write("Please enter your name ")
Name = Console.ReadLine()
Do
Console.Write("Please enter a table between 1 and 12 ")
Table = Int(Console.ReadLine())
Loop Until Table >= 1 And Table <= 12
Do
Console.Write("Please enter the number between 5 and 10 ")
Questions = Int(Console.ReadLine())
Loop Until Questions >= 5 And Questions <= 10
ReTest = True
' conduct the test
Do
Right = 0
For QuestionNumber = 1 To Questions
Console.WriteLine("Question " & QuestionNumber)
Console.WriteLine(Table & " X " & QuestionNumber)
Answer = Int(Console.ReadLine())
If Answer = QuestionNumber * Table Then
Console.WriteLine(Name & " you are right well done")
Right = Right + 1
Else
Console.WriteLine(Name & " you are wrong the answer is " & Table *
QuestionNumber)
End If
Next
Console.WriteLine("Test over " & Name & " you got " & Right & " out of "
& Questions)
Console.WriteLine("Do you want a retest Y or N?")
Choice = Console.ReadLine()
If Choice <> "Y" Then
ReTest = False
End If
Java:
import java.util.Scanner;
class ExamQ11Java
{
public static void main(String args[])
{
// set up starting conditions
Scanner myObj = new Scanner(System.in);
String Name;
System.out.print("Please enter your name ");
Name = myObj.next();
int Table;
do
{
System.out.print("Please enter a table between 1 and 12 ");
Table = myObj.nextInt();
}
while (Table < 1 || Table > 12);
int Questions;
do
{
System.out.print("Please enter the number of questions between 5 and 10 ");
Questions = myObj.nextInt();
}
while (Questions < 5 || Questions > 12);
Cambridge IGCSE™ and O Level Computer Science Second Edition Study and Revision Guide
© Hodder & Stoughton Ltd 2022
QUESTION
SPECIMEN 2A
13 The 1D array StudentName[] contains the names of students in a class.
The 2D array
StudentMark[] contains the mark for each subject, for each student. The
position of
each student’s data in the two arrays is the same, for example, the student
in position 10 in
StudentName[] and StudentMark[] is the same.
The variable ClassSize contains the number of students in the class. The
variable SubjectNo
contains the number of subjects studied. All students study the same number
of subjects.
The arrays and variables have already been set up and the data stored.
Students are awarded a grade based on their average mark.
You must use pseudocode or program code and add comments to explain how
your code works.
© UCLES 2020 0478/02/SP/23
You do not need to initialise the data in the array.
MARKSCHEME
SPECIMEN 2A
0478/02 Cambridge IGCSE – Mark Scheme
For examination
// meaningful identifier names and appropriate data structures (variables, constants and the
// given arrays) to store all the data required
DECLARE TotalMark : ARRAY[1:50] OF INTEGER
DECLARE AverageMark : ARRAY[1:50] OF INTEGER
DECLARE SubjectCounter : INTEGER
DECLARE StudentCounter : INTEGER
DECLARE DistinctionNo : INTEGER
DECLARE MeritNo : INTEGER
DECLARE PassNo : INTEGER
DECLARE FailNo : INTEGER
CONSTANT Distinction = 70
CONSTANT Merit = 55
CONSTANT Pass = 40
// initialisation processes for this scenario, initialising the running totals used for
// grades and combined totals
DistinctionNo 0
MeritNo 0
←
PassNo 0
←
FailNo 0
←
←
FOR StudentCounter 1 to ClassSize
TotalMark[StudentCounter] 0
←
NEXT StudentCounter
←
// programming techniques of iteration, selection, totalling, counting and output are used
Techniques
Procedure
required: R1 that takes the hospital number as a parameter (use of procedures and parameters)
R2 Check if hospital number valid (selection, use of 1D array)
R3 Check temperature reading (selection, use of 2D array)
R4 Check pulse reading (selection, use of 2D array)
R5 Output appropriate messages for each selection (output with appropriate messages)
15 Write and test a program that uses a two-dimensional array, Game[] to store the moves
in a noughts and crosses game. The program should meet the following requirements:
» each game with an empty array.
Start
» Allow two players to input their moves in turn; the contents of the array are displayed
before
and after every move.
» One player can input O and the other input X; no other moves are allowed, and no move
can
use a space in the array already occupied.
» After every move the program should check for a completed line of three Os or three Xs,
and
if found output the winner of the game.
» procedures and parameters.
Use
»
Include comments to explain how your code works.
...............................................................................................................................................................................
..
...............................................................................................................................................................................
..
...............................................................................................................................................................................
..
...............................................................................................................................................................................
..
...............................................................................................................................................................................
..
...............................................................................................................................................................................
..
...............................................................................................................................................................................
..
...............................................................................................................................................................................
..
...............................................................................................................................................................................
..
...............................................................................................................................................................................
..
...............................................................................................................................................................................
..
54 Photocopying prohibited Cambridge IGCSE and O Level Computer Science Algorithms, Programming and Logic Workbook
...............................................................................................................................................................................
..
QUESTION
A programmer has been asked to design and write a program to
accept inputs about each game player:
• name
• age in years
• nickname
• if the player wants to use their name or their nickname.
[12]
[1O]
MARKSCHEME
QUESTION
The one-dimensional array BabyName[] contains the names of
the babies in a nursery.
Another one-dimensional array ParentPhone [] contains the
phone numbers for the parents of the baby.
A final one-dimensional array BabyAge[] contains the baby's
age in months.
[12]
MARKSCHEME
IGCSE Computer Science - Paper 2 - Feb/March 2023
(Unofficial ~ Past Paper hasn't been released yet)
You must:
- Calculate and store the total points scored
- Calculate and display the total points for all matches in
each category (away win, home win, draw, loss)
- Calculate and display the total team points, total team
points for each category and name for each of the teams
- Find and display the name of the team with the highest and
lowest points
[15]
(Unofficial Python Markscheme by S_Skamr ~ Past Paper hasn't been
released yet)
"""
MAPPINGS
0: Loss
1: Draw
2: Home Win
3: Away Win
They start with 0 so it can be easily used to index into a list that
stores every count for the mappings - helpers.
"""
# Maps each index to the required message when printing - for eg. an index
of 1 corresponds to the returned message "Draws" which can be used to
display the required details for draws
def mapMsg(index):
return ["Losses", "Draws", "Home wins", "Away wins"][index]
# Print the team with the lowest and highest points and their names
print(f"Lowest scoring team with {lowest[1]} points is {lowest[0]}.")
print(f"Highest scoring team with {highest[1]} points is {highest[0]}.")
IGCSE CS SCENARIO QUESTIONS
CHAT GPT
QUESTIONS