Question: ############################################## My code: ############################################## Accounts.java public class Accounts { public String accountNumber, owner; public Double balance; public String getAccountNumber() { return accountNumber; } public void

 ############################################## My code: ############################################## Accounts.java public class Accounts { public String

accountNumber, owner; public Double balance; public String getAccountNumber() { return accountNumber; }

public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; } public String getOwner()

##############################################

My code:

##############################################

Accounts.java

public class Accounts {

public String accountNumber, owner;

public Double balance;

public String getAccountNumber() {

return accountNumber;

}

public void setAccountNumber(String accountNumber) {

this.accountNumber = accountNumber;

}

public String getOwner() {

return owner;

}

public void setOwner(String owner) {

this.owner = owner;

}

public Double getBalance() {

return balance;

}

public void setBalance(Double balance) {

this.balance = balance;

}

/**

* A Simple abstract method

*/

public String getAccountsData() {

return "";

}

}

##############################################

Savings.java

public class SavingsAccount extends Accounts {

public double minimumBalance, maintenanceFee;

public double getMinimumBalance() {

return minimumBalance;

}

public void setMinimumBalance(double minimumBalance) {

this.minimumBalance = minimumBalance;

}

public double getMaintenanceFee() {

return maintenanceFee;

}

public void setMaintenanceFee(double maintenanceFee) {

this.maintenanceFee = maintenanceFee;

}

}

##############################################

CheckingsAccount.java

public class CheckingAccount extends Accounts {

public String lastCheckIssued, lastCheckUsed;

public int maximumNumberOfChecks;

public String getLastCheckIssued() {

return lastCheckIssued;

}

public void setLastCheckIssued(String lastCheckIssued) {

this.lastCheckIssued = lastCheckIssued;

}

public String getLastCheckUsed() {

return lastCheckUsed;

}

public void setLastCheckUsed(String lastCheckUsed) {

this.lastCheckUsed = lastCheckUsed;

}

public int getMaximumNumberOfChecks() {

return maximumNumberOfChecks;

}

public void setMaximumNumberOfChecks(int maximumNumberOfChecks) {

this.maximumNumberOfChecks = maximumNumberOfChecks;

}

@Override

public String getAccountNumber() {

return accountNumber;

}

@Override

public void setAccountNumber(String accountNumber) {

this.accountNumber = accountNumber;

}

@Override

public String getOwner() {

return owner;

}

@Override

public void setOwner(String owner) {

this.owner = owner;

}

@Override

public Double getBalance() {

return balance;

}

@Override

public void setBalance(Double balance) {

this.balance = balance;

}

}

##############################################

BatchProcessor.java

import java.io.BufferedReader;

import java.io.FileReader;

import java.io.IOException;

import java.util.ArrayList;

public class BatchProcessor {

private static final String FILENAME = "batch.txt"; // File to be read once the program's execution starts

private static ArrayList employeeList = new ArrayList(); // Array of Accounts used to store the program's data

private static final String outputFilename = "accounts.txt"; // File to be updated once the program's execution is done

/**

* Processes a string line originated from a compressed file so that it can

* be later outputted to the console.

*/

public static String getAccountsData() {

for (Accounts emp : employeeList) {

System.out.println(emp.getAccountsData());

}

return "";

}

public static void main(String[] args) {

BufferedReader br = null;

FileReader fr = null;

try {

fr = new FileReader(FILENAME);

br = new BufferedReader(fr);

String sCurrentLine;

while ((sCurrentLine = br.readLine()) != null) {

String[] accountsInfo = sCurrentLine.split("\\s");

if (sCurrentLine.startsWith("W")) {

}

else if (sCurrentLine.startsWith("D")) {

}

else if (sCurrentLine.startsWith("T")) {

}

else if (sCurrentLine.startsWith("C")) {

}

else {

System.err.println("Not a valid operand.");

}

}

// Method call to output data to the console

//getPaySlipData();

// Method call to update the data on 'accounts.txt'

//writePaySlipToFile();

} catch (IOException e) {

e.printStackTrace();

} finally {

try {

if (br != null) {

br.close();

}

if (fr != null) {

fr.close();

}

} catch (IOException ex) {

System.out.println("file not found");

ex.printStackTrace();

}

}

}

}

CMS 270 Object Oriented Design and Development Fall 2018 Assignment 3 Inheritance & Polymorphism Assigned Wednesday October 17, 2018 and Due Monday October 29 at 11:30 pm submit via Blackboard. Please DO NOT email them to me. you may submit as many times as you wish, before the deadline. Only your last submission will be graded, do ensure that this is your best version Objectives: The purpose of this assignment, is for students to demonstrate knowledge of Inheritance and polymorphism How inheritance works in Java how to build classes and sub-classes in Java How to read data from text files How to write data to text files How to use classes to create and manipulate objects Problem: You are required to simulate a batch processing system for a small, local Credit Union. The Credit Union manages 2 types of accounts: Savings, Checking accounts. All accounts have a number, an owner and a balance. Savings accounts have a minimum balance and a maintenance fee If the balance in the savings account ever goes below the minimum, the maintenance fee is charged once for the month until the situation is corrected Checking accounts have a last check issued, and last check used and a maximum number of checks allowed for the month. Transactions are executed on an account. A transaction has a type (which may be withdraw, transfer, deposit or close) Identify the classes that you need and their relationships. Code each of your classes including all of your getters and setters and any other helper methods that you think will be useful to solve the problem You may assume that you have 2 files available - account current status of all accounts; and batch.txt that contains a set of transactions to be performed on accoun contains information a he transactions in batch.txt are expected to reflect one month's worth of transactions Create a new class called BatchProcessor. BatchProcessor will be your driver class. It will read transaction data from a file- batch.txt and execute the transactions one at a time, updating the relevant account or accounts. en a e batched transactions have been proce , your program should update the accoun file by writing all of the accounts data back to the file accounts.txt CMS 270 Object Oriented Design and Development Fall 2018 Assignment 3 Inheritance & Polymorphism Assigned Wednesday October 17, 2018 and Due Monday October 29 at 11:30 pm submit via Blackboard. Please DO NOT email them to me. you may submit as many times as you wish, before the deadline. Only your last submission will be graded, do ensure that this is your best version Objectives: The purpose of this assignment, is for students to demonstrate knowledge of Inheritance and polymorphism How inheritance works in Java how to build classes and sub-classes in Java How to read data from text files How to write data to text files How to use classes to create and manipulate objects Problem: You are required to simulate a batch processing system for a small, local Credit Union. The Credit Union manages 2 types of accounts: Savings, Checking accounts. All accounts have a number, an owner and a balance. Savings accounts have a minimum balance and a maintenance fee If the balance in the savings account ever goes below the minimum, the maintenance fee is charged once for the month until the situation is corrected Checking accounts have a last check issued, and last check used and a maximum number of checks allowed for the month. Transactions are executed on an account. A transaction has a type (which may be withdraw, transfer, deposit or close) Identify the classes that you need and their relationships. Code each of your classes including all of your getters and setters and any other helper methods that you think will be useful to solve the problem You may assume that you have 2 files available - account current status of all accounts; and batch.txt that contains a set of transactions to be performed on accoun contains information a he transactions in batch.txt are expected to reflect one month's worth of transactions Create a new class called BatchProcessor. BatchProcessor will be your driver class. It will read transaction data from a file- batch.txt and execute the transactions one at a time, updating the relevant account or accounts. en a e batched transactions have been proce , your program should update the accoun file by writing all of the accounts data back to the file accounts.txt

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!