Hey ya'll
I'm trying to make an ASCII converter program for school and it needs to have 3 different methods. Don't laugh but here's my newb program:
using System;
using System.Collections.Generic;
using System.Text;
namespace ASCIIWeek4
{
public class Crypto
{
string input;
string value;
string symbol;
public string getInput()
{
int input;
Console.WriteLine("Enter a character: >");
input = Console.Read();
return input;
}
public char convert(string input)
{
int value;
value = Convert.Parse(symbol);
}
public void displayMessage(char letter)
{
Console.WriteLine("The AscII value of your character: " + (char) value + "is" + value);
}
public static void Main(String[] args)
{
return;
}
}
}
I asked my teacher for help and he responded:
"Comments:
Hi, not to worry, I understand. So the problems here are that you have to return the values you read in. For example in the getInput, you're reading into "input" but you're returning "symbol". Also, all of those variables shouldn't be declared globally. You should only declare the variables you need in the methods locally. The convert method, should just be a char.Parse(symbol) and return a char value (as you see in the return value). Then lastly, in the main method, you should have what was shown before in the sample program, but commented out and then changed to your method of naming."
I understand what he's saying (mostly), but I don't know what to change ; ;
I keep getting 3 errors when i debug they are:
Error 1 Cannot implicitly convert type 'int' to 'string' C:\Documents and Settings\USER\My Documents\Unzipped\ASCIIWeek4\ASCIIWeek4\ASCIIWeek4\Program.cs Line:18 Column:20 ASCIIWeek4
Error 2 'System.Convert' does not contain a definition for 'Parse' C:\Documents and Settings\USER\My Documents\Unzipped\ASCIIWeek4\ASCIIWeek4\ASCIIWeek4\Program.cs L:26 C:29 ASCIIWeek4
Error 3 Cannot convert type 'string' to 'char' C:\Documents and Settings\USER\My Documents\Unzipped\ASCIIWeek4\ASCIIWeek4\ASCIIWeek4\Program.cs L:32 C:67 ASCIIWeek4
I am using microsoft visual C# express 2005.
Can anyone tell me what I am doing wrong here and tell me how to correct it. My stress headache is KILLINE ME! lol
Thanks in advance
clueless ~B