Change Contents of the Bubble
View this PageEdit this PageUploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

FinalExam Review Spring2006: Make a smarter distributor

Questions? Answers? Comments? Comments on Questions or Answers?
(Back to Final Exam Review Spring2006)



To add to the order, could I use

amountOrdered = this.newOrders() + 5;

That seems way too simple for the answer, but I'm out of ideas. Help.

I don't think that's it... We just consume 5 more orders...
In processEvent(),

if (factory.amountAvailable() >= amountOrdered +5)
{
factory.consume(amountOrdered +5);
...

My question is, when do we "sell them along the road"?
It's discrete event simulation...


Maybe it just means that when it arrives at the store or whatever, it will only have the amountOrdered... I'm not sure exactly how you'd do that though. REMOVEDke drop off amount = amountOrdered or something Or really -I guess it would have an effect on the truck waiting at the warehouse and all, but dropping it off it wouldn't really matter, cause it doesn't say, I dropped off more than was ordered Oh no! - they just get their order, I suppose you could have a print line that says, and I sold 5 along the way... ? I dunno.

The second and third posters are arguing the first poster out of the right answer. Second poster is doing the same thing as the first poster, but taking more code to do it. Mark Guzdial

So I am to assume that the first poster was right then?

From what I understand, the distributors will sell all the amountOrdered items before returning to the factory for more, so as long as they order it, they sell it.

Yeah - I think what he's saying is that we're all saying the same thing, even though we think we're arguing a new right point. So just stick with the first one being the most succinct right answer...

This test review seems to have a lot of simple answers......

Simple, but you have to know where to put them and you have to understand that that's all it needs and stuff. Sometimes the simple ones are the hardest... yeah...

i completely agree

where is jim and his signature consummate answers?



Link to this Page