Question: Create a RUBY class cylinder . Each one is characterized by instance variables, radius, and height . For this class create the initializer/ constructor and
Create a RUBY class cylinder . Each one is characterized by instance variables, radius, and height . For this class create the initializer/ constructor and the method volume that returns the volume of the cylinder.
1) - Create a class Can that inherits properties from the class Cylinder and adds new instance variable contents( e.g, beer, Pepsi, coke) and price (real number ). Initialize an array of cans and write Ruby code neccessery to display all data about the can that has the maximum value of the volume/price ration.( Hint @ratio can be an instance variable of the class can)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
