|
To be exact it is one or six gallons of milk - depending on the eggs...
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.
|
|
|
|
|
Precisely.
".45 ACP - because shooting twice is just silly" - JSOP, 2010
- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
Best would be to return a List<GallonOfMilk> whose count depends on the HaveAnyEgg boolean variable.
Or maybe an abstract factory?
You always obtain more by being rather polite and armed than polite only.
|
|
|
|
|
Was "they" declared and initialised properly?
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
"they" is an external reference that automatically gets cast to "this" once the programmer arrives at the store.
".45 ACP - because shooting twice is just silly" - JSOP, 2010
- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
Then I'm afraid I'm as lost as you are, Mate. I can't see the problem.
Ship it.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
Yeap: the punctuation.
In your case is the "." higher priority delimiter, so the "get six" belong to the eggs. So
- get a gallon of milk
- if the have eggs, get six.
Get a gallon of milk, if they have eggs, get six. Translates into
- get a gallon of milk
- if the have eggs, get six gallons of milk.
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Exactly my thought!
He got the story wrong!
|
|
|
|
|
You clearly aren't spending long enough in QA - you missed the obvious recursion:
private List<Produce> shopping = new List<Produce>();
public void GetMilk(int count)
{
while (count > 0)
{
shopping.Add(new Milk());
if (shop.HasEggs()) GetMilk(6);
count--;
}
}
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
This one?[^]
"While you're out can you get milk, if they have eggs can you get 6"
--
"My software never has bugs. It just develops random features."
|
|
|
|
|
They only sell eggs in 12 and 18 packs where I shop. So does she mean 6 containers of 12 eggs?
Hogan
|
|
|
|
|
Who the heck buys milk in gallons (or sells it that way, come to that)?
I am not a number. I am a ... no, wait!
|
|
|
|
|
'Mericans [^]
Anything that is unrelated to elephants is irrelephant Anonymous
- The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944
- I'd just like a chance to prove that money can't make me happy. Me, all the time
|
|
|
|
|
Correct me if I'm wrong (I'm not) but I'm pretty sure there's a 1000 millifeet in a foot, and 1000 yards in a kiloyard too. The basic units don't become any less arbitrary because you stick a predefined multiplier in front of them when you want something a bit bigger. And surely the farce by which we are now required to fly in the face of all logic and define a kB as literally 1000 bytes just because should prove that beyond all doubt. You can keep your measurements for the functionally innumerate. I'll die happy in the knowledge that throughout my life I was able to calculate in diverse number bases without the slightest trouble as a result of my education in proper units. They don't call them Imperial for nothing, you know!
Now if you don't mind, I have to take the dog for her half mile walk to buy a couple of pints of milk and a quarter pound of mushrooms. I hope they've moved that yard of sand that was blocking the path yesetrday!
Edit: oops, for got the point of this reply. It was the size of the 'portions' that I was referring to, not the units that they were measured in! Though, you probably got the latter point already!
I am not a number. I am a ... no, wait!
|
|
|
|
|
Perhaps the person was using the more sensible metric system and didn't know how much a gallon was?
|
|
|
|
|
John Simmons / outlaw programmer wrote: Am I missing something?
Yes. The "While you're out".
|
|
|
|
|
There was a While loop!
Anything that is unrelated to elephants is irrelephant Anonymous
- The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944
- I'd just like a chance to prove that money can't make me happy. Me, all the time
|
|
|
|
|
... man up and stop making such a fuzz about buying groceries
|
|
|
|
|
Ok, bagging it up.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
peterchen wrote: stop making such a fuzz about buying groceries Don't tell me that those bluddy daft Americans have take their spelling reform to an even more ridiculous level!
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
"bloody"
".45 ACP - because shooting twice is just silly" - JSOP, 2010
- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
Take this man out and shoot him.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
FINE, let me just get my camera
*Click*
»»» <small>Loading Signature</small> «««
· · · <small>Please Wait</small> · · ·
|
|
|
|
|
Pic or it didn't happen!
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
Here[⌂]. As requested
»»» <small>Loading Signature</small> «««
· · · <small>Please Wait</small> · · ·
|
|
|
|