Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to add two numbers and store the result.
C Sharp (C#)
int sum = 5 [1] 3;
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-' subtracts instead of adding.
Using '*' multiplies instead of adding.
✗ Incorrect
The plus sign + adds two numbers together.
2fill in blank
mediumComplete the code to find the remainder when dividing 10 by 4.
C Sharp (C#)
int remainder = 10 [1] 4;
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '/' gives the quotient, not the remainder.
Using '*' multiplies instead of dividing.
✗ Incorrect
The percent sign % gives the remainder after division.
3fill in blank
hardFix the error in the code to multiply two numbers correctly.
C Sharp (C#)
int product = 7 [1] 6;
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '+' adds instead of multiplying.
Using '/' divides instead of multiplying.
✗ Incorrect
The asterisk * is used to multiply numbers in C#.
4fill in blank
hardFill both blanks to create a dictionary of squares for numbers greater than 3.
C Sharp (C#)
var squares = new Dictionary<int, int> { { [1], [2] } }; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a key less than or equal to 3.
Using a value not matching the square of the key.
✗ Incorrect
The key is 4 and the value is 16 (4 squared).
5fill in blank
hardFill all three blanks to create a dictionary of cubes for numbers greater than 1.
C Sharp (C#)
var cubes = new Dictionary<int, int> { { [1], [2] }, { [3], 27 } }; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up keys and values.
Using squares instead of cubes.
✗ Incorrect
The first pair is key 2 with value 8 (2 cubed). The second pair is key 3 with value 27 (3 cubed).