So far we’ve been working with composing shape objects with GUI Java classes. Now we’re going to practice composing objects that only output to the console.
ITunesArray
ITunes_uLogin
ITunesArray
class that:
addSong
that takes a Song
as a parameter and adds it to the next open position. What should happen when the array is full?print
method that prints the entire song list using a for each loop. It shouldn’t print empty (null
) objects.main
method that adds 3 songs to the ITunesArray
class and prints them out by calling the print
method.If you don’t feel confident in Part I, STOP. Do not move on to Part II.
ITunesArray
challenge methodsAdd the following methods to the ITunes
class and test them in main
:
getTotalPrice
method that returns the total cost of the entire song list.getMinimumPrice
method that returns a Song
with the lowest price in the listIn class.