NO. In this case you are assigning the userInput to the property and not reading it (which in this case is as passing to the
WriteLine
method the
userInput
variable).
try this
convert.Hours = userInput;
Console.WriteLine(convert.Hours);
First assign a value (call the setter) and then by passing the property as a parameter, method
WriteLine
will call the getter.
What are you trying to achieve precisely?
P.S.
Another thing, it will never increment, you are always assagning the same thin to
seconds
, in order to make it "grow" you need to do something like this
seconds += value * 3600;
or however implement the proper algorithm that considers the seconds value.