Hey I just joined the Cattle Drive and have been diligently working at completing the tasks. I have experience in Visual Basic but no prior study in Java. This is a rush of new information but I think I am going through at a reasonable pace and this forum is a great help.
My question is about the OOP-4 Lookup assignment.
I do not know what I am supposed to be doing. I read about polymorphism and I understand the concept. I also understand the image showing inheritance.
What I do not understand is what I am supposed to be doing. No idea what the goal is. Can anyone explain the task a bit more clearly to me? I would really appreciate it.
Write a program called Lookup that takes in a serial number and writes information on a given item to the console.
So that's the goal. I don't know how much I should be giving away in terms of coding, but think about how you would implement just this. You'd probably use a Map with a String for the serial number and a String for the description.
You will need to make an abstract class called Thing and three subclasses: Video, BookOnTape and Furniture. There will be an abstract method called getDescription() that returns a String.
So now you know the structure of the classes. You will still use a Map with a String for the serial number, but the description now come from some place else. What is the Map going to look like now?
All things are lawful, but not all things are profitable.
posted 3 years ago
I can see that, but...
I might be missing something here, but from what I can tell the map stores a "number" and a description... You want to give a number and get the description... Whats the point of all the other classes? The description is in the map. I might be dense but this just sounds like a simple one class kind of problem with a hashmap... It says we should keep it simple to solve the problem so I am lost as to what all the complexity is for.
I don't know how much I should be giving away in terms of coding,
That being said.. I understand if you cannot give away any more information than you already have. I might figure it out eventually or just skip it.