Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Midterm Exam 2 Questions for Information Delivery on Internet | CS 655, Exams of Computer Science

Material Type: Exam; Class: Info Delivery on Internet; Subject: Computer Science; University: Wichita State University; Term: Fall 2003;

Typology: Exams

2009/2010

Uploaded on 02/24/2010

koofers-user-szl
koofers-user-szl 🇺🇸

10 documents

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CS 665 Information Delivery on the Internet Exam 2 - Name:
Fall 2003
Part 1: (36 p oints - 3 points for each problem)
( B ) 1. Which cookie parameter is used to specify the expiration time of a cookie?
(A) expiredtime (B) expires (C) setexpire (D) setlife
( A ) 2. Which file stores the directives that control an Apache server’s behavior?
(A) httpd.conf (B) srm.conf (C) access.conf (D) ssl.conf
( B ) 3. Which directive is used to specify the index file for a directory in the Apache server?
(A) DirectoryDefault (B) DirectoryIndex (C) DirectoryRoot (D) DirectoryAlias
( D ) 4. Which of the following lines in Java will compile without warning or error?
(A) float f = 1.3; (B) char c = ”a”; (C) byte b = 257; (D) None of above
( C ) 5. In Java, the keyword(s) that every typed method must have is:
(A) void (B) typedef (C) return (D) public static void
( C ) 6. Which keyword is used to indicate a call to a superclass constructor or method in Java?
(A) default (B) parent (C) super (D) superclass
( A ) 7. Which keyword in Java can be used to declare a class cannot be instantiated?
(A) abstract (B) constant (C) final (D) static
( B ) 8. Which of the following is not a keyword or reserved word in Java?
(A) if (B) then (C) goto (D) case
( D ) 9. In a relational database, a table has at least one column that uniquely identifies the rows of
the table. The value in this special column is called
(A) main key (B) special key (C) unique key (D) primary key
( A ) 10. Which SELECT clause value means to select all the columns of the specified table that meet
the condition?
(A) (B) ? (C) . (D) $
( D ) 11. Which SQL command is used to join one or more of the tables?
(A) UPDATE (B) MODIFY (C) JOIN (D) SELECT
( D ) 12. Which method in DBI is used to create a compiled version of a SQL command?
(A) compile (B) execute (C) generate (D) prepare
Part 2: (64 p oints)
1. Briefly explain these terminologies. If they are acronyms, also write what they stand for. (12 points)
(a) Virtual Host A virtual host is built to host multiple sites that share the same physical system.
(b) SQL The Structured Query Language (SQL) is a standard language for specifying accesses and
modifications to databases.
(c) ODBC Open Database Connectivity (ODBC) is an open standard application programming
interface (API) for accessing a database.
(d) Applet An Applet is a Java program that can be resident on the server and downloaded to the
brower.
pf3
pf4

Partial preview of the text

Download Midterm Exam 2 Questions for Information Delivery on Internet | CS 655 and more Exams Computer Science in PDF only on Docsity!

CS 665 Information Delivery on the Internet Exam 2 - Name: Fall 2003

Part 1: (36 points - 3 points for each problem)

( B ) 1. Which cookie parameter is used to specify the expiration time of a cookie? (A) expiredtime (B) expires (C) setexpire (D) setlife

( A ) 2. Which file stores the directives that control an Apache server’s behavior? (A) httpd.conf (B) srm.conf (C) access.conf (D) ssl.conf

( B ) 3. Which directive is used to specify the index file for a directory in the Apache server? (A) DirectoryDefault (B) DirectoryIndex (C) DirectoryRoot (D) DirectoryAlias

( D ) 4. Which of the following lines in Java will compile without warning or error? (A) float f = 1.3; (B) char c = ”a”; (C) byte b = 257; (D) None of above

( C ) 5. In Java, the keyword(s) that every typed method must have is: (A) void (B) typedef (C) return (D) public static void

( C ) 6. Which keyword is used to indicate a call to a superclass constructor or method in Java? (A) default (B) parent (C) super (D) superclass

( A ) 7. Which keyword in Java can be used to declare a class cannot be instantiated? (A) abstract (B) constant (C) final (D) static

( B ) 8. Which of the following is not a keyword or reserved word in Java? (A) if (B) then (C) goto (D) case

( D ) 9. In a relational database, a table has at least one column that uniquely identifies the rows of the table. The value in this special column is called (A) main key (B) special key (C) unique key (D) primary key

( A ) 10. Which SELECT clause value means to select all the columns of the specified table that meet the condition? (A) ∗ (B)? (C). (D) $

( D ) 11. Which SQL command is used to join one or more of the tables? (A) UPDATE (B) MODIFY (C) JOIN (D) SELECT

( D ) 12. Which method in DBI is used to create a compiled version of a SQL command? (A) compile (B) execute (C) generate (D) prepare

Part 2: (64 points)

  1. Briefly explain these terminologies. If they are acronyms, also write what they stand for. (12 points)

(a) Virtual Host A virtual host is built to host multiple sites that share the same physical system. (b) SQL The Structured Query Language (SQL) is a standard language for specifying accesses and modifications to databases. (c) ODBC Open Database Connectivity (ODBC) is an open standard application programming interface (API) for accessing a database. (d) Applet An Applet is a Java program that can be resident on the server and downloaded to the brower.

  1. Explain third-tier architecture of a Web site supported by databases. (6 points) Ans:

Database Client (Browser)

Web Server and Database Applications

Database System

(a) The first tier has the Web browser, which provides the user interface. (b) The middle tier has Web server and the applications that require database access. (c) The third tier has the database system and the database itself.

  1. What is a session to a Web server? What is a cookie? (6 points) Ans:

(a) A session to a Web server is the collection of all the requests made by a particular browser from the time the browser is started until the user exits the browser. (b) A cookie is an object that is sent the server to a connected browser, where it is stored.

  1. Consider the following Java code. Write the result after running it in the command line as follows: java Hello Natalie Wood Jay Douglas Leno

public class Hello { public static void message (int i, String args[]){ String Hello = "Hello! "; Hello += args[i--] + " " + args[i]; System.out.println(Hello); } public static void main(String args[]){ for(int i = 1; i < args.length; i++) message(i++, args); } }

(6 points) Ans:

Hello! Wood Natalie Hello! Douglas Jay

  1. Consider the following two database tables. Use the SQL command to get a list of the album title and the first and last name of the singers whose album is released in 2002. (6 points) Artist ID Firstname Lastname 1001 Avril Lavigne 2002 Alanis Morissette 3003 Sarah McLachlan

Artist ID Title Released 1001 Let Go 2002 2002 Under Rug Swept 2002 3003 Surfacing 1997 Table 1 Artist Table 2 Album Ans;

select Title, Firstname, Lastname from Artist, Album where Artist.Artist_ID = Album.Artist_ID and Released = 2002

  1. Complete the following Java program that reads the keyboard input and writes into a file whose file name is read from the command line. (8 points) Hint: Use the following Java classes: BufferedReader, FileOutputStream, FileReader, InputStreamReader, IOException, and PrintStream.

import java.io.*;

public class KeyinFile { public static void main (String[] args) throws IOException {

BufferedReader keyboard = new BufferedReader (new InputStreamReader (System.in));

PrintStream out = new PrintStream (new FileOutputStream(args[0]));

String line = null;

while((line = keyboard.readLine()) != null) { out.println(line); } keyboard.close(); out.close(); } }

  1. Explain instance and static methods in Java. (6 points) Ans:

(a) A instance method is a method which must be invoked via an instance of a class. (b) A static method is a method which can be invoked via the name of the class in which they are defined.