• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java Object-maintains a record of inventory items and total sale.  RSS feed

 
Andrew Tran
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I am currently working on an Assignment that has to do with Objects within Java.
This is my current code that i have so far and also a few pictures describing the assignment.

What i am stuck on is the "double processOrder( CafeOrder theOrder )" of the SmoothieShop, where they ask for inventory update and total sales. I am not sure on how to approach this. Any help would be greatly appreciated.

Thank you!


CafeOrder


SmoothieShop

HW4.png
[Thumbnail for HW4.png]
HW4.1.png
[Thumbnail for HW4.1.png]
 
Junilu Lacar
Sheriff
Posts: 11494
180
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Andrew Tran wrote:
What i am stuck on is the "double processOrder( CafeOrder theOrder )" of the SmoothieShop, where they ask for inventory update and total sales. I am not sure on how to approach this.

Please be more specific. What exactly are you stuck on? What are you trying to do that isn't working? What do you expect and what results are you getting instead? Point out what you think are the relevant sections of code instead of posting everything you have and expecting people to wade through all that to figure it out for themselves. Thanks.
 
L Hasan
Greenhorn
Posts: 24
4
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I think I understand what you're trying to get out of the method, but at best it would be guessing; you want to take an order and, based on said order, reduce the inventory amounts of stock appropriately, and then return the cost of the sale?

You could easily break this into separate methods, one for handling inventory updates, and one that increases sales by the cost of the order.

L.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!