Skip to main content
added 237 characters in body
Source Link
Rainer P.
  • 2.9k
  • 11
  • 17

I think you misunderstood the task.

In the original task, there was a clear distiction between drinks and ingredients. There was a list of ingredients, each with a name, a price and a stock. There was a separate list of drinks, each consisting of a name and a list of ingredients. Customers could only order drinks and the software then had to find the drink in the list, check the list of ingredients and verify that all ingredients are in stock, then calculate the final price from the individual prices of the ingredients. Your software does none of that.

Another big problem is that you use classes and inheritance for things that should be instances or lists of instances, all of the same class. For example, there should be a "Drink" class and then a list that contains several instances of the "Drink" class, the first with the "Name" property set to "Coffee", the second with "Caffe Mocha", the third with "Cappuccino" and so on.

I think you misunderstood the task.

In the original task, there was a clear distiction between drinks and ingredients. There was a list of ingredients, each with a name, a price and a stock. There was a separate list of drinks, each consisting of a name and a list of ingredients. Customers could only order drinks and the software then had to find the drink in the list, check the list of ingredients and verify that all ingredients are in stock, then calculate the final price from the individual prices of the ingredients. Your software does none of that.

Another big problem is that you use classes and inheritance for things that should be instances or lists of instances, all of the same class.

I think you misunderstood the task.

In the original task, there was a clear distiction between drinks and ingredients. There was a list of ingredients, each with a name, a price and a stock. There was a separate list of drinks, each consisting of a name and a list of ingredients. Customers could only order drinks and the software then had to find the drink in the list, check the list of ingredients and verify that all ingredients are in stock, then calculate the final price from the individual prices of the ingredients. Your software does none of that.

Another big problem is that you use classes and inheritance for things that should be instances or lists of instances, all of the same class. For example, there should be a "Drink" class and then a list that contains several instances of the "Drink" class, the first with the "Name" property set to "Coffee", the second with "Caffe Mocha", the third with "Cappuccino" and so on.

Source Link
Rainer P.
  • 2.9k
  • 11
  • 17

I think you misunderstood the task.

In the original task, there was a clear distiction between drinks and ingredients. There was a list of ingredients, each with a name, a price and a stock. There was a separate list of drinks, each consisting of a name and a list of ingredients. Customers could only order drinks and the software then had to find the drink in the list, check the list of ingredients and verify that all ingredients are in stock, then calculate the final price from the individual prices of the ingredients. Your software does none of that.

Another big problem is that you use classes and inheritance for things that should be instances or lists of instances, all of the same class.