
|
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:
- A file containing a
Student
class which has
- three instance fields:
studentId
(an int),
name,
and gpa
(a double)
- a named constant
GPA_CUTOFF = 3.0,
which is a static
field
- a
static
field called count
which contains the number of
Student
objects created
- a no-argument constructor
- a parameterized constructor with three
arguments
- 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"
- a method called
getNumberOfStudents()
which returns the number of students checked
- get and set methods for all instance
fields
- A file containing an application class which
- has a
while
loop that continues when the user responds
"Y"
when asked if he/she wants to continue
- within the
while
loop
- creates a student object using the
parameterized constructor
- displays the output from the
checkDeansList()
method and asks if the user wants to continue
- when all students have been checked,
displays the total number of students checked
- 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