QMCS280 01, Spring, 1998
Exam 1
Name: ____________________________________ Date: ____________________
2. Circle the following term that best describes the situation in traditional software development where the requirements for a system become modified while the system is being developed:
a. Each problem viewed as unique
b. No leverage of existing code
c. Large projects suffer most
d. Creeping functional change
3. List and explain at least two of the characteristics of Object Oriented programming:
4. Circle the correct answer. Which of the following is a reason to build a model:
a. You can test before building
b. It can be used as a communications tool
c. You can visualize what it will look like
d. All of the above
5. Briefly explain the difference between a Class and an Object:
6. Briefly explain what Inheritance is in Object Oriented programming:
7. Circle the correct answer. Which of the following terms means one billion bytes:
a. Kilobyte
b. Megabyte
c. Gigabyte
d. Terabyte
8. Main computer memory that cannot be changed is called ____________ ___________ ___________, or the acronym _______.
9. The common measurement of the CPUs system clock speed is ____________________ which means one million clock ticks per second.
10. Generally, there are two kinds of Java programs. Name each kind and briefly describe the differences between the two.
11. Write a complete Java application that will prompt the user for two numbers and then print out the larger of those two numbers with an appropriate message.
12. Write a complete Java applet that displays your name and the name of your instructor.
13. For each of the following lines of Java code, indicate what the value for the variable named would be:
Value
int able = 14 + 5 / 2 _____
int baker = 14.0 + 5 / 2.0 _____
float charlie = 14.0 + 5.0 / 2 _____
int dog = 14 + 5 % 2 _____
int eagle = (14 + 5) % 2 _____
14. Briefly explain the difference between the two Java statements "System.out.print()" and "System.out.println()":
15. The Java compiler produces ____________________ and not machine language.
16. The acronym API stands for ____________________ ___________________
_______________________.
17. Circle the correct answer. Which of the following is not a primitive data type in the Java language:
a. int
b. char
c. string
d. float
e. double
f. boolean
18. Briefly explain the difference between using the wrapper class for a primitive data type (e.g. Integer) versus using the primitive data type (e.g., int):
19. For each of the following loops write in the number of times the loop will be executed. Note that zero and infinite are potentially valid answers:
a. ____________
int count = 5;
int number = 1;
while (count <= number)
System.out.println("Here I go again");
b. ____________
int count = 5;
in number = 1;
while (count > number)
System.out.println("And once again");
number = number + 1;
c. _____________
int count = 5;
int number = 1;
while (count > number) {
System.out.println("And still another time");
number = number + 1;
}
20. Write a complete Java application that will accept the number of years from a user. The program will then calculate an print how much interest is earned for that number of years assuming an interest rate of 5% per year, an initial deposit of $1,000, and compounding annually.