Java Reference
In-Depth Information
FIGURE 10-58
Programming Assignments
1 Extending Classes in an Inheritance Hierarchy
Create the Java source code files for the
three classes listed in the inheritance
hierarchy displayed in Figure 10-59a.
The base class should be abstract and
should contain the indicated abstract
methods, as well as the listed concrete
methods, instance variables, and con-
stants. Each of the two child classes
should contain the listed constant. Cre-
ate a new Java source code file and enter
code for the test program, as shown in
Figure 10-59b on the next page. Compile
all source code and execute the test pro-
gram to obtain the output as displayed
in Figure 10-59c on page 679.
Student
MIN_FULLTIME_HRS = 12.0
MAX_FULLTIME_HRS = 20.0
MIN_PARTTIME_HRS = 0.5
MAX_PARTTIME_HRS = 11.5
TUITION_RATE = 240.5
name
creditHrs
getName()
setName()
getFinAid()
getCreditHrs()
setCreditHrs()
getStatus()
FullTimeStudent
PartTimeStudent
FINAID_RATE = .8
FINAID_RATE = .4
FIGURE 10-59a
(continued)
Search WWH ::




Custom Search