Sears has contracted you to continue working on an application that models its inventory. Sears is really struggling, and right now the only things they have in stock are bikes and shirts. The CEO of Sears took a computer programming course in college, and he knows that both bikes and shirts are examples of a Product. Thus, he has instructed you to reuse the code found in product.rb.
The Sears Class Heirarchy:
*Product*
/ \
/ \
/ \
Bike Shirt
cdinto thesearsdirectory inw02/d04/student- Examine the code in
product.rb
- what does a product expect upon instantiation?
- Add class definitions for
BikeandShirtin their respective files so that they both inherit from theProductclass - Use
superso that not only does aBikeget assigned apriceandbrandupon instantion, but also agear_countandtire_diameter
- provide getter methods for the bike-specific attributes
- Instantiate some bikes in
main.rbto make sure they behavior the way you'd expect - Use
superso that not only does aShirtget assigned apriceandbrandupon instantion, but also asize, acolor, and sometext
- provide getter methods for the shirt-specific attributes
- Instantiate some shirts in
main.rbto make sure they behavior the way you'd expect