Compiler Error Quiz (C#)
Options:
- Given a project/solution with errors in it: resolve it.
- Given a pair of errormessages: make sure they occur in their own project.
General quiz questions
- What is the difference between a compiler warning and a compiler error?
- What is the difference between a compiler error and an exception?
Cause the following error
- Cause a particular error.
- Can be ‘as fast as possible’, or ‘in as small a program as possible’.
- This can be done in pairs.
- Agree if the teams are allowed to search the Internet.
- You may not take program examples literally from the Internet!
- Extra: make a randomizer (virtual or real top hat with papers with the errors on it).
- Teams can also make up errors for each other!
- You can also use exceptions or warnings.
Here is a possible list of errors:
;
expected
- Only assignment, call, increment, decrement, and new object expressions can be used as a statement.
- Operator ‘*’ cannot be applied to operands of type ‘int’ and ‘string’.
- Inconsistent accessibility: parameter type ‘Hat’ is less accessible than method ‘PutOnHead’.
- ‘Hat’ does not contain a constructor that takes ‘2’ arguments.
- The name of type ‘TYPE’ is too long. (so in the place of TYPE you have to fill in another name yourself).
- ‘Vegetable Garden.LengthInMeter(Tools) : not all code paths return a value. ‘