home—info—lects—labs—exams—hws
D2L—tutor/PIs—zoom (snow day)
Object120 + its docs—java.lang docs—java.util docs
Objects containing Objects
robots containing robots
A RobotHQ has:
an address, a president and secretary (both Robots),
and an anthem (Song).
-
Make a class with its fields for a RobotHQ.
-
Write a constructor.
-
Write a static void testAll() method,
which
-
creates two different RobotHQ's -- the good guys and the bad guys.
(store them in variables.)
-
Object120.assertEquals
the first headquarter's address.
-
Object120.assertEquals
the first headquarter's President's power.
-
Object120.assertEquals
the second headquarter's Secretary's shape field.
-
Object120.assertEquals
the second headquarter's anthem.
-
Object120.assertEquals
the first headquarter's Secretary's current shape
(calling Robot#currentShape).
-
Calls Song#shorter to determine whether
the first headquarter's anthem is shorter than the second headquarter's.
home—info—lects—labs—exams—hws
D2L—tutor/PIs—zoom (snow day)
Object120 + its docs—java.lang docs—java.util docs
 This page licensed CC-BY 4.0 Ian Barland Page last generated | Please mail any suggestions (incl. typos, broken links) to ibarland radford.edu |
 |