The testing process: Implementing code or fixing bugs in C#.
Motivation: Basic familiarity with the programming language used on the job is a prerequisite for quickly getting up to speed.
The testing process: Implementing object-oriented programming concepts.
Motivation: Objective paradigm provides good methods for structuring code, making that paradigm very common in modern programming.
User interface contains two types of user input controls: TextInput, which accepts all characters and NumericInput, which accepts only digits.
Implement the class TextInput that contains:
- Public method void Add(char c) - adds the given character to the current value
- Public method string GetValue() - returns the current value
Implement the class NumericInput that:
- Inherits TextInput
- Overrides the Add method so that each non-numeric character is ignored
For example, the following code should output "10":
TextInput input = new NumericInput(); input.Add('1'); input.Add('a'); input.Add('0'); Console.WriteLine(input.GetValue());
- Example case: System.InvalidCastException
- Adding various characters to TextInput: System.NullReferenceException
- Adding numeric characters to NumericInput: System.InvalidCastException
- Adding various characters to NumericInput: System.InvalidCastException