|
by 
[Help |
API Docs |
Short Course|
Exercises]
For this exercise you (1) modify displayHoursOfOperation to use the current date and time values and (2) add a toString method to MusicStore.
Prerequisites
Skeleton Code
Tasks
Modify the method displayHoursOfOperation so that it properly reports opening and closing times, that is, consistent with the times stored in the respective instance variables.
Add a toString method to MusicStore that concatenates together pertinent information for the current instance and returns the resulting String.
Modify TestMusicStore to test/display the functionality of MusicStore's toString method.
Compile the source code for MusicStore and TestMusicStore.
Execute TestMusicStore.
Where help exists, the task numbers above are linked to the step-by-step help page.
Solution Source
Demonstration
The output should be similar to the following, either on the command line or in an IDE window:
[owner = Carlos Valderrama, opens = 9, closes = 21]
Copyright 1996-2000 jGuru.com. All Rights Reserved.
|