swaysteady
Defining a protected method with a single call. Failing verification and I can't figure out why
Instructions
Please define a public class named Question. This class should be abstract as it will be inherited by other classes. The Question class should have an automatic public property called Label which should be a string. The Label property must have both a getter and a setter.
The Question class should define a protected method named CreateAnswer that has a single string parameter. This method should be abstract so should not have an implementation within this class. The method must return an instance of Answer. The input parameter must be named input and represents the user's response from the question.
The Question class should define a protected method named PrintQuestion that by default will write Label property value to the Console using WriteLine. It must be possible to override this method in any inherited classes.
The Question class should also define a public method named Ask which will first print the question. It will then collect the next line from Console using ReadLine and create an answer by returning the value of the CreateAnswer method, using the collected input.
The answer must then be returned as the return value of the Ask method.
[part 3/3]
4 replies
Defining a protected method with a single call. Failing verification and I can't figure out why
My submission is below and the instructions are below that, with the relevant paragraph in bold. I'm sure I'm missing something basic, can you help train my beginner eye and point me to where I'm going wrong? Thank you!
My Submission
[part 2/3]
4 replies