Skip to main content
IBM 
ShopSupportDownloads
IBM HomeProductsConsultingIndustriesNewsAbout IBM
Java Language EssentialsDownload tutorial zip fileEmail this tutorial to a friend
Main menuSection menuGive feedback on this tutorialPrevious panelNext panel
Exercises
  


6. The MusicStore Class: Tasks page 17 of 31


For this exercise you implement the first version of a user-defined data type MusicStore. This class will be used in subsequent exercises as well.

For more help with exercises, see About The Exercises

PrerequisitesSkeleton Code

Tasks

  • Task 1

    Design and implement MusicStore as a public class with one public method, displayHoursOfOperation(). This method displays the daily hours of operation to the standard output device (often called stdout or standard out), which is either a command window or an IDE window, depending on your Java environment.

    Check the expected output to determine exactly what to print out.

  • Task 2

    Design and implement TestMusicStore as a public class with one public static void method main(). main() performs the following tasks:

    • Creates an instance of MusicStore
    • Invokes the displayHoursOfOperation() method to display the daily hours of operation to standard output
    • Terminates the program with exit()

  • Task 3

    Compile the source code for MusicStore and TestMusicStore.

  • Task 4

    Execute TestMusicStore.

Help for each of these tasks can be found on the next page.


copyright 1996-2000 Magelang Institute dba jGuru


Main menuSection menuGive feedback on this tutorialPrevious panelNext panel
PrivacyLegalContact