I'm a student and I have to make a program with Console application to manage a Bank Account, using Classes.
The program must be able to:
- Create e new bank account
- Deactivate a bank account
- Draw money from account
- show the account balance

I tried to write something, and I want to ask you if I'm going worng or need to go through GET and SET.
If you create a bank account, they need more data from your side like date of birth an more.
I wrote some code below, please tell me the next step.

 class Program
    {
        static void Main(string[] args)
        {
            string emri;
            string mbiemri;


           Console.WriteLine("Emri: \t" +"Mbiemri:\t ");
            emri = Console.ReadLine();
            mbiemri = Console.ReadLine();

        }
    } 

Edited 4 Years Ago by dr_iton

I tried to write something

You've achieved declaring two variables and instanciating them, though I must point out even the instanciation will not work as your intending with its current setup, it would set both variables to the same value.

What are you trying to achieve exactly at present? Ie. what is the current goal of the above code? It is not exactly clear. Maybe then some help may be provided, however remember we are not here to write all the code for you, which at present it looks like is required unless I'm getting the wrong end of the stick :)

Edited 4 Years Ago by Mike Askew

I'm a student and I have to make a program with Console application to manage a Bank Account, using Classes.
The program must be able to:
- Create e new bank account
- Deactivate a bank account
- Draw money from account
- show the account balance

I tried to write something, and I want to ask you if I'm going worng or need to go through GET and SET.
If you create a bank account, they need more data from your side like date of birth an more.
I wrote some code below, please tell me the next step.

I'm a student and I have to make a program with Console application to manage a Bank Account, using Classes.
The program must be able to:
- Create e new bank account
- Deactivate a bank account
- Draw money from account
- show the account balance

I tried to write something, and I want to ask you if I'm going worng or need to go through GET and SET.
If you create a bank account, they need more data from your side like date of birth an more.
I wrote some code below, please tell me the next step.

I'm a student and I have to make a program with Console application to manage a Bank Account, using Classes.
The program must be able to:
- Create e new bank account
- Deactivate a bank account
- Draw money from account
- show the account balance

I tried to write something, and I want to ask you if I'm going worng or need to go through GET and SET.
If you create a bank account, they need more data from your side like date of birth an more.
I wrote some code below, please tell me the next step.

Personally I would begin to write the class for your bank account. In the very least draft what properties you'll need to keep track of and the constructor to implement them upon instantiation. With the skeleton class standing up you'll be in a better position to see what information you need to be collecting from the user.

I'm providing you with a basic example in the hopes you'll take it simply as an example. I wouldn't recommend just copying and pasting this example. Not only is it incomplete (it never checks to see if the account is active prior to withdrawing, for example) but also because it won't be written in your style. You won't learn anything by just copying and pasting my example. You'll also run the risk of being caught by your professor if they're used to you writing code in a certain fashion and this doesn't line up.

class Account
{
    private List<Person> _owners = new List<Person>();
    private bool _status = false;
    private double _balance = 0.00;

    /// <summary>
    ///     Create a new account with a single owner.
    /// </summary>
    /// <param name="owner"></param>
    /// <param name="status"></param>
    /// <param name="balance"></param>
    public Account(Person owner, bool status, double balance)
    {
        this._owners.Add(owner);
        this._status = status;
        this._balance = balance;
    }

    /// <summary>
    ///     Create a new account with multiple owners.
    /// </summary>
    /// <param name="owners"></param>
    /// <param name="status"></param>
    /// <param name="balance"></param>
    public Account(List<Person> owners, bool status, double balance)
    {
        this._owners = owners;
        this._status = status;
        this._balance = balance;
    }

    /// <summary>
    ///     Deactivate account.
    /// </summary>
    public void DeactiveAccount()
    {
        this._status = false;
    }

    /// <summary>
    ///     Activate account.
    /// </summary>
    public void ActivateAccount()
    {
        this._status = true;
    }

    /// <summary>
    ///     Return current activation status of the account.
    /// </summary>
    /// <returns></returns>
    public bool IsAccountActive()
    {
        return this._status;
    }

    /// <summary>
    ///     Withdrawn given amount from balance.  Return balance to reflect changes.
    /// </summary>
    /// <param name="amount"></param>
    /// <returns></returns>
    public double Withdrawal(double amount)
    {
        return this._balance = this._balance - amount;
    }

    /// <summary>
    ///     Return the current balance of the account.
    /// </summary>
    /// <returns></returns>
    public double GetBalance()
    {
        return this._balance;
    }
}

Ok, I can see the code, and thank you very much for the reply. Correct me if I'm wrong.
At the beginning you created a method to make a list of members.
Account balance is zero, after that I need to make some code, also you made an instantiation, etc. Ok I've got the point now, the problem was that I did not had a clue how to begin, now I'll try and after I'll finish it (before 13th of this month) I'll post my solution.
Once again, thank you for your reply.
P.S. Can I ask for help in this topic if I'm stucked on a code.

This article has been dead for over six months. Start a new discussion instead.