Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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 G 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)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started