Problem Definition
Determine the letter grade earned by a student from exam, and lab or project
points.
Input (keyboard):
A student name, three exam scores, and a lab or project score total.
For command line input, include user prompts and echo the inputs.
Output (screen):
Show total points and the resulting letter grade along with identifying label
s.
Processing
Sum the points earned on the exams, and labs or projects. Determine a letter
grade from the point total. For a point total >= 90% of points possible,
assign the letter grade "A"; a point total >= 80% (and < 90%), assign "B"; ..
.
and for a total less than 60% of points possible, or total lab/project points
< 120, assign "F".
Notes:
Textbook chapters 1-3 provide background for this assignment. Class examples
may
also be helpful. No modifications will be made to your source code--verify y
our
application may be tested with a simple Java editor.
Java Programming
Fall 2009
Lab Exercise 2: Classes
Instructions
Develop a Java application according to the problem specifications and constr
aints
specified below. Email the completed classes (yourName.java files) to your
instructor by 2 October.
Problem Statement:
Develop an application for a university course offering. There are to be cla
sses for
textbook, instructor, and course. This application should also have a driver
class
to test the other classes constructed.
Classes:
1. Textbook: this class is to have variables (fields) for isbn, title, and aut
hor(s).
And, it should include a constructor, accessor and mutator methods for the f
ields,
as well as toString and equals methods.
2. Instructor: variables to include are firstName, lastName, department, and e
mail.
Define a constructor and methods as done for Textbook.
3. Course: this class is an aggregation of data which includes a primitive var
iable
for courseTitle, and variables for textbook and instructor classes. The Cou
rse
constructor would initialize the primitive courseTitle and reference the tex
tbook
and instructor constructors to initialize fields for those classes. Include
accessors and mutators and a toString method.
Driver or test program:
The driver should offer the user choices to a) produce a course report or b)
make
comparisons of textbook title or instructor name between two courses. For t
he
report choice, the program should be capable of retrieving values associated
with
course objects then printing those details. For comparisons, the program sh
ould
allow the user to compare an instructor name or textbook title with those of
another course. Data for several textbook, instructor and course objects ar
e to
be obtained from a file. For console input, include user prompts. Include
descriptive headings or labels to identify output data.
Notes:
Textbook chapters 3, 8 and 11 provide background for this assignment. Progra
m
examples presented to the class also apply to this assignment. Assume that y
our
program will be tested with a simple Java editor (no packages). No modificat
ions
will be made to your program to eliminate errors.