Programming and Problem Solving with Java

(やまだぃちぅ) #1
721

10.Here is a CRC card for the participant class of Exercise 9:

12.What happens if:
a name to be processed doesn’t exist?
a participant wants to quit the program?
the user wants to determine who has the fastest jogging time?
the user wants to determine who has the best long-jump distance?
the user wants to determine who has the highest bench-press weight?
the user wants to determine who has the most improved jogging time?
long-jump record? bench-press weight?
15.All the compilation units of a package must be kept in one directory with the
same name as the package.

Chapter 7 Exam Preparation Exercises



  1. a.Internal scope and external scope
    b.No. Internal scope does not depend on the access modifiers.
    c. Internal scope refers to the scope within a class. Any identifier declared in a
    class can be used anywhere within the class.
    d.You can’t use a class variable to initialize another variable before it has been
    defined. A local identifier shadows a class member with the same name.
    e.Shadowing is a scope rule that specifies that a local identifier has precedence
    over a class identifier with the same name.
    f. Yes.


Class Name: Participant Superclass: Subclasses:


Responsibilities Collaborations
Create Participant (name, weight, jog, jump, bench) None
Set current statistics (weight, jog, jump, bench) Name
Know weight None
return double
Know jog None
return Time

return double


Know jump None


Know bench None


return double

Free download pdf