9608_s17_qp_12
A paper of Computer Science, 9608
Questions:
6
Year:
2017
Paper:
1
Variant:
2

Login to start this paper & get access to powerful tools

1
Some shops belong to the Rainbow Retail buying group. They buy their goods from one or more suppliers. Each shop has: • a unique shop ID • a single retail specialism (for example, food, electrical, garden). Each supplier has: • a unique supplier ID • a similar single specialism recorded. Rainbow Retail creates a relational database to record data about the shops and their suppliers. The entity-relationship (E-R) diagram for the relationship between the SHOP and SUPPLIER tables is shown. SHOP SUPPLIER Explain what the degree of relationship is between the entities SHOP and SUPPLIER. The database design is as follows: SHOP(ShopID, ShopName, Location, RetailSpecialism) SUPPLIER(SupplierID, SupplierName, ContactPerson, RetailSpecialism) SHOP-SUPPLIER(ShopID, SupplierID) The SHOP–SUPPLIER table stores the suppliers that each shop has previously used. Primary keys are not shown. Label the entities and draw the relationships to complete the revised E-R diagram. SUPPLIER Complete the following table to show for each database table: • the primary key • the foreign key(if any): ° Each table may contain none, one or more foreign key. ° For a table with no foreign key, write ‘None’. • an explanation for the use of any foreign key. Table Primary key Foreign key(if any) Explanation SHOP SUPPLIER SHOP–SUPPLIER The database designer has implemented SUPPLIER.ContactPerson as a secondary key. Describe the reason for this. Write an SQL query to display the shop ID and location of all shops with a ‘GROCERY’ specialism. The existing shop with ID 8765 has just used the existing supplier SUP89 for the first time. Write an SQL script to add this data to the database.
2
3
4
5
The following table shows part of the instruction set for a processor. The processor has one general purpose register, the Accumulator (ACC), and an Index Register (. Instruction Explanation Op code Operand Op code LDD 0001 0011 Direct addressing. Load the contents of the location at the given address to the Accumulator (ACC). LDI 0001 0100 Indirect addressing. The address to be used is at the given address. Load the contents of this second address to ACC. LDX 0001 0101 Indexed addressing. Form the address from + the contents of the Index Register. Copy the contents of this calculated address to ACC. LDM #n 0001 0010 Immediate addressing. Load the denary number n to ACC. LDR #n 0001 0110 Immediate addressing. Load denary number n to the Index Register (. STO 0000 0111 Store the contents of ACC at the given address. The following diagram shows the contents of a section of main memory and the Index Register (. Show the contents of the Accumulator (ACC) after each instruction is executed. IX LDD 355 ACC LDM #355 ACC LDX 351 ACC LDI 355 ACC Address Main memory contents Each machine code instruction is encoded as 16 bits (8-bit op code followed by an 8-bit operand). Write the machine code for these instructions: LDM #67 LDX #7 Computer scientists often write binary representations in hexadecimal. Write the hexadecimal representation for the following instruction. A second instruction has been written in hexadecimal as: 16 4D Write the assembly language for this instruction with the operand in denary.
6
Downloading a file from a website is an example of a client-server application. Describe what is meant by the term client-server for this application. The following sequence of steps (1 to 5) describes what happens when someone uses their personal computer (PC) to request a web page. The web page consists of HTML tags and text content only. Four of the statements from A, B, C, D, E and F are used to complete the sequence. A Browser software interprets the script, renders the page and displays. B Browser software renders the page and displays. C Browser software compiles the script, renders the page and displays. D The web server retrieves the page. E The Domain Name Service (DNS) uses the domain name from the browser to look up the IP address of the web server. F The web server sends the web page content to the browser. Write one of the letters A to F in the appropriate row to complete the sequence. 1. The user keys in the Uniform Resource Locator (URL) into the browser software. 2. 3. 4. 5. The following web page used for data capture consists of: • two text boxes for the entry of: ° a race runner’s ID code ° their finishing position in a race. • a button that the user clicks to submit this runner’s result. Untitled Document function myButton_onmousedown() { var Output1 = "Runner ID OK"; var Output2 = "ERROR – entry refused"; var Runner ID = document.forms["form1"]["txtRunnerID"].value; // || in Javascript is the 'OR' operator if (RunnerID.substr(0,3) == "VAR" || RunnerID.substr(0,3) == "CAM") { alert(Output1) } else { alert(Output2) } } Runner ID: Position: Save data: The developer has used three variables in the JavaScript code. State the identifiers used. 1. 2. 3. The button has an event whose identifier is onMouseDown. When the mouse button is clicked, some code is run. State the line numbers which contain this code. From line to line The JavaScript code uses a selection statement. State the line number which contains its condition. Line number: Describe the purpose of the validation check that the code performs. Name and describe two other types of validation check which could be appropriate for this data capture form. Validation check: Description Validation check: Description