What I'm trying to do is make a banking application and at the beginning it would ask whether you want to create a savings or a current account and then asks you to enter a name for the one you selected. I'm trying to make the program create an object with a name that I've written down. It doesn't recognize the name that I've given them.
class Program{ static void Main() { Console.WriteLine("Enter 's' if you want a savings account. Enter 'c' if you want current account."); string which = Console.ReadLine(); if (which == "s") { Console.WriteLine("Enter Name"); string name = Console.ReadLine(); Savingacc name; name = new Savingacc(); name.mainmenu(); } else if (which == "c") { Console.WriteLine("Enter Name"); string name = Console.ReadLine(); Currentacc name; name = new Currentacc(); name.mainmenu(); } }}