Questions

Databases and SQL 1

Study the table below (called ‘teachers’), which shows a selection of teachers of various subjects in a school. teacher subject Miss Small Maths Mrs Smith Maths Mr Jones English Mr White English Miss Green Maths Mrs Hughes Art Mr Morgan Computer Science Write the SQL query to return the names of teachers who teach ‘Maths’.

Databases and SQL 1 Read More »

File Handling 2

Study the code below and explain what it does, line by line. 001 newFile = open(“file.txt”) 002 while NOT newFile.endOfFile() 003         print(newFile.readLine()) 004 endwhile 005 newFile.close()

File Handling 2 Read More »

Arrays 2

The following modes of transport are stored in an array, with “transport” as the identifier: transport = [“car”, “bus”, “plane”, “boat”, “bicycle”] Complete the following output statement, so that the sentence it generates makes sense. print(“A ” + ______ + “travels through the air, whereas a” + ______ + “travels on water.”)

Arrays 2 Read More »

Arrays 1

Study the following arrays. x_numbers = [2,5,3,1,3,2,4,5,2] y_numbers = [[2, 5, 3], [1, 3, 2], [4, 5, 2]] a) What type of array is x_numbers? b) How would the value of 4 be access in the array x_numbers? c) What type of array is y_numbers? d) How would the value of 4 be access in

Arrays 1 Read More »

Shopping Cart