1. Introduction

Please read the following, watch the videos, and try to solve the problems.

1.1. Solving Mixed-up Code Problems

If you see a problem like the one below you will need to put the mixed-up code in the correct order on the right side. You may need to indent the blocks as well. There may also be extra blocks that are not needed in a correct solution that you can leave on the left side. Click the “Check” button to check your solution.

See the video below for an example.

Try to solve the following mixed-up code problem. This problem doesn’t require any indentation.

Drag the blocks from the left and put them in the correct order on the right. The text in each block defines the order.

Try to solve the following mixed-up code problem. This problem requires indentation.

Drag the blocks from the left and put them in the correct order on the right with the correct indentation. The text in each block defines the order and indentation.

Try to solve the following mixed-up code problem. This problem requires indentation and has extra blocks that are not needed in a correct solution.

Drag the blocks from the left and put them in the correct order on the right with the correct indentation. There is an extra block that is not needed in the correct solution.

The mixed-up code problems have a “Help me” button at the bottom of the problem. Once you have checked at least three incorrect solutions you can click the button for help. It will remove an incorrect code block, if you used one in your solution, or combine two blocks into one if there are more than three blocks left.

See the video below for an example.

1.2. Solving Write Code Problems

If you see a problem like the one below, you will need to write code. The problem will have unit tests that you can run to check that your code is working correctly. Click on the “Run” button to compile and run your code. Look after the code area for compiler errors and/or unit test results.

See the video below for an example.

Finish writing the code for the following problem.

Write a function called double(num) that takes a number num and returns the number times 2. For example, double(2) should return 4 and double(-1) should return -2. Look below the code to check for any compiler errors or the results from the test cases. Be sure to return the result.

1.3. Feedback

Q-8: Please provide feedback here. Please share any comments, problems, or suggestions.

1.4. What to do next

Go on to the next page for practice. Click on the right arrow button on the bottom right side of the page.

You have attempted of activities on this page