Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: i need help writing this assignment

  1. #1
    Junior Member
    Join Date
    Mar 2013
    Location
    Malaysia
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question i need help writing this assignment

    Design an abstract class named 1. BankAccount to hold the following data for a bank account:
    • Balance
    • Number of deposits this month
    • Number of withdrawals
    • Annual interest rate

    The class should have the following methods:

    Constructor:
    The constructor should accept arguments for the balance and annual interest rate.

    Deposit:
    A method that accepts an argument for the amount of the deposit. The method should add the argument to the account balance. It should also increment the variable holding the number of 2 deposits.

    Withdrawal:
    A method that accepts an argument for the amount of the withdrawal. The method should subtract the argument from the balance. It should also increment the variable holding the number of withdrawals.

    calculateInterest:
    A method that updates the balance by calculating the monthly interest earned by the account, and adding this interest to the balance. This is performed by the following formulas:

    Monthly Interest Rate = (Annual Interest Rate / 12)
    Monthly Interest = Balance * Monthly Interest Rate
    Balance = Balance + Monthly Interest


    Next, design a 2. SavingsAccount class that extends the BankAccount class. The SavingsAccount class should have a status field to represent an active or inactive account. If the balance of a savings account falls below $20, it becomes inactive. (The status field could be a boolean variable.) No more withdrawals can be made until the balance is raised above $20, at which time the account becomes active again. The savings account class should have the following methods:

    withdraw:
    A method that determines whether the account is inactive before a withdrawal is made. (No withdrawal will be allowed if the account is not active.) A withdrawal is then made by calling the superclass version of the method.

    deposit:
    A method that determines whether the account is inactive before a deposit is made. If the account is inactive and the deposit brings the balance above $20, the account becomes active again. The deposit is then made by calling the superclass version of the method.
    Finally, you must provide a 3. CreateAccounts class (GUI based) that demonstrates the functionality of the SavingsAccount. Make sure that the main method in this class creates an instance of SavingsAccount classes and then calls the appropriate methods. For example, it is important to demonstrate that the instance of the SavingsAccount class will compute the appropriate interest values. This class should interact with the user by providing a GUI. As long as you demonstrate the correctness of your SavingsAccount, you are free to implement the CreateAccount in any fashion that you think is acceptable




    Assignment work
    1. First draw an interface stating …
    First interface will have welcome to smart banking
    Login
    Log out

    2. Another GUI will have functions like withdraw, deposit, exit


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: i need help writing this assignment

    Do you have any specific questions about your assignment?
    Please post your code and any questions about problems you are having.

    What have you tried?
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. assignment troubles polymorphism (guide for assignment included)
    By tdawg422 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: October 8th, 2011, 10:01 AM
  2. Writing to files
    By nitwit3 in forum Java Theory & Questions
    Replies: 3
    Last Post: July 25th, 2011, 04:00 AM
  3. writing to an output...
    By lairel in forum Object Oriented Programming
    Replies: 4
    Last Post: March 1st, 2011, 04:27 AM
  4. writing to JEditorPane
    By nasi in forum What's Wrong With My Code?
    Replies: 2
    Last Post: April 8th, 2010, 09:23 PM
  5. Replies: 1
    Last Post: February 22nd, 2010, 08:20 AM