Cookieman
BSOD Kernel Dump Senior Analyst
Hi all
Finally managing to grab a bit of time to learn a little bit about programming, after swaying to and fro I decided to learn c# . I have a simple program I am trying to create for work which involves user input. What I need to do is ask for user input for a variable, which in this case I have called nom
I know that in C++ I can grab the input I need by simply using the following:
What I want to do is to convert this to c#. So far I have this.. (and failed miserably!)
From what I can tell it is getting the input as a string and would need converting to float but is there an easier way?
Finally managing to grab a bit of time to learn a little bit about programming, after swaying to and fro I decided to learn c# . I have a simple program I am trying to create for work which involves user input. What I need to do is ask for user input for a variable, which in this case I have called nom
I know that in C++ I can grab the input I need by simply using the following:
Code:
float nom;
cout << "Please Enter The Product Nominal: " >> cin nom;
What I want to do is to convert this to c#. So far I have this.. (and failed miserably!)
Code:
float nom;
Console.WriteLine("Enter Product Nominal");
nom = Console.ReadLine();
From what I can tell it is getting the input as a string and would need converting to float but is there an easier way?