Maurice Tutor

(5)

$15/per page/Negotiable

About Maurice Tutor

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Algebra,Applied Sciences See all
Algebra,Applied Sciences,Biology,Calculus,Chemistry,Economics,English,Essay writing,Geography,Geology,Health & Medical,Physics,Science Hide all
Teaching Since: May 2017
Last Sign in: 398 Weeks Ago, 1 Day Ago
Questions Answered: 66690
Tutorials Posted: 66688

Education

  • MCS,PHD
    Argosy University/ Phoniex University/
    Nov-2005 - Oct-2011

Experience

  • Professor
    Phoniex University
    Oct-2001 - Nov-2016

Category > Computer Science Posted 27 Aug 2017 My Price 15.00

use of inheritance

Write a Java program to demonstrate the use of inheritance, polymorphism, interfaces and transaction processing. This program will also use the Vector class.
Class Definitions:
You are to begin with the following class (Account.java):
public class Account {
protected String accountNo, institution, name;
protected double balance;
public Account (String accountNo, String name, String institution, double balance) {
this.name = name;
this.accountNo = accountNo;
this.balance = balance;
this.institution = institution;
}
public String getAccount() {
return accountNo;
}
public boolean debitAccount(double amt) {
return false;
}
public boolean creditAccount(double amt) {
return false;
}
}
Make sure these are in different files. You will create two additional files that are the classes CreditCard and CheckingAccount. The two classes will be subclasses of the Account class defined above and will implement the interface.
The CheckingAcount class needs no additional instance variables.
The CreditCard class will need two additional instance variables:
private double creditLimit;
private double availableCredit;
The CheckingAccount and CreditCard classes should define at least one constructor each. In addition they should override the method toString() and override the debitAccount() and creditAccount() interface methods.
Main Program:
The main() method is responsible for verifying two command-line arguments. The first is the transaction file, the second is an error log file. All errors encountered with transactions will be logged to that file (see below).
It is recommended that you create two addition methods:
private static Account findAccount(Vector a, String acctNo) {
}
private static void performTrans(Vector a, String transaction, PrintWriter log) {
}
The first method will assist you in finding an account in the vector that is to have the transaction applied to it. The findAccount() method should return null if the account is not found in the Vector.The second method will free the main() method of the responsibility of the parsing of the transaction components.
All of these methods should be defined in d4.java.
Transaction Processing:
You will need to process transactions from a data file. Each transaction will have its components separated by colons so you can use a split() method call. Each transaction will have different component counts.
The possible transactions are: create, debit, credit and report. Here is an example transaction file:
create:checking:10-3784665:Chase:Joe Holder:2000
create:credit:1234567898765432:First Card:Bob Badger:4000
create:checking:11-3478645:Dime:Melissa Martin:1000
report
debit:10-3784665:523.67
debit:1234567898765432:3500
credit:10-3784665:50
credit:11-3478645:30
debit:10-839723:200
debit:1234567898765432:600
report
Details of the transactions:
All accounts should be stored in a single Vector after they are created.
New credit cards have a zero balance and the credit limit is specified in the create transaction.
New checking accounts have the balance specified in the create transaction.
A debit is a subtraction in all cases.
A credit is an addition all cases.
A debit must be denied when there is insufficient funds or greater than available credit.
The credit card availableCredit must be accurately maintained.
All data from a report transaction is to be sent to the screen.
Any errors encountered should be written to the log file.
An example error log is as follows:
Invalid account: debit:10839723:200
Transaction denied: debit:1234567898765432:600
An example report should include all the components shown:
Account Summary:
Checking account #103784665
Bank: Chase
Name on account: Joe Holder
Balance: 1526.33
Credit Account #1234567898765432
Bank: First Card
Issued to: Bob Badger
Credit Limit: 4000
Balance: 3500.00
Available credit: 500.00
Checking account #113478645
Bank: Dime
Name on account: Melissa Martin
Balance: 1030.00
End account summary.
The use of foreach loops is very helpful in this project. The code to perform the transactions will make use of several if/else-if/else blocks. Be sure to understand the use of equals() for processing the transactions as Strings.

Answers

(5)
Status NEW Posted 27 Aug 2017 04:08 PM My Price 15.00

Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll

Not Rated(0)