English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I have 3 boxes of mangos

first box got 10 mangos
secound box 10 mangos
third box got 5 mangos

Now if i give a quantity of 15 mangos how doselect the correct boxes.

Logic flow required for making a computer program.

2006-10-20 22:38:12 · 5 answers · asked by bimalpoovadan 1 in Computers & Internet Programming & Design

5 answers

it doesnt matter there all mangos.

2006-10-20 22:42:31 · answer #1 · answered by guanatos86 2 · 0 1

this is a simple program flow explanation since I can't draw you a diagram.

1.set quantity equal to remaining mangos

2. check if the remaining mangos is (>=)greater than or equal(>=)to next box.
if (true), go to line 3. if (false), goto line 2.

3.(true) ->pick box
set remaining mangos=quantity - box

4.if remaining mangos is equal to zero
done

5.if remaining mangos is greater than zero
go back to line 2

2006-10-21 08:30:26 · answer #2 · answered by ne0aes0p 2 · 0 0

I'd help, but obviously you're only posting this question so that you can cheat in computer class.
If you want help for a certain part of the problem, then fine.
Otherwise, it's really selfish and pathetic to ask people to do work that you ought to be doing.

What are you going to do if I help you cheat? Would you come to my house and mow the lawn for me?

2006-10-21 05:48:01 · answer #3 · answered by Balk 6 · 1 1

Do a search on "greedy algorithms" it is obvious you are trying to cheat out a college assignment.

2006-10-21 06:53:38 · answer #4 · answered by Andy T 7 · 0 1

It's dead easy.

The really tough question is, how do you find that out with boxes of BANANAS.

2006-10-21 07:39:40 · answer #5 · answered by poorcocoboiboi 6 · 0 0

fedest.com, questions and answers