Mixed Programming Languages Quiz

A mixed quiz covering various programming languages and technologies including Java, .NET, SQL, SAS, and web development

20 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

How will you pass values from HTML page to the Servlet?

  1. response.setparameter () method
  2. response.getparameter () method
  3. request.setparameter () method
  4. request.getparameter () method
Question 2 True/False

If i put a Servlet on each servers, and there is a static variable in thisServlet. Do all the instances on these servers share the same static variable?

  1. True
  2. False
Question 3 Multiple Choice (Single Answer)

How do I get authentication with myServlet?

  1. HTTPRequest.setUserName()
  2. HttpServletRequest.getUserName()
  3. HTTPResponse.setUserName()
  4. HTTPResponse.getUserName()
Question 4 Multiple Choice (Single Answer)

What does controllers do?

  1. acts as an interface between view and model
  2. does not interact with view
  3. does not interact with controller
  4. nothing but view
Question 5 Multiple Choice (Single Answer)

Which of the following statements is true regarding the UNDO_POLICY=REQUIRED option?

  1. It must be used with the REQUIRED integrity constraint.
  2. It ignores the specified integrity constraints if any of the rows that you want to insert or update do not meet the constraint criteria.
  3. It restores your table to its original state if any of the rows that you try to insert or update do not meet the specified integrity constraint criteria.
  4. It allows rows that meet the specified integrity constraint criteria to be inserted or updated, but rejects rows that do not meet the integrity constraint criteria.
Question 6 Multiple Choice (Single Answer)

What is the output of proc sql; title ’Table One and Table Two’; select * from one, two; Table One X Y ------- 1 2 2 3 Table Two X Z ------- 2 5 3 6 4 9

  1. Table One and Table Two X Y X Z ------------ 1 2 2 5 1 2 3 6 1 2 4 9 2 3 2 5 2 3 3 6 2 3 4 9
  2. Table One and Table Two X Y X Z ------------ 1 2 2 5 2 3 2 5
  3. Table One and Table Two X Y Z ------------ 1 2 5 2 3 5
  4. Table One and Table Two X Y Z ------------ 1 2 . 2 3 5
Question 7 Multiple Choice (Single Answer)

proc sql; title ’One and Two Joined’; select one.a ’One’, one.b, two.a ’Two’, two.b from one, two where one.b=two.b; Table One a b -------- a 1 b 2 c . d 4 Table Two a b -------- a 1 b 2 c . d 4 e . f . What is the output?

  1. One and Two Joined One b Two b ------------------- a 1 a 1 b 2 b 2 d 4 d 4 c . e . c . f .
  2. One and Two Joined One b Two b ------------------- a 1 a 1 b 2 b 2 c . c . d 4 d 4 c . e . c . f .
  3. One and Two Joined One b Two b ------------------- a 1 a 1 b 2 b 2 c . c . d 4 d 4
  4. One and Two Joined One b Two b ------------------- a 1 a 1 b 2 b 2 . . . . d 4 d 4
Question 8 Multiple Choice (Single Answer)

What is the output of : data merged; merge fltsuper fltdest; by flight; run; proc print data=merged noobs; title ’Table MERGED’; run; FLTSUPER Flight Supervisor 145 Kang 145 Ramirez 150 Miller 150 Picard 155 Evanko 157 Lei FLTDEST Flight Destination 145 Brussels 145 Edmonton 150 Paris 150 Madrid 165 Seattle

  1. Table MERGED Flight Supervisor Destination 145 Kang Brussels 150 Miller Paris 155 Evanko 157 Lei 165 Seattle
  2. Table MERGED Flight Supervisor Destination 145 Kang Brussels 150 Miller Paris
  3. Table MERGED Flight Supervisor Destination 145 Kang Brussels 145 Ramirez Edmonton 150 Miller Paris 150 Picard Madrid
  4. Table MERGED Flight Supervisor Destination 145 Kang Brussels 145 Ramirez Edmonton 150 Miller Paris 150 Picard Madrid 155 Evanko 157 Lei 165 Seattle
Question 9 Multiple Choice (Single Answer)

What id the output of:proc sql; title ’Table JOINED’; select * from fltsuper s, fltdest d where s.Flight=d.Flight; FLTSUPER Flight Supervisor 145 Kang 145 Ramirez 150 Miller 150 Picard 155 Evanko 157 Lei FLTDEST Flight Destination 145 Brussels 145 Edmonton 150 Paris 150 Madrid 165 Seattle

  1. Table JOINED Flight Supervisor Flight Destination ------------------------------------------- 145 Kang 145 Brussels 145 Kang 145 Edmonton 145 Ramirez 145 Brussels 145 Ramirez 145 Edmonton 150 Miller 150 Paris 150 Miller 150 Madrid 150 Picard 150 Paris 150
  2. Table JOINED Flight Supervisor Flight Destination ------------------------------------------- 145 Ramirez 145 Edmonton 150 Picard 150 Madrid
  3. Table JOINED Flight Supervisor Flight Destination ------------------------------------------- 145 Kang 145 Brussels 145 Kang 145 Edmonton 150 Miller 150 Paris 150 Miller 150 Madrid
  4. Table JOINED Flight Supervisor Flight Destination ------------------------------------------- 145 Kang 145 Brussels 145 Ramirez 145 Brussels 150 Miller 150 Paris 150 Picard 150 Paris 150 Picard 150 Madrid
Question 10 Multiple Choice (Single Answer)

Which statement is false with respect to a set operation that uses the EXCEPT, UNION, or INTERSECT set operator without a keyword?

  1. Column names in the result set are determined by the first table.
  2. To be overlaid, columns must be of the same data type.
  3. To be overlaid, columns must have the same name.
  4. By default, only unique rows are displayed in the result set.
Question 11 Multiple Choice (Single Answer)

Which of the following PROC SQL steps gives bonuses (in points) to frequent-flyer program members as follows: - a 50% bonus for members who traveled less than 10,000 miles - a 100% bonus for members who traveled 10,000 miles or more?

  1. proc sql; update work.frequentflyers set pointsearned=pointsearned* case if milestraveled < 10000 then 1.5 if milestraveled >= 10000 then 2 else 1 end;
  2. proc sql; update work.frequentflyers set pointsearned=pointsearned* case when milestraveled < 10000 then 1.5 when milestraveled >= 10000 then 2 else 1 end;
  3. proc sql; update work.frequentflyers set pointsearned=pointsearned* case if milestraveled < 10000 then pointsearned1.5 if milestraveled >= 10000 then pointsearned2 else 1 end;
  4. proc sql; update work.frequentflyers set pointsearned=pointsearned* case if milestraveled < 10000 then pointsearned1.5 if milestraveled >= 10000 then pointsearned2 else pointsearned*1 end;
Question 12 Multiple Choice (Single Answer)

Which of the following displays the structure of a table in the SAS log?

  1. proc sql; describe as select * from sasuser.payrollmaster;
  2. proc sql; describe contents sasuser.payrollmaster;
  3. proc sql; describe table sasuser.payrollmaster;
  4. proc sql; describe * from sasuser.payrollmaster;
Question 13 Multiple Choice (Single Answer)

Which keyword must you add to your index definition in the CREATE INDEX statement to ensure that no duplicate values of the key column can exist?

  1. KEY
  2. UNIQUE
  3. NODUPS
  4. NODUPKEY
Question 14 Multiple Choice (Single Answer)

Which Property of the Session Object is used to set the local Identifier?

  1. View State
  2. key
  3. LCID
  4. Session Id
Question 15 Multiple Choice (Single Answer)

A website can contain ___________ master pages,___________ site map file?

  1. any number, 1
  2. 1, Any Number
  3. any Number, any Number
  4. 1,1
Question 16 True/False

Can we declare a class as Protected?

  1. True
  2. False
Question 17 True/False

Can we declare private class in a Namespace?

  1. True
  2. False
Question 18 Multiple Choice (Single Answer)

Types of Attributes in .NET?

  1. Custom Attributes
  2. Funtional Attributes
  3. Predefined Attributes
  4. Both A & C
Question 19 Multiple Choice (Single Answer)

What is true about null?

  1. You can call a method on null: x.m() will not throw an error when x is null and m is a static method.
  2. null instanceof Object returns true
  3. You can pass null as the literal argument to a constructor of an anonymous inner class. e.g., new SomeClass(null) { }
  4. None of above
Question 20 Multiple Choice (Single Answer)

Why are there no global variables in Java?

  1. Adding state variables breaks referential transparency (you no longer can understand a statement or expression on its own: you need to understand it in the context of the settings of the global variables)
  2. State variables lessen the cohesion of a program: you need to know more to understand how something works. A major point of Object-Oriented programming is to break up global state into more easily understood collections of local state.
  3. When you add one variable, you limit the use of your program to one instance. What you thought was global, someone else might think of as local: they may want to run two copies of your program at once.
  4. All of above