Input Validation (2 marks)
What is input validation, and why is it important in software development? Provide one example.
Input Validation (2 marks) Read More »
What is input validation, and why is it important in software development? Provide one example.
Input Validation (2 marks) Read More »
Describe the difference between local and global variables within the context of functions and procedures. Provide an example of how a global variable might be used differently than a local variable in a program.
Scope of Variables (4 marks) Read More »
Explain the difference between functions and procedures in structured programming. Include an example of when you might use each in a program.
Understanding Functions and Procedures (4 marks) Read More »
Consider the following two-dimensional array representing scores for students in different subjects, where each row represents a student and each column represents a subject (Math, Science, English): [[65, 70, 75], [80, 85, 90], [55, 60, 65]] Write lines of code to output the Science score for the second student and the English score for the
2D Array Index (2 marks) Read More »
Given a one-dimensional array of student names: [“Alex”, “Brian”, “Charlie”, “Diana”, “Elena”] Write lines of code that demonstrate outputting the name of the first and last student in the array.
1D Array Index (2 marks) Read More »
Describe how a two-dimensional array can be used to manage a simple database of student records. Assume each record has fields for student ID, name, and grade.
Two-dimensional Arrays and Databases. (3 marks) Read More »
Explain why arrays are used in programming. Give one reason why one-dimensional arrays are used and one reason why two-dimensional arrays are used.
Why Arrays are used in Programming (2 marks) Read More »
A table named Orders contains the columns OrderID, CustomerID, OrderDate, and Amount. Describe how you would write an SQL query to display the OrderID and Amount for all orders placed in the month of December, 2021, where the order amount was over £500. Include an explanation of your SQL command.
SQL Query 3. (5 marks) Read More »
Consider a database with a table named Customers that includes the columns CustomerID, FirstName, LastName, and City. Write an SQL query to find the full names of all customers who live in ‘London’.
SQL Query 2. (3 marks) Read More »
A database named LibraryBooks contains a table Books that has the following columns: BookID, Title, Author, and YearPublished. Write an SQL query to retrieve the titles of all books that were published after the year 2000.
SQL Query 1. (3 marks) Read More »