Dr. Johnson's Review Sheet for CIS 260 Final Exam

Main Menu

Last updated on 12/05/07 01:43 PM .

Chapters covered: 5, 6, 9 (blue book) or 3, 6 (orange book)

Assignments covered: 6, 8

Sample exam:

1. What is another name for an instance?  a. class     b. object    c. method    d. none of the above

2. A static field applies primarily to a(n) ____________.  a. class   b. object   c. method   d. none of the above

Write a COMPLETE Java application that meets the following requirements:
  1.  A file containing a Student class which has
    1. three instance fields: studentId (an int), name, and gpa (a double)
    2. a named constant GPA_CUTOFF = 3.0, which is a static field
    3. a static field called count which contains the number of Student objects created
    4. a no-argument constructor
    5. a parameterized constructor with three arguments
    6. a method called checkDeansLlist() which returns a String such as "John Doe is on the Dean's list" or "John Doe is not on the Dean's list"
    7. a method called getNumberOfStudents() which returns the number of students checked
    8. get and set methods for all instance fields
  2. A file containing an application class which
    1. has a while loop that continues when the user responds "Y" when asked if he/she wants to continue
    2. within the while loop
      1. creates a student object using the parameterized constructor
      2. displays the output from the checkDeansList() method and asks if the user wants to continue
      3. when all students have been checked, displays the total number of students checked
  3. uses JOptionPane for all input and output

You should write the most logical and concise code possible. Make sure you follow all the conventions discussed in class and in the text, and that you use good programming style as demonstrated in the text (including documentation and indentation). You may wish to plan your program carefully for about 5 minutes before you start writing code.

Solution to sample exam:

Download the following files (right-click, Save target as...), then rename the files with the .java extension:

Student.txt        StudentApp.txt