Warehouse exercise for CS class

Question: Suppose the following code executes given a Warehouse class following the specification from the assignment. What would be printed out? If my understanding is correct I have a max of 42 and I can only take 37 given my warehouse (w) then I receive 86 new items of 46's but since my warehouse can only take 37 I take 37 and now since my max is 42 I'm left over with 5 then for the last line of code is printing out how much I have left over of how many available items I can take its gonna be 82 - 5 which is 77 the answer would be 77. Would love to get any clarification or where I went wrong.
No description
1 Reply
JavaBot
JavaBot3w ago
This post has been reserved for your question.
Hey @Majestic! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here. 💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.

Did you find this page helpful?