A common use of an object is to keep track of something. the object is fed data
ID: 3662584 • Letter: A
Question
A common use of an object is to keep track of something. the object is fed data through its transformer methods and returns information through its observer methods. define( no coding necessary a reasonable set of instance variables, class variables, and methods for each of the following classes . indicate the access level for each construct. note that each of these class description somwhat fuzzy and allow multiple correct answers.
b. basketbal statictis tracker -- this will kepp track of the score and shooting statistics for a basketball team( not for each player, but for the team as a unit); it should be fed date each time a shot is taken; it should provide information about shooting percentages and the total score when requested.
20. Given the definitions of the date and incdate classes in this chapter, and the following declarations
int temp;
date date 1 = new date (10,2,1989);
date date 2 = new date (4,2,1992);
incdate date 3 = new incdate (12,25,2001);
indicate which of the following statements are illegal, and which are legal. explain your answers
a, temp = date1.getDay();
b,temp = date3.getYear();
c, date1.incremnt();
d.date3.increment();
e. date2 = date1;
f. date2 = date3;
g. date3 = date2();
Explanation / Answer
a, temp = date1.getDay();
Answer: statement is legal
b,temp = date3.getYear();
Answer: statement is legal
c, date1.incremnt();
Answer: statement is illegal
d.date3.increment();
Answer: statement is illegal
e. date2 = date1;
Answer: statement is legal
f. date2 = date3;
Answer: statement is legal
g. date3 = date2();
Answer: statement is legal
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.