Giter Club home page Giter Club logo

bankaccount's Introduction

BankAccount

We are going to create a BankAccount class. This class will recreate some of the common account transactions that normally occur for a bank account such as displaying your account number, checking and savings amount, total amount. Of course, there are also methods to invoke, such as depositing a check, checking your balance, withdrawing money.

Objectives:

  • Practice member variables
  • Practice instance methods and getter and setters
  • Implement static variables and methods.

Tasks:

  • Create a BankAccount class.
  • The class should have the following attributes: (string) account number, (double) checking balance, (double) savings balance.
  • Create a class member (static) that has the number of accounts created thus far.
  • Create a class member (static) that tracks the total amount of money stored in every account created.
  • Create a private method that returns a random ten digit account number.
  • In the constructor, call the private method from above so that each user has a random ten digit account.
  • In the constructor, be sure to increment the account count.
  • Create a getter method for the user's checking account balance.
  • Create a getter method for the user's saving account balance.
  • Create a method that will allow a user to deposit money into either the checking or saving, be sure to add to total amount stored.
  • Create a method to withdraw money from one balance. Do not allow them to withdraw money if there are insufficient funds.
  • Create a method to see the total money from the checking and saving.
  • Users should not be able to set any of the attributes from the class.

bankaccount's People

Contributors

priyascape avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.