Coder Social home page Coder Social logo

edemir2 / enhancedbankingsystemjava Goto Github PK

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

A Java project for updating 'BankAccount' and 'EnhancedBankAccount' classes, adding transaction tracking, method enhancements, and functionality for retrieving transaction details, focusing on both basic and advanced banking operations.

Java 99.65% Shell 0.35%

enhancedbankingsystemjava's Introduction


Programming Assignment 3 - Due 10/8 (2022)

  • For programming assignment 3 we will be updating the BankAccount and EnhancedBankAccount classes, to fill in the missing functionality. We have already reviewed the two classes. BankAccount is a very basic class to implement the functionality of a bank account. EnhancedBankAccount is a subclass of BankAccount, adding functionality of tracking all of the transactions.

  • When you submit your program, you should rename BankAcount and EnhancedBankAcount to your_last_name_in_lower_case_BankAccount and your_last_name_in_lower_case_EnhancedBankAccount (along with the corresponding changes to the class names, constructor names, and any statements instantiating a BankAccount or EnhancedBankAccount object).

Continuing on From Lab 04

  • As part of lab 4 we updated makeBankAccountsAndTransactions.java to process transactions from a text file. This can be used as the starting point for testing your updates. And, you should be able to test the balance processing functionality for both BankAccount and EnhancedBankAccount with makeBankAccountsAndTransactions.java.

Testing Transaction functionality

  • During the week of 9/26/2022 we will discuss ideas on how to test the transaction tracking that the EnhancedBankAccount adds.

Verify the following was completed during lab04

To ensure you get full credit for programming assignment 3, verify that all of the following is true for the methods implemented in lab04.

  1. In BankAccount

    • In the withdraw and transfer methods, if there are insufficient funds to perform the operation, the method returns false and does not perform the operation. Otherwise it performs the operation and returns true.
    • By "performs the operation", I mean adjust the savings and checking account balances based on the operation.
    • In the deposit methods, the saving or checking account balance is properly adjusted based on the specified amount.
    • The get methods return the appropriate values held in the fields of the class.
    • The toString() method returns a String of the following information (a,b,c should be on separate lines in the string returned by toString()):
      1. ownerLastName, ownerFirstName, accountNumber
      2. checkingBalance
      3. savingsBalance
  2. In EnhancedBankAccount

    • The Transaction record can be used to create a transaction
    • The types of transactions supported should be {new EnhancedBankAccount, withdrawFromSavings, withdrawFromChecking, transferToChecking, transferToSavings, depositToSavings, depositToChecking}
    • For the constructor of EnhancedBankAccount, there should be:
      • a “new EnhancedBankAccount” transaction added to the successful transactions.
      • If the initial value for savings is greater than 0, then a “depositToSavings” transaction should be added to the successful transactions.
      • If the initial value for the checking is greater than 0, then a “depositToChecking” transaction should be added to the successful transactions.
      • (I believe this was provided for you in the start code given for lab04.)

Implement some New Functionality

  • The additional functionality that you need to implement is below. Most of the methods are very simple.

Update deposit, withdraw, and transfer methods in both classes

  • If you didn't already do so, update the deposit, withdraw, and transfter methods to ignore the request if the specified amount is some negative value.
  • In such a case, if the function returns a boolean, it should return false if the amount specified is negative.

Update deposit, withdraw, and transfer methods in EnhancedBankAcount class

  • Update the deposit, withdraw, and transfer methods to apply the appropriate operation, updating the ArrayLists of Transactions as appropriate
  1. If successful, add a transaction of the appropriate type to the successfulTransactions ArrayList

  2. If unsuccessful, add a transaction of the appropriate type to the failedTransactions ArrayList

Implement the following get transaction methods in the EnhancedBankAccount

  • Add the following methods to the EnhancedBankAccount class:
    /**
	 * Returns all the successful transactions involving some deposit to savings.
	 * 
	 * @return all the successful depositToSavings transactions
	 */ 
	public java.util.ArrayList<Transaction> getSavingsDepositTransactions()
	{
		java.util.ArrayList<Transaction> results = new java.util.ArrayList<>();
		for( Transaction t : successfulTransactions )
		{
			if( t.type().equals("depositToSavings") )
			{
				results.add(t);
			}
		}
		return results;
	}
	
	/**
	 * Returns all the successful transactions involving some deposit to checking.
	 * 
	 * @return all the successful depositToChecking transactions
	 */ 
	public java.util.ArrayList<Transaction> getCheckingDepositTransactions()
	{
		//TODO - implement
		return null;
	}
	
	/**
	 * Returns all the successful transactions involving some withdrawal from savings.
	 * 
	 * @return all the successful withdrawFromSavings transactions
	 */ 
	public java.util.ArrayList<Transaction> getSavingsWithdrawalTransactions()
	{
		//TODO - implement
		return null;
	}
	
	/**
	 * Returns all the successful transactions involving some withdrawal from checking.
	 * 
	 * @return all the successful withdrawFromChecking transactions
	 */
	public java.util.ArrayList<Transaction> getCheckingWithdrawalTransactions()
	{
		//TODO - implement
		return null;
	}
	
	/**
	 * Returns all the successful transactions involving some transfer from savings to checking.
	 * 
	 * @return all the successful transferFromSavingsToChecking transactions
	 */
	public java.util.ArrayList<Transaction> getSavingsToCheckingTransferTransactions()
	{
		//TODO - implement
		return null;
	}
	
	/**
	 * Returns all the successful transactions involving some transfer from checking to savings.
	 * 
	 * @return all the successful transferFromCheckingToSavings transactions
	 */
	public java.util.ArrayList<Transaction> getCheckingToSavingsTransferTransactions()
	{
		//TODO - implement
		return null;
	}
	
	/**
	 * Returns all the transactions that were failed, and occured between the specified start and end dates.
	 * 
	 * @return all the failed transactions within the specified start and end dates.
	 */ 
	public java.util.ArrayList<Transaction> getFailedTransactions(java.util.Date startDate, java.util.Date endDate)
	{
		//TODO - implement
		return null;
	}
	
	/**
	 * Returns all the transactions that were successful, and occured between the specified start and end dates.
	 * 
	 * @return all the successful transactions within the specified start and end dates.
	 */ 
	public java.util.ArrayList<Transaction> getSuccessfulTransactions(java.util.Date startDate, java.util.Date endDate)
	{
		//TODO - implement
		return null;
	}
  • Implement the get methods to return an ArrayList<Transaction> of Transactions of the appropriate type. I've implemented getSavingsDepositTransactions() as an example.

  • For the get transactions methods, if they do not have the word successful or failed in the name, then you only need to return the successful transactions of that type

  • Implement the getFailedTransactions and getSuccessfulTransactions. Both methods take a starting date and ending date. Return the transactions of the appropriate type that are within the parameterized date range. The Java documentation explains how to compare dates.

Submission

When finished, be sure to push your code up to github, and then submit the latest commit hash on BrightSpace.

git add -A
git commit -m "finished programming assignment 3"
git push
git rev-parse HEAD

enhancedbankingsystemjava's People

Contributors

edemir2 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.