Public class Racecar { Private static final int MAXIMUM_SCORE = 999; Private Str
ID: 3583076 • Letter: P
Question
Public class Racecar {
Private static final int MAXIMUM_SCORE = 999;
Private String carname;
Private int trackpoints;
Private int stylepoints
Private int racepoints;
Private String carnumber;
Public Racecar (String name, String carnumber) {
This.name = carname;
This.carnumber = carnumber;
}
Public String getBestEvent() {
If (trackpoints < stylepoints) {
If (trackpoints < racepoints) {
return “Score”;
}
Return “Race Point”;
}
if (stylepoints < racepoints) {
Return “Style Points”;
}
Return “Score”
}
}
What are the names of the instance variables declared in this class?
What are the signatures of the constructors declared in this class?
What are the names of the parameters declared in this class?
What are the signatures of the methods declared in this class?
What are the names of the constants declared in this class?
Explanation / Answer
1. Names of instance variables - carname, trackpoints, stylepoints, racepoints, carnumber, MAXIMUM_SCORE
2. Signatures of constructors - Public Racecar (String name, String carnumber);
3. Names of the parameters - name, carnumber
4. Signature of methods - Public String getBestEvent(); , Public Racecar (String name, String carnumber);
5. Constants - MAXIMUM_SCORE
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.