+1 (315) 557-6473 

Do You Need Help With Link List Homework?

Get professional help with link list homework right here. We brag of screened and tested programmers who are equal to every homework in this field. Our link list homework help is unique and comes with several benefits including custom-written solutions, assistance by experienced computer scientists, pocket-friendly rates and many more.

A link list system that manages a list of customer

Use a linked list to create a system for managing a list of customers waiting to buy the latest game console.Each customer has a unique name.The system should fulfill the following operations:
• Adding a customer in the start of the list
• Adding a customer in the end of the list
• Removing a customer from the start of the list
• Removing a customer from the end of the list
• Removing a customer by name
• Printing the current list
• Create attest program that allows the user to perform all operations with their own data.

Java Code

importjava.util.LinkedList;
importjava.util.Scanner;
public class CustomersListManagement {
    // Entry point of the program
public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
LinkedListcustomersList = new LinkedList<>();
while (true) {
System.out.println("Menu");
System.out.println("a. Add a customer in the start of the list");
System.out.println("b. Add a customer in the end of the list");
System.out.println("c. Remove a customer from the start of the list");
System.out.println("d. Remove a customer from the end of the list");
System.out.println("e. Remove a customer by name");
System.out.println("f. Print the current list");
System.out.println("x. Exit");
System.out.print("Option: ");
            String option = in.nextLine();
System.out.println();
if (option.equalsIgnoreCase("x")) {
break;
            }
if (option.equalsIgnoreCase("a")) {
                // Add a customer to front
System.out.print("Enter customer name: ");
                String name = in.nextLine().trim().toUpperCase();
if (name.isEmpty()) {
System.out.println("Error: A name is required.");
                } else if (customersList.contains(name)) {
System.out.println("Error: Name is already used.");
                } else {
customersList.addFirst(name);
System.out.println("Ok: '" + name + "' added.");
                }
            } else if (option.equalsIgnoreCase("b")) {
                // Add a customer to end
System.out.print("Enter customer name: ");
                String name = in.nextLine().trim().toUpperCase();
if (name.isEmpty()) {
System.out.println("Error: A name is required.");
                } else if (customersList.contains(name)) {
System.out.println("Error: Name is already used.");
                } else {
customersList.addLast(name);
System.out.println("Ok: '" + name + "' added.");
                }
            } else if(option.equalsIgnoreCase("c")) {
                // Remove front
if(customersList.isEmpty()) {
System.out.println("Error: The list is empty.");
                } else {
                    String name = customersList.removeFirst();
System.out.println("Ok: '" + name + "' removed.");
                }
            } else if(option.equalsIgnoreCase("d")) {
                // Remove back
if(customersList.isEmpty()) {
System.out.println("Error: The list is empty.");
                } else {
                    String name = customersList.removeLast();
System.out.println("Ok: '" + name + "' removed.");
                }
            } else if(option.equalsIgnoreCase("e")) {
                // Remove by name
System.out.print("Enter customer name: ");
                String name = in.nextLine().trim().toUpperCase();
if (name.isEmpty()) {
System.out.println("Error: A name is required.");
                } else if (!customersList.contains(name)) {
System.out.println("Error: Name is not in the list.");
                } else {
customersList.remove(name);
System.out.println("Ok: '" + name + "' removed.");
                }
            } else if(option.equalsIgnoreCase("f")) {
                // Print everything on list
for(String name : customersList) {
System.out.println(name);
                }
            } else if(option.equalsIgnoreCase("x")) {
break;
            }
System.out.println();
        }
    }
}

Related Blogs

Tips To Get The Best Out Of Your C++ Programming Homework HelpIf you are seeking C++ homework help online, that means you are not only expecting quality work but also, timely submissions. It’s evident that most homework helping organizations fail to meet the student’s expectations, once in a while. ...

2020-08-12
Read More

C Programming Homework Help – The Best of the Best in the UKThe C programming language is one of the most common languages and the most preferred by the majority of institutions when it comes to introducing learners to programming. Most of the high-level programming languages we have today are a lot...

2020-08-12
Read More

How Can Our Assembly Language Homework Help You Convert CAssembly language is often used in conjunction with C code as it is closer to the metal than Java or other byte code languages. Parameters are passed using the stack (and possibly registers depending on the platform and calling convention). Th...

2020-08-12
Read More

How to Better Your C++ Coding Skills This SummerBrace yourself, summer is here! With it comes more time which is often limited during the rest of the year. During summer, as a programming student you have two options: 1) You can choose to chill with your mates and family, 2) Or, you could invest par...

2020-08-12
Read More