CSC248 Lab Assignment 3 – Linked List (Built-In) solution

$25.00

Original Work ?
Category: You will Instantly receive a download link for .ZIP solution file upon Payment

Description

5/5 - (1 vote)

Given the following Friend and LinkedList ADT
public class Friend
{
private int idno;
private String name, hpno, email;
public Friend (int id, String n, String hp, String em) {…}
public int getId() {…}
public String getName() {…}
public String getHP() {…{
public String getEmail() {…}
public void setName(String n) {…}
public void setHP(String hp) {…}
public void setEmail(String mail) {…}
}
public class LinkedList
{
public LinkedList();
public int size();
public void add(int index, Object element);
public Object get(int index);
public Object set(int index, Object element);
public Object remove(int index)
}
Write a Java program to:
1. Write a complete program of Friend class.
2. Write an application program by implementing a MENU SELECTION to do the following
tasks.
a. Create a linked list named sList then insert some records (identify by the user) into sList.
Verify each record to ensure that there is no duplicate record.
b. Ask user to enter id no for viewing the record. If the record exists the view it on the screen
otherwise display an appropriate message
c. Remove the record form the sList. If the slist is empty or has only one record then, display
an appropriate message.
( M N O S 2 0 2 3 ) 2 | P a g e
d. Update record that it’s based on idno given by the user. If the record exists replace its value of
hpno and email also given by the user, otherwise display an appropriate message.
e. To print all record from the sList.