CS 15 Marks Practice Questions
CS 15 Marks Practice Questions
CS 15 Marks Practice Questions
A wood flooring company stores the names of up to 100 customers in a one‐dimensional (1D) array
Customers[]. A two‐dimensional (2D) array Quotations[] stores details of each customer’s quotation:
The floor measurements (room length and room width) are taken in metres. All floors are rectangles and room
measurements must be between 1.5 and 10.0 inclusive.
The index of any customer’s data is the same in both arrays. For example, a customer named in index 4 of Customers[]
corresponds to the data in index 4 of Quotations[]
The wood choices available are: Index Wood type Price per square metre ($)
1 Laminate 29.99 2 Pine 39.99 3 Oak 54.99
The data are stored in two 1D arrays named WoodType[] and Price[]. The index of the wood type and price in their
arrays share the same index number.
You must use pseudocode or program code and add comments to explain how your code works.
You do not need to declare any arrays or variables; you may assume that this has already been done.
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
2
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
3
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
A 1D array names[ ] stores the names of the participants of the youth park run
The arrays names[ ],age[ ], races[ ] has already been set up and the data stored
4
1. Display personal best
- displaying each participants name and personal best race time
2. Displays a participant race number
- Race number consists of the first 2 letters of the participants name, the length of the name and their age
- For example Be57
3. Displays the number of participants in each race category
- 4-6
- 7-10
- 11-4
You must use pseudocode or program code and add comments to explain how your code works. All inputs and outputs
must contain suitable messages.
You do not need to declare and initialise the data in the global arrays names[ ],age[ ], races[ ]
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
5
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
6
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
Gym Membership
A 2D array members[ ] contains the Gym members name, age and membership status (Active or Paused).
The arrays members has already been set up and the data stored
You must use pseudocode or program code and add comments to explain how your code works. All inputs and outputs
must contain suitable messages.
You do not need to declare and initialise the data in the global array members[ ]
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
7
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
8
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
9
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
Football Stats
The array and variable Player_data has already been set up and the data stored
You must use pseudocode or program code and add comments to explain how your code works. All inputs and outputs
must contain suitable messages.
You do not need to declare and initialise the data in the global arrays Player_data[ ]
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
10
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
11
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
Olympics
1 2
medal_data = [["USA", 100, 90, 80],["China", 80, 70, 60]]
1 2 3 4 1 2 3 4
The array and variable medal_data[ ]has already been set up and the data stored
You must use pseudocode or program code and add comments to explain how your code works. All inputs and outputs
must contain suitable messages.
You do not need to declare and initialise the data in the global arrays medal_data[ ]
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
13
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
14
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
Travellers
A group of travellers is planning a journey on a tour bus for a single day trip. The bus has seating arranged in 10 rows, with
20 seats in each row. The reservation status of seats for the trip is stored in a two-dimensional Boolean array called
"BusSeats[ ]".
Each element in the array holds the value FALSE if the seat is available and TRUE if it's already booked.
A maximum of four seats can be reserved at a time. Seats are assigned in sequential order, and travellers cannot choose
specific row or seat numbers.
The "BusSeats[ ]" array has already been initialised with some data.
● Calculates and displays the total number of seats already booked for the trip.
● Allows travellers to input the number of seats they require.
● Validates the input provided by the users.
● Checks if enough seats are available:
● If seats are available:
15
● Updates the status of the seats.
● Outputs the row number and seat number for each reserved seat.
● If seats are not available:
● Outputs a message indicating the number of seats remaining or 'Bus Full' if all seats are booked.
Ensure to use pseudocode or programming code and incorporate comments to explain the functionality of your code.
Assume that all arrays and variables are declared and initialised prior to running the program.
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
16
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
17
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
Chemical plant
A monitoring system in a chemical plant records hourly chemical concentration data over the span of a week. This data is
stored in a two-dimensional (2D) array named Concentrations[ ], where each column represents 48 readings for a
single day. The array comprises seven columns, corresponding to each day of the week from Monday to Sunday.
To manage the chemical concentration data, the variables MaxD, MinD, and AvD are used to store the maximum,
minimum, and average concentration levels for a given day.
The array has been initialised, and the chemical concentration data is stored within it. To fulfil the specified requirements
for a chemical plant, a program must be developed with the following functionalities:
Identify the maximum and minimum concentration levels for each day.
Calculate the average concentration for each day.
Output, for each day:
- The name of the day (e.g., Monday).
- Maximum concentration level.
- Minimum concentration level.
- Average concentration level.
You must use pseudocode or program code and add comments to explain how your code works.
All inputs and outputs must contain suitable messages.
You do not need to declare any arrays or variables; you may assume that this has already been
done.
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
18
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
19
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
20
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
Employees
The 1D array EmployeeName[] contains the names of employees in a department. The 2D array
EmployeePerformance[] contains the performance ratings for each performance aspect (for example customer
service, punctuality etc), for each employee. The position of each employee's data in the two arrays corresponds, meaning
the employee in position 10 in EmployeeName[] and EmployeePerformance[] represents the same individual.
The variable DepartmentSize stores the total number of employees in the department. The variable
PerformanceCount indicates the number of performance aspects evaluated for each employee. All employees are
assessed based on the same set of performance aspects.
The arrays and variables have already been initialized with data.
Employees are awarded a performance rating based on their overall average performance.
● Computes the combined total rating for each employee across all aspects.
● Calculates the average rating for each employee across all aspects, rounding to the nearest whole number.
● Outputs for each employee:
● Name
● Combined total rating
● Average rating
● Grade awarded
● Determines, stores, and outputs the number of employees who receive distinctions, merits, passes, and fails in
the entire department.
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
21
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
22
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
Rainfall monitoring
A rainfall monitoring system records hourly data over the course of a week. The data is stored in a two-dimensional (2D)
array named rainfall [ ] , where each column represents 12 readings for a single day. The array comprises seven
columns, corresponding to each day of the week from Monday to Sunday.
The variables MaxDay, MinDay, and AvDay are employed to store the maximum, minimum, and average rainfall values
for a given day. Additionally, the variables MaxWeek, MinWeek, and AvWeek are utilised to store the maximum,
minimum, and average rainfall values for the entire week.
23
The array has already been initialised, and the rainfall data is stored within it.
To fulfil the specified requirements, a program needs to be developed with the following functionalities:
Identify the maximum and minimum rainfall values for each day.
Calculate the average rainfall value for each day.
Outputting, for each day:
- The name of the day (e.g., Monday).
- Maximum rainfall.
- Minimum rainfall.
- Average rainfall.
Determine the maximum and minimum rainfall values for the entire week.
Calculate the average rainfall for the week.
Output:
- Maximum rainfall for the week.
- Minimum rainfall for the week.
- Average rainfall for the week.
You must use pseudocode or program code and add comments to explain how your code works.
All inputs and outputs must contain suitable messages.
You do not need to declare any arrays or variables; you may assume that this has already been done.
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
24
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
25
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
Snapchat
In a SnapChat scenario, consider a two-dimensional (2D) array called SnapUsers[] containing account holders'
usernames and passwords for the platform.
Additionally, a 2D array named SnapUserDetails[ ] contains three columns with the following details:
● Column one stores the user's SnapCoin balance, which represents the amount of virtual currency they have for
purchasing filters and lenses.
● Column two stores the number of filters they have purchased.
● Column three stores the amount of extra SnapCoin they can spend if their balance is insufficient for a purchase
(i.e., credit).
For instance, a user wants to purchase a filter. They input the name of the filter and its cost. The system should determine
whether the purchase is feasible and provide appropriate messages. If the purchase is possible, the number of filters,
SnapCoin balance, and available credit should be updated accordingly.
The userID serves as the index for the user's data stored in the two arrays. For example, userID 20's details would be held
in: SnapUsers[20,1] and SnapUsers[20,2] SnapUserDetails[20,1], SnapUserDetails[20,2], and SnapUserDetails[20,3]
The variable "Size" contains the total number of SnapChat accounts. The arrays and the variable "Size" have already
been set up and populated with data.
26
● Checks whether the userID exists and verifies the entered username and password against the stored ones
before any action can proceed.
● Displays a menu showing the four actions available for the user to choose from:
Display SnapCoin balance
Purchase a filter
Deposit SnapCoin into account
Exit
● Allows the user to choose and complete an action. Each action is executed by a procedure with a parameter of
the userID.
You must use pseudocode or program code and add comments to explain how your code works.
All inputs and outputs must contain suitable messages. You only need to declare any local arrays and local variables that
you use.
You do not need to declare and initialise the data in the global arrays SnapUsers[] and SnapUserDetails[ ] and the
variable Size
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
27
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
28
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
Patients
The names of patients are stored in the one-dimensional (1D) array Patient[ ] of type string.
A separate two-dimensional (2D) array Readings[ ] stores the latest data recorded about each patient. The array
already contains the readings taken by a nurse for each patient:
• temperature measured to one decimal place
• pulse rate, a whole number.
The hospital number given to the patient is used for the index on both arrays, this is a value between 1 & 1000 inclusive.
When the data for a patient is checked a warning is given if any of the readings are out of range.
If both readings are out of range, then a severe warning is given.
Write a procedure, using pseudocode or program code, that meets the following requirements:
You must use pseudocode or program code and add comments to explain how your code works.
You do not need to initialise the data in the arrays.
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
29
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
30
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
Greenhouse
An industrial farming greenhouse captures soil moisture data every 4 hours a day throughout a week. This data is
organised in a two-dimensional (2D) array named SoilMoisture[ ], where each column represents 6 readings for a
single day. The array comprises seven columns, corresponding to each day of the week from Monday to Sunday.
31
To manage the soil moisture data, variables Max, Min, and Av are employed to store the maximum, minimum, and
average soil moisture levels for a given day.
The array has been initialised, and the soil moisture data is stored within it. To meet the specified requirements for the
agricultural greenhouse, a program must be created with the following functionalities:
● Identify the maximum and minimum soil moisture levels for each day.
● Calculate the average soil moisture for each day.
● Output, for each day:
● The name of the day (e.g., Monday).
● Maximum soil moisture level.
● Minimum soil moisture level.
● Average soil moisture level.
- Monitor if the soil becomes too wet or dry for the crops to grow.
- If the soil moisture is below 20 a warning message should be outputted to turn the sprinklers on
- If the soil moisture is above 55 a warning message should be outputted to open turn off the sprinklers for 24
hours
You must use pseudocode or program code and add comments to explain how your code works.
You do not need to declare any arrays or variables; you may assume that this has already been done.
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
32
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
33
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
Bakery
A bakery maintains a system to manage customer orders and quotations. The names of customers are stored in a
one-dimensional array named "Customers[]". Details about each customer's order are stored in a two-dimensional array
named "Quotations[]".
Cake dimensions are measured in centimeters. All cakes are rectangular, and the dimensions must be between 10 and 50
centimeters, inclusive.
The index of a customer's data corresponds in both arrays. For example, if a customer is stored in index 4 of
Customers[], their order details will be in index 4 of Quotations[].
34
The cake types and their respective prices are stored in two separate one-dimensional arrays named "CakeType[]" and
"Price[]". The index of the cake type and its price share the same index number.
● Allows input of a new customer's name, cake length, and cake width.
● Validates each measurement to ensure it falls within the acceptable range.
● Outputs an error message and prompts for re-entry if any measurement is invalid.
● Calculates the area of the cake by multiplying the length and width.
● Allows input for the choice of cake and retrieves its price per square centimeter .
● Calculates the price of the required cake.
● Stores all data in the relevant arrays.
● Outputs the customer's quotation, including the customer's name, choice of cake, and the calculated price of the
required cake.
● Continues to accept data for the next customer.
Ensure to incorporate pseudocode or program code and include comments to explain the functionality of your code.
Assume that all arrays and variables are declared and initialized before executing the program.
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
35
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
36
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
Endangered Species
Extinct 0
You must use pseudocode or program code and add comments to explain how your code works. All inputs and outputs
must contain suitable messages.
You do not need to declare and initialise the data in the global arrays species_data[ ] or endangerment_level[ ]
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
37
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
38
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
Wildlife Reserve
A wildlife reserve tracks animal sightings over the course of a week to monitor migration trends. The reserve is split into
two sections - east and west and the data is stored separately.
The data is stored in two seperate two-dimensional (2D) array named reserveWest[ ]and reserveWest[ ]. Each
column represents 3 sightings for a single day - am, noon and pm. The array consists of seven columns, representing
each day of the week from Monday to Sunday.
39
To manage the animal sighting data, variables MaxDay, MinDay, and AvDay are utilised to store the maximum, minimum,
and average number of sightings for a given day. Similarly, variables MaxWeek, MinWeek, and AvWeek are used to store
the maximum, minimum, and average number of sightings for the entire week.
The array has already been initialised, and the animal sighting data is stored within it. To meet the specified requirements
for a wildlife reserve scenario, a program must be developed with the following functionalities:
● Identify the maximum and minimum number of animal sightings for each day.
● Calculate the average number of animal sightings for each day.
● Output, for each day:
● The reserve name (e.g., reserve west)
● The name of the day (e.g., Monday)
● Maximum number of animal sightings.
● Minimum number of animal sightings.
● Average number of animal sightings.
● Compute the total number of animal sightings over the week in each reserve
● Output:
● The reserve name and the total number of sighting that week for the reserve with the greatest number of
animal sightings
You must use pseudocode or program code and add comments to explain how your code works. All inputs and outputs
must contain suitable messages.
You do not need to declare any arrays or variables; you may assume that this has already been done.
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
40
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
41
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
Cinema hall
Students are organising a film screening event at a cinema hall for a single evening. The cinema hall has a seating
arrangement of 10 rows, with 20 seats in each row. The booking status of seats for the evening is maintained in a
two-dimensional Boolean array named Evening[ ].
Each element in the array holds the value FALSE if the seat is available and TRUE if it's booked.
At most, four seats can be booked in a single transaction. Seats are allocated sequentially from the available ones, and
the user cannot specify a row or seat number.
The Evening[ ] array has already been initialised with some data.
● Counts and displays the number of seats already booked for the evening.
● Allows the user to input the number of seats required.
● Validates the input.
● Checks if enough seats are available:
● If seats are available:
● Updates the status of the seats.
● Displays the row number and seat number for each booked seat.
● If seats are not available:
● Outputs a message indicating the number of seats left or 'House full' if the cinema hall is fully
booked.
You must use pseudocode or program code and include comments to elucidate how your code operates.
Assume that all arrays and variables are declared and initialised beforehand.
42
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
43
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
44
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
Marine mammals
At a research facility studying marine mammals, data about individual animals is stored in arrays. The one-dimensional
array, Animal[], contains the names of the species of marine animals, while the two-dimensional array Readings[]
stores the latest recorded data for each animal. The data collected includes:
An important factor at the research facility is to monitor rescued marine animals. When checking the data for an animal,
the system should provide warnings if any of the readings are out of range.
● Asks the user which animal they would like to view the readings for
You must use pseudocode or program code and add comments to explain how your code works. All inputs and outputs
must contain suitable messages.
You do not need to declare any arrays or variables; you may assume that this has already been done.
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
45
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
46
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
Avatar
A two-dimensional (2D) array Gamer contains account holders’ names and passwords for a
gaming program.
47
A 2D array GamerDetails[ ] has three columns containing the following details:
• column one stores the gaming balance – the amount of money in a gamers account used for buying avatars
• column three stores the amount of extra money they can spend if their gaming balance is not enough to
purchase the avatar. Ie (Credit— the company allows)
Purchase example
- A gamer wants to purchase an avatar.
- The gamer enters the name of the avatar and how much it costs.
Suitable messages must be displayed if the gamer can buy the avatar or not.
If the purchase can take place, the number of avatars, gamers balance and credit available must be updated
(if required)
The gamerID gives the index of the gamers data held in the two arrays. For example, gamerID 20’s details
would be held in: Gamer[20,1] and Gamer[20,2] ,GamerDetails[20,1] GamerDetails[20,2] and
GamerDetails[20,3]
The variable Size contains the number of accounts. The arrays and variable Size have already been set up
and the data stored.
• displays a menu showing the four actions available for the account holder to choose from:
1. Display gamer balance
2. Buy an avatar
3. Deposit money into account
4. Exit
• allows an action to be chosen and completed. Each action is completed by a procedure with a parameter of
the gamer ID.
You must use pseudocode or program code and add comments to explain how your code works.
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
48
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
49
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
Green Good 0 to 50
50
3. Displays the number of countries in each ‘level of concern’ category
- Displaying the name of the species with the lowest number species left
4. Exit
- Exit the menu system
- All actions are completed by a procedure
- Action 1 completed by a procedure with a parameter of CountryName
You must use pseudocode or program code and add comments to explain how your code works. All inputs and outputs
must contain suitable messages.
You do not need to declare and initialise the data in the global arrays countryAQI[ ] or AQI_level[ ]
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
51
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
52
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
Sport team
The 1D array PlayerName[] contains the names of players in a sports team. The 2D array PlayerPerformance[]
contains the performance ratings for each skill aspect (e.g., shooting, dribbling, defense, etc.), for each player. The
position of each player's data in the two arrays corresponds, indicating that the player in position 8 in PlayerName[]
and PlayerPerformance[] represents the same individual.
The variable "TeamSize" stores the total number of players in the team. The variable "SkillCount" indicates the number
of skill aspects evaluated for each player. All players are assessed based on the same set of skill aspects.
The arrays and variables have already been initialized with data.
● Calculates the combined total rating for each player across all skill aspects.
● Computes the average rating for each player across all skill aspects, rounding to the nearest whole number.
● Outputs for each player:
● Name
● Combined total rating
● Average rating
● Skill rating category
● Outputs for the team:
● The total number of pro
● The total number of experts
● The total number of amateur’s
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
53
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
54
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
Library members
A 2D array Members[ ]contains the members details for a local library, storing: MemberID FirstName and LastName
The MemberID is the index of each customer's data held in the two arrays.
55
The variable TotalMembership contains the number of library members registered
The arrays Members, Loans and variable TotalMembership have already been set up and the data stored
You must use pseudocode or program code and add comments to explain how your code works. All inputs and outputs
must contain suitable messages.
You do not need to declare and initialise the data in the global arrays Members[ ] and Loans [ ] and the variable
TotalMembership.
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
56
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
57
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
Loyalty Cards
A 2D array Customer[ ] contains the customers first name and surname for a supermarket loyalty scheme.
The Customer ID is the index of each customer's data held in the two arrays.
For example, Customer ID 12’s details would be held in:
- Customer[12, 1] and Customer[12, 2]
- CustomerDetails[12, 1] and CustomerDetails[12, 2]
The arrays and variable CustomerNum have already been set up and the data stored
58
- calculates the discount depending on the customer loyalty status.
- Bronze receives 10% discount, Silver 20% discount, Gold 30% discount.
- Outputs the new price for a purchase
- Allows an action to be chosen and completed. Each action is completed by a procedure
You must use pseudocode or program code and add comments to explain how your code works. All inputs and outputs
must contain suitable messages.
You do not need to declare and initialise the data in the global arrays Customer[ ] and CustomerDetails [ ] and
the variable CustomerNum.
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
59
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
60
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
Drama Studio
Drama students put on a performance of a play for one evening. Seats in a small theatre can be booked for this
performance.
The theatre has 10 rows of 20 seats. The status of the seat bookings for the evening is held in the
two-dimensional (2D) Boolean array Evening[ ]
Each element contains FALSE if the seat is available and TRUE if the seat is booked.
Up to and including four seats can be booked at one time. Seats are allocated in order from those
available. A row or seat number cannot be requested.
The array Evening[ ]has already been set up and some data stored.
○ outputs a message giving the number of seats left or ‘House full’ if the theatre is fully booked.
You must use pseudocode or program code and add comments to explain how your code works.
You do not need to declare any arrays or variables; you may assume that this has already been done.
You do not need to initialise the data in the array Evening[ ]
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
61
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
62
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
Toy Store
63
A toy store keeps track of customer orders and quotations using an organised system. The names of customers are
stored in a one-dimensional array named "Customers[]". Details about each customer's order are recorded in a
two-dimensional array named "Quotations[]".
Toy dimensions are measured in centimeters. All toys are rectangular, and their dimensions must be within the range of 5
to 30 centimeters, inclusive.
The index of a customer's data corresponds in both arrays. For instance, if a customer is stored in index 4 of
Customers[], their order details will be found in index 4 of Quotations[].
2 Doll 0.08
The toy types and their corresponding prices are stored in two separate one-dimensional arrays named "ToyType[]" and
"Price[]". The index of the toy type and its price share the same index number.
● Allows input of a new customer's name, toy length, and toy width.
● Validates each measurement to ensure it falls within the acceptable range.
● Outputs an error message and prompts for re-entry if any measurement is invalid.
● Calculates the surface area of the toy by multiplying the length and width.
● Allows input for the choice of toy and retrieves its price per square centimeter.
● Calculates the price of the required toy.
● Stores all data in the relevant arrays.
● Outputs the customer's quotation, including the customer's name, choice of toy, and the calculated price of the
required toy.
● Continues to accept data for the next customer.
Make sure to include pseudocode or program code and provide comments to explain the functionality of your code.
Assume that all arrays and variables are declared and initialized before running the program.
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
64
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
65
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
Student marks
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.
66
• outputs for each student:
– name
– combined total mark
– average mark
– grade awarded
• calculates, stores and outputs the number of distinctions, merits, passes and fails for the
whole class.
You must use pseudocode or program code and add comments to explain how your code works.
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
67
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
68
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
69