Question

what is the solution for this Java project?

Create the an application that can use different types of Linked List to manage either Checking Account or Saving Account. The application should allow users can select the type of Linked List to work on. After finishing one, users can select to work with other type of Linked List until they want to exit Singly Linked List Singly Linked List with Iterator Java Linked List with Iterator 1. 2. 3. You can re-use the class Account yourLastName, CheckingAccount_yourLastName and SavingAccount yourLastName FOR SINGLY LINKED LIST DO THE FOLLOWING TASKS Create a Singly Linked List then allow users to do the following tasks: 1. Insert account 2. Read account 3. Verify Encapsulation 4. Close account 5. Delete account 6. Show all accounts 0. Exit After finishing one task, the program should re-display the menu to allow users to continue to do other tasks until they want to exit

media%2F1c9%2F1c999d8a-457c-43f3-aaa1-4a

media%2Ff96%2Ff9698600-3edf-421f-9bba-e7

media%2F168%2F168bb092-c9a9-40dd-88aa-dd


0 0
Add a comment Improve this question Transcribed image text
Answer #1

Solution :

According to given data, the java code is given as below,

Here's the jave coda

where package banking;

public class BankAccount {

private static final int AnnualInterestRate = 0;

public static void main(String[] args) {

}

private double balance = 70.0;

private double deposits = 0;

private double withdrawals = 0;

private double interestRate ;

private double serviceCharge = 1;

private double MonthlyServiceCharge=0;

public BankAccount(double balance, double interestRate) {

this.setBalance(balance);

this.setInterestRate(interestRate);

this.setDeposits(1);

}

public double deposit(double depositAmount){

balance += depositAmount;

return balance;

}

public double setBalance(double balance){

return balance;

}

public double getBalance(){

return balance;

}

public double getWithdrawals(){

return withdrawals;

}

public double withdraw(double withdrawAmount){

if ( withdrawAmount > balance )

return -1;

else balance -= withdrawAmount;

System.out.println("BankAccount Withdraw");

return withdrawAmount;

}

private double calcInterest(){

double MonthlyInterestRate = (AnnualInterestRate / 12);

double MonthlyInterest = balance * MonthlyInterestRate;

balance = balance + MonthlyInterest;

return MonthlyInterest;

}

protected void monthlyProcess(){

balance -= serviceCharge;

calcInterest();

withdrawals =setDeposits((int)(serviceCharge =0));

}

public void setMonthlyServiceCharge(double MonthlyServiceCharge){

MonthlyServiceCharge= 0;

}

public double getMonthlyServiceCharge() {

return MonthlyServiceCharge;

}

public int setDeposits(int deposits) {

this.deposits = deposits;

return deposits;

}

public double getDeposits() {

return deposits;

}

public void setInterestRate(double interestRate) {

this.interestRate = interestRate;

}

public double getInterestRate() {

return interestRate;

}

}

package banking;

public class BankAccountTest {

public static void main(String[] args) {

SavingsAccount a = new SavingsAccount(5000,500);

a.deposit(0);

System.out.println(a.getBalance());

a.withdraw(5);

a.withdraw(10);

a.withdraw(10);

a.withdraw(10);

a.withdraw(5);

a.withdraw(2);

a.monthlyProcess();

}

}

package banking;

public class SavingsAccount extends BankAccount{

public double balance, amount,initialBalance;

private boolean active;

private int deposit;

SavingsAccount(double balance, double interestRate) {

super(balance, interestRate);

if(balance < 25.0 ){

setActive(true);

System.out.println("Your account is Active");

}

else{

setActive(false);

System.out.println(" Your account is InActive.");

}}

public double deposit(double depositAmount) {

balance+=depositAmount;

deposit++;

return balance;

}

public double withdraw(double withrawAmount) {

double amount = 65.0;

if (isActive()&& withrawAmount >= this.getBalance()){

amount = super.withdraw (withrawAmount);

if (getBalance()< 25.0)

active = false;

}

System.out.println("The amount is: "+ amount );

return amount;

}

protected void monthlyProcess() {

if(this.getDeposits()> 4 )

this.withdraw(getDeposits()-4);

super.monthlyProcess();

System.out.println(" The Total deposits is :"+ getDeposits());

}

public void setActive(boolean active) {

this.active = active;

}

public boolean isActive() {

return active;

}

public void setDeposit(int deposit) {

this.deposit = deposit;

}

public double getDeposits() {

return deposit;

}

}

Add a comment
Know the answer?
Add Answer to:
what is the solution for this Java project? Create the an application that can use different...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Create a Java program application that creates an ArrayList that holds String objects. It needs to...

    Create a Java program application that creates an ArrayList that holds String objects. It needs to prompt the user to enter the names of friends, which are then put into the ArrayList; allow the user to keep adding names until they enter "q" to quit. After input is complete, display a numbered list of all friends in the list and prompt the user to enter the number of the friend they wish to delete. After deleting that entry, output the...

  • In Java: DATA TYPE CLASS Create one data type class Account_yourLastName that hold the information of...

    In Java: DATA TYPE CLASS Create one data type class Account_yourLastName that hold the information of an account such as accountNumber (String), name (String), address (String), balance (float), interestRate(float) and beside the no-argument constructor, parameterized constructor, the class has method openNewAccount, method checkCurrentBalance, method deposit, method withdrawal, method changeInterestRate REQUIREMENT - DRIVER CLASS Provide the application for the Bank Service that first displays the following menu to allow users to select one task to work on. After finishing one task,...

  • is due in 2 hours so i had to repost, sorry. Create an application that allows...

    is due in 2 hours so i had to repost, sorry. Create an application that allows you to manage a task list that’s stored in a database. using java and netbeans Console: Task List COMMAND MENU view - View pending tasks history -View completed tasks add -Add a task complete -Complete a task delete -Delete a task exit -Exit program Command: view 1. Buy toothbrush 2. Do homework Command: complete Number: 2 Command: add Description: Pay bills Command: view 1....

  • In NetBeans Create a new Java Application to manage Linked Lists: (Note: Do not use java.util.LinkedList)...

    In NetBeans Create a new Java Application to manage Linked Lists: (Note: Do not use java.util.LinkedList) a) Create a DateTime class 1. Add day, month, year, hours, minutes as attributes 2. Add a constructor and a toString() method 3. Implement the Comparable interface, and add a CompareTo() method 4. Add methods to get and set all attributes. b) Add to MyLinkedList class the following methods: 1. Insert a Node to a particular position in the List 2. Insert a Node...

  • can you solve it in java please Create the following: 1. Class Invoice ( the node...

    can you solve it in java please Create the following: 1. Class Invoice ( the node ) that includes three instance variables:     int No; // the Invoice No             String CustName; // the Customer name             int Amount; // the Invoice Amount Invoice next; // points to the next Invoice Default and overloaded constructors 2. Class Shop that includes three instance variables: Invoice head; Invoice Tail; Your class should have the following: • A method that initializes the instance variables....

  • Problem 1) Banking Application Consider the application domain of a banking application where you have customers...

    Problem 1) Banking Application Consider the application domain of a banking application where you have customers who have one or more accounts of type Checking or Saving. Some of the customers may also have one or more loans that they have taken from the bank. Each loan has a borrowed amount and current balance amount. Loan may be either outstanding or paid off. Questions 1. Create a Conceptual model (List Entities and note Relationships, 2- 3 Relationships only) (3 Pts)...

  • Homework #1 – Implementing Set with a Linked List Project Objectives 1. Be able to integrate...

    Homework #1 – Implementing Set with a Linked List Project Objectives 1. Be able to integrate the knowledge of Java Generics, Collection Framework and the Linked List data structure to implement the Set ADT. Components emphasized are: • Allowing parameterized type for handling a general class of values in the collection framework; • Understanding conceptual differences between lists and sets and implementing them with methods; • Implementation of an iterator with functionality that is appropriate for the collection, namely the...

  • MasterMind in Java Activity MasterMind project Create a new Java Application project named MasterMind allowing Netbeans...

    MasterMind in Java Activity MasterMind project Create a new Java Application project named MasterMind allowing Netbeans IDE to create the main class called MasterMind.java MasterMind class Method main() should: Call static method System.out.println() and result in displaying “Welcome to MasterMind!” Call static method JOptionPane.showMessageDialog(arg1, arg2) and result in displaying a message dialog displaying “Let’s Play MasterMind!” Instantiate an instance of class Game() constants Create package Constants class Create class Constants Create constants by declaring them as “public static final”: public...

  • In Java: Create a GUI application that calculates the registration fees for a one-week summer camp....

    In Java: Create a GUI application that calculates the registration fees for a one-week summer camp. The general summer camp registration fee is $895 per person, but multiple children from the same family (after the first) are allowed a $200 discount. There is a lavish closing banquet, with awards for their children, which parents may attend for $25 (each). As many other optional pre- and post-activity sessions may be added (for indicated fee), thanks to scheduling them in exclusive time...

  • *Step1: -Create UML of data type classes: reuse from lab3 for class Account, CheckingAccount and SavingAccount...

    *Step1: -Create UML of data type classes: reuse from lab3 for class Account, CheckingAccount and SavingAccount -Read the requirement of each part; write the pseudo-code in a word document by listing the step by step what you suppose to do in main() and then save it with the name as Lab4_pseudoCode_yourLastName *Step2: -start editor eClipse, create the project→project name: FA2019_LAB4PART1_yourLastName(part1) OR FA2019_LAB4PART2_yourLastName (part2) -add data type classes (You can use these classes from lab3) Account_yourLastName.java CheckingAccount_yourLastName.java SavingAccount_yourLastName.java -Add data structure...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT