Recall & Review
beginner
What is a parameter in C#?
A parameter is a variable listed in a method's definition. It acts like a placeholder for the value that the method will receive when called.
Click to reveal answer
beginner
What is an argument in C#?
An argument is the actual value or expression passed to a method when it is called. It fills the parameter's placeholder.
Click to reveal answer
beginner
Explain the difference between parameters and arguments.
Parameters are variables in the method definition; arguments are the real values passed to the method when calling it.
Click to reveal answer
intermediate
What happens if you call a method with fewer arguments than parameters?
You get a compile-time error unless the parameters have default values or are optional.
Click to reveal answer
intermediate
Can parameters have default values in C#? How does it affect arguments?
Yes, parameters can have default values. If an argument is not provided for that parameter, the default value is used.
Click to reveal answer
In C#, what do you call the variable inside a method definition that receives a value?
✗ Incorrect
The variable inside the method definition that receives a value is called a parameter.
What is passed to a method when you call it?
✗ Incorrect
The actual value passed to a method when calling it is called an argument.
If a method has a parameter with a default value, what happens if you omit the argument?
✗ Incorrect
If an argument is omitted for a parameter with a default value, the default value is used.
Which of these is true about parameters and arguments?
✗ Incorrect
Parameters are placeholders in method definitions; arguments are the actual values passed.
What error occurs if you call a method with fewer arguments than required parameters without defaults?
✗ Incorrect
Calling a method with fewer arguments than required parameters causes a compile-time error.
Describe in your own words what parameters and arguments are in C# methods.
Think about how you give instructions and how someone follows them with real things.
You got /4 concepts.
Explain what happens if you call a method without providing all arguments for parameters that have no default values.
Imagine forgetting to give someone an ingredient they need to cook.
You got /4 concepts.