QMCS280, Spring, 1998
Exam 4
Name: _____________________________________ Date: ______________________
1. There are two major factors that cause existing programs to be changed (program maintenance). Briefly describe each of these.
2. Circle all the correct answers. Which of the following are true of the software life cycle?
a. Goal is to minimize the total effort, development plus maintenance
b. Projects are almost always completed on time and within budget
c. Care in the development stage pays off in the maintenance stage
d. Program design is not as important as the programming language
e. Maintenance is usually not done by the original programmer
3. List all four of the "waterfall model" steps and then comment on the impact of having to fully complete one step before going on to another.
4. Circle the correct answer. Which of the following involves simulating how the end product will look and operate without actually building the product?
a. Evaluation
b. Iteration
c. Prototyping
d. Coding
5. Briefly explain the major differences between the traditional waterfall model and the iterative process model.
6. Circle the correct answer. Which type of program testing requires that you know the details of how the program is written?
a. Black box testing
b. White box testing
7. Briefly describe the difference between a "throw away" prototype and an "evolutionary" prototype.
8. Fill in the blank. A Java ________________________________________ is "thrown" by a program or runtime environment and should be "caught" and handled.
9. Fill in the blank. A Java ________________________________________ represents an unrecoverable situation that should not be handled.
10. Circle the correct answer. An exception can be:
a. Not handled
b. Handled where it occurs
c. Handled at another point in the program
d. All of the above
11. Write the Java code for an application that will divide one integer value by another. The program should declare the variables and give then each an initial value (don't need to do keyboard input). The program should also check for and handle the exception "ArithmeticException" which is generated by dividing by zero.
12. Circle the correct answer. Which Java block is executed no matter whether or not an exception is generated in the "try" block?
a. finally
b. catch
c. throw
d. pitch
13. Briefly describe the differences between multiprocessing and multiprogramming.
14. Circle the correct answer. In which way can "threads" be used in Java?
a. By inheriting from the "Thread" class
b. By implementing the "Runnable" interface
c. Either a or b
15. Fill in the blank. No matter how you choose to use threads in Java, one method will need to be defined for the object to be "threaded". That method is called: ___________________________.
16. Circle the correct answer. Which method will cause the Java thread to stop execution until another method starts it again?
a. suspend()
b. resume()
c. sleep(long milliseconds)
d. pause(indefinitely)
17. Circle the correct answer. What is the probable output of the following Java code?
public class Question_17{
public static void main (String[] args){
Thing one = new Thing("Ben");
Thing two = new Thing("Joe");
one.start();
two.start();
}//method main
}//class Question_17
class Thing extends Thread{
private String name;
Thing(String st){
name = st;
}//constructor
public void run(){
for(int i = 0; i < 3; i++){
System.out.print(name + ',');
}
}//method run
}//class Thing
a. Ben,Ben,Ben,Joe,Joe,Joe,
b. Ben,Joe,Ben,Joe,Ben,Joe,
c. Ben,Ben,Ben,Ben,Ben,Ben,
d. None of the above
18. Briefly explain what is meant by a "synchronization" issue when it comes to Java threads.
19. Name and briefly describe the six steps in the "refinement cylce":