0% found this document useful (0 votes)
41 views

IGCSE Coding Questions

Uploaded by

igcsesb
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views

IGCSE Coding Questions

Uploaded by

igcsesb
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

1.

Students in a class are recording the amount of time in minutes spent in front
of a screen for each day of the week.
The one-dimensional (1D) array StudentName[] contains the names of the
students in the class. The two-dimensional (2D) array ScreenTime[] is used to
input the number of minutes on each day spent in front of a screen.
The position of each student’s data in the two arrays is the same. For
example, the student stored at index 10 in StudentName[] and ScreenTime[]
is the same.
The variable ClassSize contains the number of students in the class. Write a
program that meets these requirements:
• allows all the students to enter their daily minutes of screen times for the
past week
• calculates the total number of minutes of screen time for each student in the
week
• counts, for each student, the number of days with more than 300 minutes of
screen time
• calculates the average weekly minutes of screen time for the whole class
• finds the student with the lowest weekly minutes of screen time
• outputs for each student: – name – total week’s screen time in hours and
minutes – number of days with more than 300 minutes of screen time
• outputs the average weekly minutes of screen time for the whole class
• outputs the name of the student with the lowest weekly screen time.
You must use pseudocode or program code and add comments to explain
how your code works.
All inputs and outputs must contain suitable messages. Assume that the array
StudentName[] and the variable ClassSize already contain the required data.
You do not need to declare any arrays or variables; you may assume that this
has already been done.

2. A programmer has written a program that will be maintained by another


programmer. Explain how the program can be written to make sure it can be
easily maintained by the other programmer.

3. Describe two types of iteration that a programmer can use whilst writing a
program.

4. Identify three data types used in programming.


Pseudocode

5. An algorithm has been written to test if an integer that is input is in the range 5
to 10 inclusive. Identify an example of suitable test data for each test data
type.

6. Write an algorithm in pseudocode to input a number, MyNumber, and use a


linear search to test if that number is stored in the array. If the number is
found in the array, the position in the array is output. If the number is not
found in the array, “Not found” is output.

7. Write an algorithm in pseudocode to sort the array Values[1:50] into


ascending order using a bubble sort.

You might also like