This book is now obsolete Please use CSAwesome instead.
7.13. Mixed Up Code Practice¶
Try to solve each of the following. Click the Check Me button to check each solution. You will be told if your solution is too short, has a block in the wrong order, or you are using the wrong block. Some of the problems have an extra block or two that aren’t needed in the correct solution. Try to solve these on your phone or other mobile device!
The following program segment should print out all the values from 20 to 30 (20, 21, 22, … 30). But, the blocks have been mixed up. Drag the blocks from the left and put them in the correct order on the right. Click the <i>Check Me</i> button to check your solution.</p>
The following program segment should print a countdown from 15 to 0 (15, 14, 13, … 0). But the blocks have been mixed up and include <b>one extra block</b> that is not needed in a correct solution. Drag the needed blocks from the left and put them in the correct order on the right. Click the <i>Check Me</i> button to check your solution.</p>
The main method in the following class should print up from 0 to 50 by 5 (0, 5, 10, 15 … 50). But, the blocks have been mixed up and include <b>an extra block</b> that isn’t needed in the solution. Drag the needed blocks from the left and put them in the correct order on the right. Click the <i>Check Me</i> button to check your solution.</p>
The main method in the following class should print out the values from 0 to 100 by 20’s (0, 20, 40, .. 100). But, the blocks have been mixed up and include <b>an extra block</b> that isn’t needed in the solution. Drag the needed blocks from the left and put them in the correct order on the right. Click the <i>Check Me</i> button to check your solution.</p>
The main method in the following class should print out the values from 100 to 0 by 10’s (100, 90, 80, … 0). But, the blocks have been mixed up and include <b>an extra block</b> that is not needed in a correct solution. Drag the needed blocks from the left and put them in the correct order on the right. Click the <i>Check Me</i> button to check your solution.</p>
The main method in the following class should print 10 rows with 5 <code>*</code> in each row. But, the blocks have been mixed up and include <b>one extra block</b> that isn’t needed in the solution. Drag the needed blocks from the left and put them in the correct order on the right. Click the <i>Check Me</i> button to check your solution.</p>
The main method in the following class should print 3 rows with 6 <code>*</code> in each row. But, the blocks have been mixed up and include <b>two extra blocks</b> that aren’t needed in the solution. Drag the needed blocks from the left and put them in the correct order on the right. Click the <i>Check Me</i> button to check your solution.</p>
The main method in the following class should print 1, then 22, and then 333. But, the blocks have been mixed up and include <b>an extra block</b> that isn’t needed in the solution. Drag the needed blocks from the left and put them in the correct order on the right. Click the <i>Check Me</i> button to check your solution.</p>
The main method in the following class should print 11111, 22222, 33333, 44444, and 55555. But, the blocks have been mixed up and contain <b>two extra blocks</b> that are not needed in a correct solution. Drag the blocks from the left and put them in the correct order on the right. Click the <i>Check Me</i> button to check your solution.</p>
The main method in the following class should print 11111, 2222, 333, 44, 5. But, the blocks have been mixed up and include <b>one extra block</b> that isn’t needed in a correct solution. Drag the needed blocks from the left and put them in the correct order on the right. Click the <i>Check Me</i> button to check your solution.</p>