Write My Paper Button

WhatsApp Widget

AcademixHelp – Original Academic Support You Can Trust

Top-quality academic writing and homework support — no AI tools, just real results.

Write  a  program  to  find  the  colour  of  square  X  on  a  board  with  colour  patterns.  Your program will ask a user to input the size of the board, which can be any odd integer from 3 to 9 inclusive. Imagine 2 diagonal

ICT 133 Structured Programming Tutor-Marked Assignment july 2025 Presentation

Academic Year 2025-26

ICT133 TUTOR-MARKED ASSIGNMENT (TMA)

This assignment is worth 24% of the final mark for ICT133, Structured Programming.

The cut-off date for this assignment is Sunday, 12 October 2025, 2355 hours.

Question 1 (20 marks)

This question covers materials in Seminar 1 and 2. Use and express selection structure for this question. Functions, repetition, or collections are not necessary for this question.

(a)  Write  a  program  to  find  the  colour  of  square  X  on  a  board  with  colour  patterns.  Your program will ask a user to input the size of the board, which can be any odd integer from 3 to 9 inclusive. Imagine 2 diagonal lines cutting across the board with no colours. The top triangle with be Green, bottom Red, left Yellow and right Blue. A size 7 board example is shown below.

ICT133 Structured Programming TMA

The  program  will  ask  the  user  for  the  row  and  column  numbers  of  square  X.  Column numbers start from 1 and run from left to right. Row numbers start from 1 and run from top to bottom. If X falls on the diagonals, the program shall print ‘No colour’, else it shall print the colour of square X. The program shall do error checking on size, row, column numbers and not ask the user for unnecessary inputs if the previous input already failed the check. Sample  runs  are given below.  Submit  and  paste  screenshots  of  at  least  FOUR  program executions, with different inputs. 

ICT133 Structured Programming TMA

(b) The pattern of the board has been changed to the type below. Write a program to ask a user to input the size of the board, which now must be an even integer from 4 to 10 inclusive. The program will ask the user for the row and column numbers of square X and print out the colour of square X or ‘No colour’ if it falls within the central white space. Submit and paste screenshots of at least FOUR program executions, with different inputs.

ICT 133 Structured Programming Tutor-Marked Assignment

Stuck Your ICT133 TMA Assignment? Deadlines Are Near?

Hire Assignment Helper Now!

Question 2 (30 marks)

This question covers materials up to Seminar 3. Make use of functions, selection and repetition structures. NO data structures like sets, lists or dictionary should be used for this question. The eval() function should not be used. Keep the program modular by defining other functions if necessary.

(a)  Make changes to the answer to 1(b) above and convert it into a function that receives input via  its  input  parameters  and  return  the  result  via  its  return  values.  Write  a  function getColour(size, row,  col)  which  takes in  3 integer parameters  containing the size  of the board, row and column numbers of square X. The function returns a single character value that represents the colour of square X: ‘G’, ‘B’, ‘R’, ‘Y’, ‘-‘ for Green, Blue, Red, Yellow and no colour respectively. If an error occurred, return an error message string that starts with ‘E’.

For example,

  • getColour(8,5,7) returns ‘-’ 
  • getColour(8,6,7) returns ‘R’

(b)  Making use of the function defined in part (a), write a program that will ask a user to input the size of the board, which must be an even integer from 4 to 10 inclusive, and prints out the board using characters to represent the colours. Sample runs are given below. Submit and paste screenshots of at least FOUR program executions, with different inputs.

ICT 133 Structured Programming Tutor-Marked Assignment
ICT 133 Structured Programming Tutor-Marked Assignment

(c)  Enhance the above to print out a board where rings of numbers cover the region with no colours, starting with 1 at the outermost ring and increasing by 1 as it moves towards the centre.  Sample  runs  are  given  below.  NO  data  structures  like  sets,  lists  or  dictionaries should be used. Submit and paste screenshots of at least FOUR program executions, with different inputs.

ICT133 Structured Programming TMA | SUSS

Question 3 (15 marks)

This question covers materials up to seminar 4. Employ structure programming and use of functions to make the program modular.

Write a multi-player game where everyone starts with a score of 501 points, with the aim of deducting it to 0 points within the least number of turns.

  • The program first asks for a list of unique player names, minimum 2 maximum 5 players.
  • The program will shuffle the list of players, with each player taking turns to play.
  • For each turn, a player can have up to 3 rounds.
  • For each round, the player will first choose a number between 1 to 20 inclusive or 25 to serve as the hit points.
  • The program will then randomly choose a multiplier of 1 or 2 if the chosen number is 25, or a multiplier of 1,2 or 3 if the chosen number is 1 to 20.
  • The product of these 2 numbers will be deducted from the player’s score.
  • The player would win if the player’s score ended up exactly zero provided the multiplier was 2. Display the number of turns he took and the game ends. For example, 
    o Player’s current score is 16 
    o Player chose 8 as the hit points 
    o Program randomly chose a multiplier of 2 
    o Player’s new score will be 16 – 8*2 = 0 points, which is a win
  • The player would go bust if the deduction resulted in a negative score, or a zero score when the multiplier was not 2, or a score of 1 which cannot be deducted to zero with a multiplier of 2 in the next round. The player’s score would then revert to his initial score at the start of his turn and the turn will pass to the next player. 

For example,

o Player’s current score is 16
o Player chose 8 as the hit points
o Program randomly chose a multiplier of 3 
o If deducted, the score will be negative, i.e. 16 – 8*3 = -8, which is a bust

  • If the player did not win and did not go bust, he will play 3 rounds before the turn passes to the next player.  A sample run is given below. Submit and paste screenshots to show a sample run of your game.

Question 4 (35 marks)

This question covers materials up to seminar 4. Employ structure programming and use of functions to make the program modular.  Silver Screen is a cinema operator looking for a simple application to help them manage seat bookings.

  • A cinema has between 3 to 10 (both inclusive) rows of seats. Each row has the same number of seats which can range between 3 to 10 (both inclusive).
  • Rows are numbered ‘01’, ‘02’, ‘03’, …, starting from the row just in front of the screen. Seats are numbered ‘A’, ‘B’, ‘C’, …, starting from the left when facing the screen.
  • When displaying a seating plan, available seats are marked with ‘O’, while booked seats are marked with ‘X’. An example of a 5 rows x 8 seats cinema with 4 seats booked is shown below.
ICT133 Structured Programming TMA Question

(a) Write a menu-driven application to manage the seat booking process. The application will first ask the user to input the number of rows and the number of seats per row to initialize a seating plan as a nested list. This nested list shall consist of a list of rows where each row is a list of seats. For example, the initial seating plan of the above cinema is represented by the nested list below.

ICT133 Structured Programming TMA Question
  • Next, the application will go into a loop, presenting the user with a menu of options. The user should be able to choose between displaying the current seating plan, booking of seats, or quitting the application. Structure your program using functions to make it modular and easy to add new options in the future.
  • If the user chooses to display the seating plan, show the seating plan in a format similar to the above and return to the main menu.
  • If the user chooses to book seats, display the current seating plan and ask the user to input the location and the number of seats to book in the format ‘@NN-#’, where @ represents the seat label A,B,C,…, NN is a 2-digit number representing the row, and # is the number of seats to book. For example, ‘C05-4’ is a request to book 4 seats starting from row 5 seat C. Users can only book continuous seats on the same row. If all seats are available, the function will update the booked seats with ‘X’ and display the updated seating plan. If not, it will display an error message and return to main menu.
  • Allow the user to continue choosing other menu options until he/she chooses option to quit.
  • Sample runs are given below.  Submit  and  paste screenshots to show  at  least  FOUR different features of your new application.

(b) Enhance the above application with a new option to auto select the best seats to book. With this option, the user will only need to input the number of seats required and the application will find the best seats to book. It will start from the last row and work forward towards the screen. In each row, it will try to find available seats as close to the centre of the row as possible. Selected seats should form a continuous row that has the required number of seats. The seats cannot span multiple rows and cannot have gaps in between seats.

  • If such seats are found, the application will ask the user for confirmation to book. If the user agrees, update the seating plan marking those seats as ‘X’ and display the updated seating plan.
  • If the user is not satisfied with the seats found, continue to find the next best seats until he/she agrees or no more available seats can be found.
  • The user can opt to return to main menu at any step.
  • Sample runs are given below. Submit and paste screenshots to show at least FOUR key features of your new application.
Write  a  program  to  find  the  colour  of  square  X  on  a  board  with  colour  patterns.  Your program will ask a user to input the size of the board, which can be any odd integer from 3 to 9 inclusive. Imagine 2 diagonal
Scroll to top

Get 40% off! ✨ Instant Help from Our Experts Awaits! Don’t miss out! 💡

X