You are on page 1of 68

Wood Flooring

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:

• length of room (one decimal place)


• width of room (one decimal place)
• area of wood required (rounded up to next whole number)
• choice of wood index (whole number)
• price of wood required in dollars (two decimal places).

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.

Write a program that meets the following requirements:


• input a new customer’s name, room length and room width
• check that each measurement is valid
• output an error message and require the measurement to be re‐entered until it is valid
• calculate the area of the room by multiplying together the length of the room and the width of the room
• input the choice of wood and find its price per square metre
• calculate the price of the wood needed
• store all data in the relevant array
• output the customer’s quotation to include: the name of the customer, the choice of wood and the calculated
price of the wood required
• continue to accept the next customer.

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 will need to initialise WoodType[] and Price[]


All inputs and outputs must contain suitable messages.

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

2
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
3
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

Youth Park Run

A 1D array names[ ] stores the names of the participants of the youth park run

A 1D array age[ ] stores the ages of the participants

A 2D array races[ ] stores the 5 race times for each participant

The arrays names[ ],age[ ], races[ ] has already been set up and the data stored

Write a program that meets the following requirements:


- Display a menu showing the 3 actions available:

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

Write a program that meets the following requirements:


- Display a menu showing the 6 actions available to the staff member to choose from:
1. Members age information
- Output the average age of all members and the name and age of the oldest and youngest member
2. View members
- Displays each members details stored in the array members
3. Update membership status
- The membership status of a member can be changed to Active or Paused
4. View a members details
- Displays a single members details
5. Exit
- Exits the program
-
- All actions are completed by using procedures
- Actions 3-4 completed by a procedure with a parameter of name

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

A 2D array Player_data[ ] has five columns containing the following details:


- Column 1 stores the players name
- Column 2 stores the total number of goals scored
- Column 3 stores the total number of assists
- Column 4 stores the total number of yellow cards
- Column 5 stores the total number of red cards

The array and variable Player_data has already been set up and the data stored

Write a program that meets the following requirements:


- Display a menu showing the 3 actions available:
1. Display player stats
- displaying the players name, goals scored, assists, yellow & red cards that season
- action is completed by a procedure with a parameter of player_name
2. Update player stats
- User can select a player and is parameter passed into a procedure
- Users inputs new stats and array Player_data[ ]is updated
3. Exit
- Exit the menu system

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

A 2D array medal_data[ ] has four columns containing the following details:


- Column 1 stores the countries name
12
- Column 2 stores the total number of gold medals
- Column 3 stores the total number of silver medals
- Column 4 stores the total number of bronze medals

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

Write a program that meets the following requirements:


- Display a menu showing the 3 actions available:
1. Display the all countries medal data
- displaying the countries name, number of gold, silver & bronze medals
2. Display the country with the most number of gold medals
- Displaying the country name and number of gold medals
3. Display the country with the most number of silver medals
- Displaying the country name and number of silver medals
4. Display the country with the most number of bronze medals
- Displaying the country name and number of bronze medals
5. Display each country name and the average number of medals gained
5. Exit
- Exit the menu system
- All actions are completed by a procedure
- Actions 2-4 completed by a procedure with a parameter of ‘gold’ , ‘silver or ‘bronze’ depending on the
action.

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.

Develop a program that satisfies the following conditions:

● 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.

Additionally, the program should:


- Output a warning message if a max reading is higher than 200

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.

Average performance Performance rating

Greater than 85 Outstanding

Greater than or equal to 70 & less than or equal to 85 Excellent

Greater than or equal to 55 & less than 70 Average

Less than 55 Poor

Develop a program that satisfies the following criteria:

● 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.

Furthermore, the program should:

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.

Write a program that fulfils the following requirements:

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.

Temperature readings should be in the range 31.6 to 37.2 inclusive.


Pulse readings should be in the range 55 to 100 inclusive.

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:

• takes the hospital number as a parameter


• checks if the number is valid
• outputs an error message and exits the procedure if the number is not valid
• if the hospital number is valid:
– output the patient’s name
– output ‘Normal readings’ if both the readings are within range
– output ‘Warning’ and the name of the reading e.g. ‘Pulse’ if one reading is out of range
– output ‘Severe warning’ and the names of the two readings ‘Pulse and temperature’ if
both readings are out of range
– exits the procedure.

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.

Additionally, the program should:

- 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.

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.

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

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[]".

The information stored for each customer's order includes:

● Length of the cake (rounded to one decimal place)


● Width of the cake (rounded to one decimal place)
● Area of cake required (rounded up to the nearest whole number)
● Choice of cake index (whole number)
● Price of cake in dollars (rounded to two decimal places)

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[].

The available cake choices are listed below:


1 | Chocolate | 0.05 2 | Vanilla | 0.04 3 | Red Velvet | 0.06

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.

Develop a program that meets the following requirements:

● 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

A 2D array species_data[ ] has three columns containing the following details:


- Column 1 stores the species name
- Column 2 stores the country the species resides in
- Column 3 stores the total number species in the wild

A 2D array endangerment_level[ ] has two columns containing the following details:


- Column 1 stores the endangerment level
- Column 2 stores the number of species needed to classify that endangerment level

Endangerment levels are calculated as below:


Endangerment levels Species Numbers

Extinct 0

Critically Endangered 1 - 250

Endangered 251 - 2500

Vulnerable 2501 - 6000

Write a program that meets the following requirements:


- Display a menu showing the 4 actions available:
1. Display one species details
- Displaying the species name, number of species left, country of origin
- Display the current endangerment level, the number of species left until the species reaches a lower
endangerment level and the name of the lower endangerment level.
2. Display all species details
- Displaying each species name, number of species and country of origin
3. Display the most endangered species
- 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 species

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.

Additionally, the program should:

● 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.

Create a program that fulfils the following criteria:

● 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:

● Oxygen level, a whole number


● Heart rate, a whole number

The acceptable ranges for these readings are as follows:

● Oxygen level: between 5 and 34 percent


● Heart rate: between 8 and 62 beats per minute

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

Write a procedure that meets the following requirements:

● It takes the animal species name as a parameter.


● It checks if the provided animal species is valid. If not, it should allow the user to re-enter the species name until a
valid input
● If the animal species name is valid, it should:
● Output the animal's name.
● Output 'Normal readings' if both the oxygen level and heart rate are within the acceptable ranges.
● Output 'Warning' and specify which reading (or both) is out of range (e.g., 'Heart rate' or 'Oxygen levels')
if one reading is out of range.
● Output how far out of range the readings are, for example:
■ Oxygen reading for Beluga whale is 38, this is 4 percent out of range
● Then, it should exit the 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 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 two stores the number of avatars they have purchased.

• 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.

Write a program that meets the following requirements:


• checks the gamerID exists and the name and password entered by the account holder match the name and
password stored in Account[] before any action can take place

• 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
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

Air pollution levels

A 2D array countryAQI[ ] has three columns containing the following details:


- Column 1 stores the country name
- Column 2 stores the morning air quality reading
- Column 3 stores the afternoon air quality reading

A 2D array AQI_level[ ] has three columns containing the following details:


- Column 1 stores the air quality index colour
- Column 2 stores the level of concern
- Column 3 stores the range of index for each level

Index levels are calculated as below:


Air Quality Index colour Levels of concern Values of index

Green Good 0 to 50

Yellow Moderate 51 to 100

Orange Unhealthy(sensitive) 101 to 150

Red Unhealthy 151 to 200

Write a program that meets the following requirements:


- Display a menu showing the 4 actions available:
1. Display one countries details
- Displaying the country name, am and pm readings and colour index for am and pm
2. Display all countries average level of concern
- Displaying each countries name, the average of the am & pm readings and level of concern

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.

Players skill rating is based on their overall average performance:

● Greater than 80 = pro


● Greater than 65 and equal to or less than 80 = expert
● Less than or equal to 65 = amateur

Create a program that fulfills the following criteria:

● 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

A 2D array Loans[ ] has three columns containing the following details:


- column one stores bookID - the ISBN number
- column two stores the book title on loan
- column three stores if the book is overdue or not - yes / no

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

Write a program that meets the following requirements:


Allows the library admin staff to chose and perform the following actions:
1. Display members details
- Display MemberID, LastName
2. Overdue books
- Displays all overdue books with the outputs : MemberID, LastName, bookID and overdue status ‘yes’
3. Search by member
- Search by memberID and display the members LastName, book title and status
4. Book status
- Using a suitable message output the total number of library members, the number of books currently out
on loans and the total number of books overdue
- 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 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.

A 2D array CustomerDetails [ ] has two columns containing the following details:


- column one stores the point balance - the amount of loyalty points acquired by the customer, for example 221
- Column 2 stores the customers loyalty status - there are 3 levels: Bronze, Silver, Gold

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 variable CustomerNum contains the number of customers registered

The arrays and variable CustomerNum have already been set up and the data stored

Write a program that meets the following requirements:


- Display a menu showing the 2 actions available to the staff member to choose from:
1. Loyalty status numbers
- displaying the total number of bronze, silver & gold customers
2. Discount
- Checks customer exists by checking the customers first and last name entered by the staff member
match before any action takes place

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.

Write a program that meets the following requirements:


• counts and outputs 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 they are available

○ changes the status of the seats


○ outputs the row number and seat number for each seat booked

– if they are not available:

○ 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[ ]

All inputs and outputs must contain suitable messages.

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

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[]".

For each customer's order, the following information is stored:

● Length of the toy (rounded to one decimal place)


● Width of the toy (rounded to one decimal place)
● Surface area of the toy required (rounded up to the nearest whole number)
● Choice of toy index (whole number)
● Price of the toy in dollars (rounded to two decimal places)

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[].

The available toy choices are listed below:

1 Action figure 0.10

2 Doll 0.08

3 Lego set 0.12

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.

Write a program that meets the following criteria:

● 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.

Students are awarded a grade based on their average mark.

Write a program that meets the following requirements:


• calculates the combined total mark for each student for all their subjects
• calculates the average mark for each student for all their subjects, rounded to the nearest
whole number

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.

You do not need to initialise the data in the array.

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……
67
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

68
…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

…………………………………………………………………………………………………………………………………………………………………………………………………………………
……

69

You might also like