Question: Assume two boxes (box A and box B). Each contains zero or more books. What will be left in the boxes after the instructions

 Assume two boxes (box   

Assume two boxes (box "A" and box "B"). Each contains zero or more books. What will be left in the boxes after the instructions below are executed if i) "A" contains 11 books, "B" contains 2 books? ii) "A" contains 5 books, "B" contains 7 books? if (box "A" contains more than 6 books) then while (box "A" contains more books than box "B") do if (box "A" contains more than 4 books) then move 4 books from box "A" to box "B" else else endif endwhile move I book from box "A" to box "B" Imove everything in box "B" to box "A" endif Draw a flow chart for the instructions.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

OUTPUT 1 A3 B10 2 A12 B0 FL... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!