You are on page 1of 11

CSE 219 Spring 2011 FINAL Exam Group 0 Solutions

Tuesday, May 17, 2011

Name:

First

Last

Student ID # _________________________________
Please show your ID when requested.
Please leave at least one seat between yourself and the person next to you.
Use a #2 Pencil to fill in the appropriate bubble on your answer sheet.
Fill in one answer per question
No books, notes, or electronic equipment can be used during the exam.
Any CHEATING will result in an F as well as being written-up on academic dishonesty.

FIRST:
Write and fill in the bubbles for your full name on the answer sheet
Write and fill in the bubbles for your ID Number on the answer sheet
In the GRADE OR EDUC field, fill in the bubble corresponding to you exam version # (0-3)
For all questions, select the best answer from the choices provided

ATTENTION: Make sure your exam has 10 pages and all 50 questions.

CSE 219 Spring 2011 Fall Exam Group 0 Solutions

Question 1
What term best describes a description of a problem and its solution that can apply to many similar
programming situations.
A) Abstraction
B) Design Pattern
C) Enumeration
D) Generics
E) Polymorphism
Question 2
Instance variables are stored inside what segment of memory?
A) Call Stack
B) Global
C) Heap
D) Text
E) All of the above
Question 3
Which of the following Java technologies can adversely affect performance if overused in ones program?
A) Exception handling
B) Inheritance
C) Method calling
D) All of the above
E) None of the above
Question 4
The Software Development LifeCycle is drawn below. Which step may involve using the JUnit toolkit?
A) 2
B) 3
C) 5
D) 6
E) 8
Question 5
Which step involves making UML Use Case diagrams?
A) 1
B) 2
C) 3
D) 4
E) 5
Question 6
Which involves making UML Sequence diagrams?
A) 1
B) 2
C) 3
D) 4
E) 5

CSE 219 Spring 2011 Fall Exam Group 0 Solutions

Question 7
For ClassWithSyntaxError as defined below, which line of code is the source of a syntax error?
A) 6
1. public class ClassWithSyntaxError
B) 12
2. {
C) 14
3.
public ClassWithSyntaxError(int x)
D) 17
4.
{ try
E) 18
5.
{ init(x);
6.
test(x);
7.
}
8.
catch(Exception e)
9.
{ e.printStackTrace(); }
10. }
11.
12. public void init(int i) throws Exception
13. { if (i < 0) throw new Exception();
14.
else
throw new RuntimeException();
15. }
16.
17. public void test(double d) throws RuntimeException
18. { if (d < 0) throw new Exception();
19.
else
throw new RuntimeException();
20. }
21. }

Question 8
In lecture we talked about glass-box testing and how it tests all paths through a method definition. For the
glassBoxMethod below, how many paths are there through this method?
A) 5
public void glassBoxMethod(int x, int y)
B) 6
{
if (y == 0) return;
C) 7
else if (x < 0) {
D) 8
if (y < 0) {
E) 9
System.out.println("A");
}
else {
System.out.println("B");
}
}
else if (x == 0){
if (y < 0){
System.out.println("C");
}
}
else if (y > 0){
System.out.println("D");
}
}

CSE 219 Spring 2011 Fall Exam Group 0 Solutions

Question 9
At what stage is redesigning a software system the least expensive?
A) Deployment Stage
B) Design Review Stage
C) Profiling Stage
D) Integration Stage
E) None of the above, they are all equally expensive
Question 10
Which of the following could be described as input to a method?
A) Instance Variables
B) Method Arguments
C) Static Variables
D) All of the above
E) None of the above
Question 11
Which of the following design patterns does not use inheritance as part of its implementation?
A) Factory
B) Iterator
C) Singleton
D) State
E) Strategy
Question 12
In HW 1 we created a program that employed MVC for loading and manipulating DBF files. What class
played the role of M in MVC in that program? (note this is specific to the Spring 2011 HW)
A) ActionListener
B) DefaultTableModel
C) JFrame
D) JTable
E) TableModelListener
Question 13
What is the software engineering term used to describe the breaking down of a problem into smaller,
more manageable problems, until smaller solutions can easily be solved?
A) Breakdown lifecycle
B) Data driven design
C) Decomposition
D) Dependency reduction
E) Extreme Programming
Question 14
Using black-box testing techniques on a method, one would create test cases that test every path through
what?
A) The methods arguments
B) The methods body (its code)
C) The methods exception handlers
D) The methods return values
E) The methods specification (its documentation)

CSE 219 Spring 2011 Fall Exam Group 0 Solutions

Question 15
When using JUnit, one typically calls static methods in what class to compare actual and expected values?
A) Assert
B) JUnit
C) Object
D) String
E) System
Question 16
Which of the following can an interface have?
A) Abstract variable
B) Concrete method
C) Constructor
D) Instance variable
E) Static final constant
Question 17
Which of the following best describes the objective of a single UML Use Case Diagram?
A) List a sequence of steps a user might take in order to complete an action
B) List all error handling mechanisms for a GUI application
C) List all the users who will be interacting with the system
D) List the different ways a user can interact with the system
E) List the GUI components to be part of the system
Question 18
Which of the following can an abstract class not have?
A) Abstract method
B) Abstract variable
C) Constructor
D) Instance variable
E) Static final constant
Question 19
A class that has too many unrelated obligations, increasing its complexity and heft could be described
using which anti-pattern?
A) Blob
B) Galaxy Code
C) Inheritance Galore
D) Meatball
E) Spaghetti Code
Question 20
What term is used to describe checking out a project into an isolated environment to do experimental
work without threat of permanently affecting the original project?
A) Commit
B) Merge
C) Repository
D) Sandboxing
E) Trunk

CSE 219 Spring 2011 Fall Exam Group 0 Solutions

Question 21
In HW 1, when loading in the DBF file, we stored each row of table data inside what type of object? (note
this is specific to the Spring 2011 HW)
A) DBFField
B) DBFRecord
C) DBFRow
D) HashMap
E) TreeMap
Question 22
In HW 2, what type of file stored all the geographic information for our maps? (note this is specific to the
Spring 2011 HW)
A) DBF
B) HashMap
C) SHP
D) SVG
E) TreeMap
Question 23
In HWs 1 & 2, what type of Java stream did we use to load the data files? (note this is specific to the
Spring 2011 HW)
A) BufferedReader
B) DBFStream
C) DataInputStream
D) ObjectInputStream
E) RandomAccessStream
Question 24
Suppose you were to design your own Java Library for manipulating DBF files and you wanted to throw
an exception inside a method that sets numeric data every time non-numeric character data was provided.
What type of exception should you use for this?
A) Descendant of Exception but not RuntimeException
B) Descendant of RuntimeException
C) IOException
D) Passed Exception
E) Unchecked Exception
Question 25
On the first day of lecture we said the Software Development Lifecycle is slight different for a large
project. The first 8 steps of this modified lifecycle are listed below. What is step #6?
A) Design Review
1. Requirements Analysis
B) Integration
2. Design
C) Maintenance
3. Evaluate Design
D) Porting
4. Code
E) UML
5. Test, Debug, & Profile Components
6.
7.
8.

?
Test, Debug, & Profile Whole
Deploy

Question 26
What term is used to describe the process of monitoring and updating deployed software?
A) Bootstrapping
B) Deployment
C) Maintenance

CSE 219 Spring 2011 Fall Exam Group 0 Solutions

D) Optimizing
E) Profiling
Question 27
We discussed how developers use a term to describe writing code without testing while you go, but rather,
waiting until large pieces are written before performing any testing. What is this term called?
A) Blob
B) Design to Fail
C) Design to Test
D) Monster Programming
E) Spaghetti Code
Question 28
What design pattern works by dynamically changing the actual type of an instance variable as needed.
A) Command
B) Iterator
C) Observer
D) Singleton
E) State
Question 29
This semester I encouraged using narrow interfaces in designing connections between modules. Which
design pattern, typically used as an alternative to static methods, uses a programming style that can
easily lead to wide interfaces between classes and modules?
A) Flyweight
B) Iterator
C) Observer
D) Singleton
E) Strategy
Question 30
What term best describes the process of testing a previously working system after a series of changes?
A) Regression Testing
B) Sampled Testing
C) Unit Testing
D) Validation
E) Verification
Question 31
Which of the following stages of software development is often performed by someone with little to no
programming experience?
A) Beta Testing
B) Requirements Analysis
C) System Testing
D) All of the above
E) None of the above They all require programming experience
Question 32
In lecture and in a HW description, I referenced the hilarious Stonehenge scene from the film This is
Spinal Tap. What is the lesson we learned from this scene?
A) A bad design will result in a bad implementation
B) Design reviews can be unnecessary
C) Dont dress like an Australians nightmare
D) Dont pay software engineers per KLOC

CSE 219 Spring 2011 Fall Exam Group 0 Solutions

E) Good coders can make up for a bad design

CSE 219 Spring 2011 Fall Exam Group 0 Solutions

Question 33
This semester I wanted to brainwash you using three mantras: First Define the Problem, Always Provide
Feedback, and:
A) Always optimize your code
B) Code optimization is more important than algorithm selection
C) Data structures are overrated
D) Design, then Code
E) Use Swing for all Java Servlet development
Question 34
In lecture we stressed how amazing it is that code written by a Java API developer 10 years ago is able to
invoke methods we write today. What is the primary reason why this is possible?
A) Generics
B) JAR files
C) Java Compiler is Type Safe
D) Polymorphism
E) WAR files
Question 35
What could be the actual type of an argument sent to the Container class setLayoutManager method?
A) Container
B) FlowLayout
C) JPanel
D) LayoutManager
E) Object
Question 36
Which design pattern, which we discussed, links a number of different components (buttons, menu items,
etc.) to a single event handler by associating each event source with a common textual abstraction?
A) Adapter Pattern
B) Command Pattern
C) Composite Pattern
D) Observer Pattern
E) Proxy Pattern
Question 37
What design pattern might have a class with static methods that would each construct a different actual
type of object that would be returned as an apparent type of some common family type?
A) Adapter Pattern
B) Command Pattern
C) Factory Pattern
D) Observer Pattern
E) State Pattern
Question 38
What must be true of a class in order to use the Flyweight Pattern to manage its objects?
A) It cannot be mutable
B) It must implement Serializable
C) It cannot be a child class of Object
D) It must define the compareTo method
E) It must override all abstract methods from Object

CSE 219 Spring 2011 Fall Exam Group 0 Solutions

Question 39
Which of the following classes would make a good candidate for the Flyweight Pattern?
A) Color
B) DBFTable
C) JFrame
D) JTable
E) Vector
Question 40
This semester we learned that Java is a strongly typed object oriented language with automatic memory
management system. What other high-level language have we pointed out has all of these properties in
common with Java?
A) Assembly
B) C
C) C++
D) C#
E) HTML
Question 41
Algorithm expert Donald Knuth famously said that premature ______________ is the root of all evil.
A) Debugging
B) Deployment
C) Optimization
D) Profiling
E) Testing
Question 42
What types of exceptions are typically thrown as a result of programmer error?
A) Checked Exceptions
B) Descendants of Exception but not RuntimeException
C) IOException
D) Passed Exceptions
E) Unchecked Exceptions
Question 43
What technology, distributed under the Apache license, is fast becoming the industry standard for Version
Control Systems?
A) Concurrent Control System
B) Jakarta
C) Revision Control System
D) Subversion
E) Tortoise
Question 44
What data can the HProf tool provide to the developer?
A) data structure is best for a given problem
B) the reason for a particular compiler error
C) which line of code is the source of a logical error
D) which line of code is the source of a runtime error
E) which methods in a program take up the most time

CSE 219 Spring 2011 Fall Exam Group 0 Solutions

10

Question 45
What term is used to describe the situation when a software project falls behind schedule?
A) Lag
B) Latency
C) Slippage
D) S.O.P.
E) T.P.S.
Question 46
What is the technical term used to describe a code block or method that uses a disproportionate amount
CPU cycles or memory?
A) GPU
B) Hot Spot
C) Pig
D) Optimizer
E) Repository
Question 47
Whether you were aware of it it or not, everyone used an Optimizer tool this semester. What tool is that?
A) AWT
B) HProf
C) Java Compiler
D) SVN
E) Violet
Question 48
What would be the best example of a class that violates the principle of Coherence of Types?
A) one that stores all data for a row in a table
B) one that stores information about a column of a table
C) one that stores information about a user, a table, and a frame
D) one that has only two instance variables
E) one that implements 2 interfaces
Question 49
What implementation approach did we use in coding HWs 5 & 6? (note this is specific to the Spring 2011
HW)
A) Agile Programming
B) ACM Approach
C) Bottom-Up Approach
D) Just-In-Time Approach
E) Top-Down Approach
Question 50
In lecture we discussed how a certain type of program is so critical that the developers for that program
go to great pains to verify that it works properly, including mathematically proving much of the code does
as intended. What type of program was this?
A) Back End to a Web Page
B) Compiler
C) Javadoc Application
D) Map Renderer
E) Swing Components

CSE 219 Spring 2011 Fall Exam Group 0 Solutions

11

You might also like