Is this the correct way to do it, since I'm new to C#
Console.WriteLine("please enter m,y,n: \n");
double month, year, numberOfMonths = Convert.ToDouble(Console.ReadLine());
Is this the correct way to do it, since I'm new to C#
Console.WriteLine("please enter m,y,n: \n");
double month, year, numberOfMonths = Convert.ToDouble(Console.ReadLine());
You can do it by asking user to enter the values split-ed by some delimiter like space, semi colon etc. And then split the value and parse accordingly. for example
Ofcourse the above code is not the most elegant/efficient/error free code. But, it is just written to get the idea across.
You can also store input in an array and tell the user to press enter after every input and then doing this:
then you can convert the string input to whatever datatype you want, the above is not a very efficient way, but you can use it to get large number of input from user and its easy when all the input have the same datatype.
try this: