Java coding
ANSWER MUST BE TYPED WITHIN THE QUESTIONS BELOW
Linked Lists
1. (a) Declare a class named User that contains the following information: (6 pts.)
String name
String username
String password
Include in the class a single constructor that is passed a particular name, username, and
password; setters and getters, and a toString method that returns the information in
a given User object as follows:
“Ashley Smith username: asmith password:aWjPP406!”
(b) Declare a class named UserNode that contains a single User object and a link to another
UserNode. Include an appropriate constructor and an appropriate set of methods for this
class. (4 pts).
2. Create a class named UserAccounts that maintains a list of users (implemented as a linked list
of UserNodes), with an appropriate constructor, and the following methods: (15 pts.)
isEmpty() – returns true if list is empty, and false otherwise
findPassword – returns the password for a given user name
changePassword – updates the password for a given user name and password. If they do
not match, the password is not updated.
addUser – passed a User object to add
deleteUser – deletes a user for a given user name and password. If they do not match,
the user is not deleted.
printUsers – prints a list of all users (including name, username and password)
"You need a similar assignment done from scratch? Our qualified writers will help you with a guaranteed AI-free & plagiarism-free A+ quality paper, Confidentiality, Timely delivery & Livechat/phone Support.
Discount Code: CIPD30
Click ORDER NOW..


