OK got them I'll tell you the rest tomorrow. Goodnight.

Don't know if you will see me a lot today.
Must say you already did a nice job in translating this from C++ to C#.
I tweaked your code a bit and added some comments.
It even compiles and starts up now.
This is how my console screen looks after typing 1 and 2;
AccountConsole.png
I also include the modified files in a zip so you can work further on them.
Success!
Any questions, please ask.

//thanks,have a question ,are the parameters list in the rest of the functions ,like withdraw,logement (in switch)should be empty too?

Yes, of course.

A bit confused here:
public static void Lodgement()//List<Account> list)

   //    A bit confused here:
        public static void Lodgement()//List<Account> list)
        {

            Console.WriteLine("Process Logement");
            Console.WriteLine("Enter account name");
            string name = Console.ReadLine();
            Console.WriteLine("Enter logement amount");
          int logementAmount = Console.ReadLine();//??

          list.credit(logementAmount); //???

           //Display ???




       }

This is what I first would come up with:

public static void Lodgement()//List<Account> list)
        {
            try
            {
                Console.WriteLine("Process Lodgement");
                Console.WriteLine();
                Console.Write("Enter account name: ");
                string name = Console.ReadLine();
                Console.Write("Enter lodgement amount: ");
                double lodgementAmount = Convert.ToDouble(Console.ReadLine());
                int accountIndex = list.FindIndex(x => x.Name == name);
                list[accountIndex].Credit(lodgementAmount);
                Console.WriteLine("New balance details:");
                list[accountIndex].Display();
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception: {0}", e.Message);
            }
        }

Hope this very much explains itself, except perhaps the lambda expression in FindIndex. As this is a financial application, you could perhaps switch to a decimal type instead of a double type for the amounts.

Thanks,managed to do wihdrawal method too,very similar.Question,values i change exists only,while i run program and once exit and restart,values appears by default harcoded unchanged? Is it supposed to be like this?

Don't know exactlywhat you mean, but values that are typed in are lost when the program finishes, unless you implement some sort of filing.

How different the dynamic cast in c#,try to figure out for interestRate method. And is it possible to change exception to custom message,like account name does not exists for logement method?Thanks

C# has only one cast. If you want to cast a variable to a type you do
(Atype)Avariable
In the catch part you can write as many WriteLines as you like.

Thank you.I manged to finish it.
From your file i can see you are interested in maths too.Do you do any algorithms to find prime for instance or cryptology in c#?

Click on my avatar and then on the code snippets link. Several snippets in the list are related to math. Or go directly clicking my snips

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.