Find Us On: Facebook Twitter Rss Feed Blog
Need To Register? Sign Up Login

Java - BankAccount

ahad2013
ahad2013 


Need a class with suggested methods. need to have assignment completed through strict guidelines. IST 211 Assignment 2 Due Date: Tuesday Sept 30, 2014 Bank Application For this assignment you will create a BankAccount class based on the UML class notation below. In other words you will create a class BankAccount that has the data members and methods shown in the figure above. In Main() you need to use an appropriate constructor to create two BankAccount objects with the following values: Account Number: 25467 Customer: Marsha Brady Type: Checking Balance: $1500.00 Account Number: 87624 Customer: Dwayne Wayne Type: Savings Balance: $746.23 You should then execute the following transactions using the appropriate calls to the Make Deposit() and MakeWithdrawl() methods: Marsha deposits $50.00 Dwayne withdraws $250.00 Marsha deposits $123.56 Dwayne deposits $262.00 Marsha withdraws $475.50 After each transaction use PrintReceipt() to display a receipt of the transaction on the screen. The receipt should include a summary of the transaction and the current amount in the account. As shown in the UML diagram you will need to override the ToString() method for your class. After all of the transactions have been executed use ToString() to display the full details of both accounts. Use the GetBalance() method for retrieving the balance in both of the PrintReceipt() and ToString() methods. Attachments Tags Clarifications

Answers

It includes a class file with all the described functions in the document

nouman92
nouman92 



package crameshark;

public class BankAccount
{

@Override
public String toString() {
.....
}
public void PrintReciept()
{
.. }
public static void main(String []arg)
{
}
}
Attachments
BankAccount.java (1 K) Download Preview
System.out.println(accountHolder+ " Deposits $" + amount); balance=balance + amount; } public void MakeWithdraw(double amount) { System.out.println(accountHolder+ " Withdraws $" + amount); balance=balance - amount; } @Override public String toString() { return "BankAccount [accountNumber=" + accountNumber + ",

Screenshots
Purchase Answer

BankAccount Solution

mariobeka
mariobeka 



Below you will find java files, which include the code and also comments. A screenshot of the working program is also included. Attachments
BankAccount.java (2 K) Download Preview
amount) { double newBalance = balance - amount; balance = newBalance; System.out.println("--------------------------------------"); System.out.println(accountHolder + " withdraws " + amount); PrintReceipt(); System.out.println("--------------------------------------"); } /** * Prints the information of the bank account * @return the information */ @Override public String toString() { return "Account Number: " + accountNumber + "\nCustomer: "

Main.java (1 K) Download Preview
secondAccount = new BankAccount(87642, "Dwayne Wayne", "Saving", 746.23); firstAccount.MakeDeposit(50.00); secondAccount.MakeWithdrawl(250.00); firstAccount.MakeDeposit(123.56); secondAccount.MakeDeposit(262.00); firstAccount.MakeWithdrawl(475.50); System.out.println("\n===========Account information===========\n");

Screen Shot 2014-10-02 at 10.03.52 PM.png (98 K) Download Preview

Screenshots
Screenshot
Purchase Answer