• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Question on OOP-4 Requirements

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For OOP-4 (Lookup) ...

1. Is it OK to simply use 1,2,3, ... 12 as the serial numbers? Seems like doing so would keep nitpicker life moderately simpler.

2. The assignment only asks for a string of info about a particular item. My first thought is to simply use a long string of descriptive text for each item. (eg - "This is a book called blah, written by blah, which costs blah to rent , etc.") But this approach doesn't seem in spirit with the assignment purpose to learn all about polymorphism. There would not be anything really different from a video item and a furniture item.

So, I'm guessing I should really define a variety of relevant fields for each class, and build the text string from a particular instance of field values. Is this second approach more in keeping with the assignment goal?

Thank you very much.
- Dan
 
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use anything you want for the serial number(s).

Your second approach sounds more like what we are looking for.
 
reply
    Bookmark Topic Watch Topic
  • New Topic