Skip to main content

Section 1.10 Unit 1 Mixed Up Code Practice

90 minutes
Try to solve each of the following. Click the Check 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.
Most of these are exercises are written by Dr. Barb Ericson from the AP CSP and Welcome to CS ebooks on Runestone.

Activity 1.10.1.

The following program segment should draw a red line. The blocks have been mixed up. Drag the blocks from the left and put them in the correct order on the right. There will be 2 extra blocks that you will not use. Click the Check Me button to check your solution.

Activity 1.10.2.

The following program segment should draw an U shape. The bottom of the U will be shorter than the sides. The default turtle faces east (right) at the start. Start by turning south. The blocks have been mixed up. Drag the blocks from the left and put them in the correct order on the right. Click the Check Me button to check your solution.

Activity 1.10.3.

The following code should print Maria’s first name on one line and her last name on the next line. But, the blocks have been mixed up and include an extra block that isn’t needed in the solution. Drag the blocks from the left and put them in the correct order on the right. Click the Check Me button to check your solution.

Activity 1.10.4.

The following code should print the words to a famous poem. 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 Check Me button to check your solution.

Activity 1.10.5.

The following code should print a sentence about Marcus’ favorite color on one line. But, the blocks have been mixed up and include an extra block 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 Check Me button to check your solution.

Activity 1.10.6.

The following code should print the first 2 characters of the message followed by the last 2 characters of the message. But, the blocks have been mixed up and include an extra block 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 Check Me button to check your solution.

Activity 1.10.7.

The following code should print the initials in the first, middle, and last name in lowercase. But, the blocks have been mixed up and include an extra block 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 Check Me button to check your solution.

Activity 1.10.8.

The following code should print the first 3 letters of message in uppercase letters. But, the blocks have been mixed up and include an extra block 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 Check Me button to check your solution.

Activity 1.10.9.

The following program segment should print out the cost for each shirt if they are to buy 2 and get the third free but were originally $45 each. The blocks have been mixed up. Drag the blocks from the left and put them in the correct order on the right. Click the Check button to check your solution.

Activity 1.10.10.

The following program segment should print out the cost per person for a dinner including the tip. But the blocks have been mixed up and include an extra block 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 Check button to check your solution.

Activity 1.10.11.

The following program segment should print the amount of punch left in a two-gallon punch bowl if 12oz is poured into as many cups as possible. One gallon contains 128oz and the punch bowl is full. However, the blocks have been mixed up and include an extra block 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 Check button to check your solution.

Activity 1.10.12.

The following program segment should print the number of seconds in 5 days. However, the blocks have been mixed up and include an extra block 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 Check button to check your solution.

Activity 1.10.13.

The following program segment should print the number of months it would take you to save 500 if you make 50 a week. However, the blocks have been mixed up and include an extra block 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 Check button to check your solution.

Activity 1.10.14.

The following program segment should print the cost of a trip that is 200 miles when the price of gas is 2.20 and the miles per gallon is 42. However, the blocks have been mixed up and include an extra block 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 Check button to check your solution.

Activity 1.10.15.

The following program segment should print how many miles you can go on half a tank of gas if the miles per gallon is 26 and your tank holds 15 gallons. However, the blocks have been mixed up and include an extra block 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 Check button to check your solution.

Activity 1.10.16.

The following program segment should print how many chicken wings you can buy with $3.50 if the wings are $.60 each. However, the blocks have been mixed up and include an extra block 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 Check button to check your solution.

Activity 1.10.17.

The following program segment should print how much you will have to pay for an item that is 60% off the original price of $52.99. However, the blocks have been mixed up and include an extra block 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 Check button to check your solution.

Activity 1.10.18.

The following program segment should print how much each pair of shorts costs when there is a buy 2 and get the third free sale. The shorts were originally $39.99 each. However, the blocks have been mixed up and include an extra block 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 Check button to check your solution.

Activity 1.10.19.

Arrange the code so the following is printed in order: 55, β€œcomputer science”, 0. The blocks have been mixed up and include an extra block 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 Check button to check your solution.

Activity 1.10.20.

The following program segment should swap the values of x and y after val1 and val 2 are assigned to x and y, respectively. However, the blocks have been mixed up and include an extra block 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 Check button to check your solution.
You have attempted of activities on this page.