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

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

  • 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,...

  • *Use Java to create this program* For this assignment, you will be building a Favorite Songs...

    *Use Java to create this program* For this assignment, you will be building a Favorite Songs application. The application should have a list with the items displayed, a textbox for adding new items to the list, and four buttons: Add, Remove, Load, and Save. The Add button takes the contents of the text field (textbox) and adds the item in it to the list. Your code must trim the whitespace in front of or at the end of the input...

  • 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)...

  • *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...

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

  • Computer science 2 project(java, linked list)

    Description:PMU facilitates a variety of food in the cafeteria for its faculty and students. Different food is available for the students and faculty members. The cafeteria has an electronic system (catalog) to check or choose the food.Catalog has a list of different food.The faculty members and students can order two varieties at a time depending on the availability.Each food has a unique code or name.You should provide functions to support the following operations:The cafeteria administrator can add new variety of...

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
ADVERTISEMENT