Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to call the method using a named argument for 'age'.
C Sharp (C#)
PrintPersonInfo(name: "Alice", [1]: 30);
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong parameter name like 'info' or 'person'.
Forgetting to use the parameter name before the value.
✗ Incorrect
The method expects a named argument 'age' to specify the person's age.
2fill in blank
mediumComplete the method call using named arguments for both parameters.
C Sharp (C#)
DisplayMessage([1]: "Hello", [2]: 5);
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping parameter names or using incorrect names.
Omitting parameter names when required.
✗ Incorrect
The method parameters are named 'text' and 'count', so use these names in the call.
3fill in blank
hardFix the error by using the correct named argument in the method call.
C Sharp (C#)
CalculateArea(width: 10, [1]: 5);
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'length' or 'depth' instead of 'height'.
Not matching the parameter names exactly.
✗ Incorrect
The method expects a parameter named 'height' to calculate the area.
4fill in blank
hardFill both blanks to call the method with named arguments in any order.
C Sharp (C#)
SetUserDetails([1]: "John", [2]: 25);
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect parameter names like 'username' or 'score'.
Mixing up the order without using named arguments.
✗ Incorrect
The method parameters are 'name' and 'age'. Named arguments can be in any order.
5fill in blank
hardFill all three blanks to call the method with named arguments correctly.
C Sharp (C#)
CreateAccount([1]: "user123", [2]: "pass456", [3]: "user@example.com");
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong parameter names like 'address'.
Forgetting to use named arguments for clarity.
✗ Incorrect
The method parameters are 'username', 'password', and 'email'. Use these names as named arguments.