Ok so first let me say hi, im new to the forum, 1st time poster but long time follower. I'm a student, who knows some java and some c#, but not enough to be proficient in either =( hoping to turn that around with c# over the next 3 months.
so heres the first problem ive run into thats driving me crazy: im trying to just do a normal prompt, and then read the data entered in by user and convert to int. done it plenty of times, but for some reason I can't seem to get the dumb terminal to come up! (im using a mac, and for now at least Im using mono...but tomorrow while im out im going to install 7 on parallels) I think it has something to do with how im calling it, but i have it set up like this:
class Program
{
static void Main(string[] args)
{
test t1 = new test();
t1.Run();
}
}
then,
class test
{
public void Run()
{
int firstNumber;
int secondNumber;
Console.WriteLine("Welcome to the number comparer!");
Console.WriteLine();
Console.Write("Enter the first number: ");
firstNumber = Convert.ToInt32(Console.ReadLine());
Console.WriteLine();
Console.Write("Enter the second number: ");
secondNumber = Convert.ToInt32(Console.ReadLine());
if (Math.Abs(firstNumber - secondNumber) <= 5)
Console.WriteLine("{0} and {1} are within 5 integers of each other!", firstNumber, secondNumber);
else
Console.WriteLine("{0} and {1} are NOT within 5 integers of each other!", firstNumber, secondNumber);
}
}
im sorry, im sure it is something so freaking stupid and im gunna be embarassed...but i am just making this switch as of last week back from java to c#. anyways, thanks in advance for your help. i hope those tags work =/