5.1 Music record.docx - require\/input_functions module Genre POP CLASSIC JAZZ ROCK =*1.4 end Maybe the following needs to be changed How $genre_names

5.1 Music record.docx - require/input_functions module...

This preview shows page 1 - 2 out of 2 pages.

require './input_functions' module Genre POP, CLASSIC, JAZZ, ROCK = *1..4 end # Maybe the following needs to be changed? How? $genre_names = ['Null', 'Pop', 'Classic', 'Jazz', 'Rock'] class Album attr_accessor :title, :artist, :genre def initialize (title, artist, genre) @title = title @artist = artist @genre = genre end end # This function Reads in and returns a single album from the given file, with all its tracks. # ...for now however, take input from the terminal to enter just the album information. # Complete the missing lines of code and change the functionality so that the hardcoded # values are not used. def read_album() # You could use get_integer_range below to get a genre. # You only the need validation if reading from the terminal # (i.e when using a file later, you can assume the data in # the file is correct) # insert lines here - use read_integer_in_range to get a genre

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture