Question: You must enhance the code provided as follows: 1. Add the missing code to the function/method read_album () 2. Add the missing code to

You must enhance the code provided as follows: 1. Add the missing code to the function/method read_album () 2. Add the missing code to the procedure/method print_album () 3. Optional: Add an initialize() method to the Album class/record definition. The code should work similar to the following when 

You must enhance the code provided as follows: 1. Add the missing code to the function/method read_album () 2. Add the missing code to the procedure/method print_album () 3. Optional: Add an initialize() method to the Album class/record definition. The code should work similar to the following when run: Enter Album Enter album name: Greatest Hits Enter artist name: Don McClean Enter Genre between 1 - 4: 2 Album information is: Greatest Hits Don McClean Genre is 2 Classic Once your program is running upload a screenshot to the workspace. Video 2 input functions.rb music_record.rb + input_functions.rb music_record.rb 1 # Display the prompt and return the read string 2 def read_string prompt 3 4 5 end 6 # Display the prompt and return the read float 7 def read_float prompt 8 9 10 end 11 12 # Display the prompt and return the read integer 13 def read_integer prompt 14 15 16 end 17 18 # Read an integer between min and max, prompting with the string provided 19 puts prompt value=gets.chomp end value= read_string(prompt) value.to_f 20 def read_integer_in_range (prompt, min, max) 21 value= read_integer (prompt) 22 while (value < min or value > max) 23 puts "Please enter a value between "+min.to_s+ " and "+max.to_s + ": " value= read_integer (prompt); 24 25 26 27 28 29 # Display the prompt and return the read Boolean 30 31 def read_boolean prompt 32 33 34 35 36 37 38 39 end value= read_string(prompt) value.to_i end end value value = read_string(prompt) case value when 'y', 'yes', 'Yes', 'YES' true else end false 40 41 # Test the functions above 42 43 def main 44 45 46 47 48 49 50 main if __FILE__ == $0 puts "String entered is: " + read_string("Enter a String: ") puts "Boolean is: " + read_boolean("Enter yes or no:").to_s puts "Float is: " + read_float("Enter a floating point number: ").to_s puts "Integer is: " + read_integer_in_range("Enter an integer between 3 and 6: ", 3, 6).to_s Description Feedback Not yet TESTCASES basic test Your program produced no output. +Enter Album +Enter album name: +Enter artist name: + Enter Genre between 1 - 4: + Album information is: + Greatest Hits + Don McClean + Genre is 2 + Classic Show explanation DIFF SPLIT DIFF YOUR OUTPUT EXPECTED 0/1 passed TESTCASES basic test Your program produced no output. No output DIFF SPLIT DIFF YOUR OUTPUT EXPECTED 0/1 passed X

Step by Step Solution

3.43 Rating (153 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Program require inputfunctions module Genre POP CLASSIC JAZZ ROCK 14 end Maybe the following needs t... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!