Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please show ALL work to explain and show each step to how to get the answer Test program: In this assignment, you will define a

Please show ALL work to explain and show each step to how to get the answer

image text in transcribed

Test program:

image text in transcribed

In this assignment, you will define a new linked list. The node of the new linked list should contain three regular data fields (account_number, which is an int; name, which is a String, balance, which is a double) and a reference (next, used to link to another node). account_number name balance next node Define a class node so that it reflects the above structure. Define the constructor of class node so that it accepts three parameters (account number, name, and balance). Define a class "AccountList". Define the constructor of class AccountList so that it will create an empty liked list. The signature of the constructor is AccountList(); Define a method "addFront" in class AccountList so that it has the following signature. This method should create an instance of node using the given parameters and insert it to the head of the linked list. void addFront (int v, String n, double b); Define a method listAll() in class AccountList so that it can display all the information (account number, name, and balance ) of every account (node) in the linked list. Define a method "updateBalance" in class AccountList. It will search account (node) in the linked list by account number (act). If it can find the account, it will update the balance of the account with new balance (newb) and return true, else, return false. The signature of this method is boolean updateBalance (int act, double newb) The test program has been written for you. Submission: node.java and AccountList.java public class testList { public static void main(String[] args) { Accountlist AL = new AccountList(); AL.addFront(1001, "John Kelly", 999.88); AL.addFront(3003, "Jane Smith", 100); AL.addFront(2002, "James Smith", 200); AL.addFront (4004, "John Smith", 1300); System.out.println("Before operation:"); AL.listAll(); AL. updateBalance (1001, 2000); System.out.println(" After operation:"); AL.listall(); } } if your classes are implemented correctly, you should see: Before operation: 4004 John Smith 1300.0 2002 James Smith 200.0 3003 Jane Smith 100.0 1001 John Kelly 999.88 After operation: 4004 John Smith 1300.0 2002 James Smith 200.0 3003 Jane Smith 100.0 1001 John Kelly 2000.0 */

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Inference Control In Statistical Databases From Theory To Practice Lncs 2316

Authors: Josep Domingo-Ferrer

2002nd Edition

3540436146, 978-3540436140

More Books

Students also viewed these Databases questions

Question

6. Discuss the steps involved in conducting a task analysis.

Answered: 1 week ago

Question

8. Explain competency models and the process used to develop them.

Answered: 1 week ago