help to Slove a Problem ...

500ml,300ml glasses. How will you dole out 100ml,200ml water?

this is the problem..

I need to use this in a program...but unable to solve it.

pls help!

s it possible to solve?

[213 byte] By [ultranumerica] at [2007-11-27 11:38:03]
# 1

> 500ml,300ml glasses. How will you dole out

> 100ml,200ml water?

>

> this is the problem..

> I need to use this in a program...but unable to solve

> it.

Try harder

>

> s it possible to solve?

Yes.

What specific Java problem are you having?

cotton.ma at 2007-7-29 17:17:57 > top of Java-index,Java Essentials,New To Java...
# 2

200ml is simple.

100ml is only slightly more difficult.

floundera at 2007-7-29 17:17:57 > top of Java-index,Java Essentials,New To Java...
# 3

im doing like this....

but still unable to slove...

fill up the 300 mL cup, pour that into the 500 mL cup.

refil the 300mL cup again, pour it into the 500mL cup till that one's full.

the 300mL cup now has 100mL in it,

After that no IDEA...

any idea how to slove this issue!!

need help!

ultranumerica at 2007-7-29 17:17:57 > top of Java-index,Java Essentials,New To Java...
# 4

I know how to solve it but no idea how to slove it.

BTW you figured out the harder of the two. 200ml is very simple.

floundera at 2007-7-29 17:17:57 > top of Java-index,Java Essentials,New To Java...
# 5

To get 100 ml (Considering the glasses are symmetric)

Slant both the glasses and fill water in them till you have a line from the top edge to the bottom.. AT this pt the quantity in both the glasses are 250 ml and 150 ml !!

Hope the figure helps

|\ |

|_\|

Fill the 300 ml glass and you have 100 ml in the 500 ml glass !!

New_Kida at 2007-7-29 17:17:57 > top of Java-index,Java Essentials,New To Java...
# 6

He (the OP) did just fine for the 100ml

for the 200 ml, fill the 500 ml, then using that fill the 300 ml and there are 200 ml left in the 500 ml glass.

Now use these two ideas and try to convert them to a Java design and code it. Once you have something coded, if it doesn't work, post that code and the errors it produced, and we will help you further.

masijade.a at 2007-7-29 17:17:57 > top of Java-index,Java Essentials,New To Java...