Question: Create a Ruby class Book1. Each book is characterized by the instance variables author and title. For this class create the initializer and the method

Create a Ruby class Book1. Each book is characterized by the instance variables author and title. For this class create the initializer and the method show1 that displays the instance variable of the class Book1. Create the class Book2 that inherits properties from the class Book1 and adds a new instance variables publisher and price. Write the following Book2 methods read2 that prompts the user and reads from the keyboard all data for Book2. show2 that displays all instance variables of the class Book2. Write a main program that reads from the keyboard an array of 3 books (objects of Book2), and then displays all of them using show2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
