Giter Site home page Giter Site logo

bell-kevin / multiplesavingsaccounts Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 86 KB

In this example, you will enhance the Savings Account driver to create multiple accounts. The project will create 3 separate Savings Accounts, simulating 3 different customers creating these accounts. Note that no changes are needed in the Account class – it describes an account, and it doesn’t matter how many accounts we create with that class. It’s like a favorite cookie recipe – it’s the same recipe no matter how many times you bake cookies. First, MAKE A COPY of the previous project for the Savings Account. In the project in Example 1, a Savings Account was created with this line: Account savingsAccount = new Account(); In this project, for clarity, name that account “savings1”, like this: Account savings1 = new Account(); To create a second account, you repeat that same code but with a different name for the object. Account savings1 = new Account(); // first account Account savings2 = new Account(); // second account When this executes, there will be 2 distinct account objects. Each one has its own instance variables of balance and interest rate, and each has its own methods to get and set its variables and to grow. Create a third account. The original project asked the user for 3 pieces of information for 1 account. This project simulates asking 3 different users for those 3 pieces of information. That sounds like repetition, so use a FOR loop to ask for the data and assign the values to the variables in each object. Also grow the accounts inside this loop. You must use the same variables for the user input – balance, interestRate, and cycles – for each user’s information. Do not create 3 sets of those variables.

License: GNU General Public License v3.0

Java 100.00%
accounts object-oriented-programming oop savings-account

multiplesavingsaccounts's People

Contributors

bell-kevin 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.