Question: Select data structure and algorithm, and then describe the used dataset and then the obtained results For this code. bookstore.java Test.java import java.util.Scanner; public class

Select data structure and algorithm, and then describe the used dataset and then the obtained results For this code.

bookstore.java

Select data structure and algorithm, and then describe the used dataset and

then the obtained results For this code. bookstore.java Test.java import java.util.Scanner; public

class Test { public static void main(String[] args) { Scanner sc =

new Scanner(System.in); int ch = 1; String isbn; String title; String authorName;

int noOfPages; double price; int position; BookStore list = new BookStore(); while

Test.java

import java.util.Scanner; public class Test { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int ch = 1; String isbn; String title; String authorName; int noOfPages; double price; int position; BookStore list = new BookStore(); while (ch != 7) { System.out.println(" ===================================MENU==================================="); System.out.printf("%-20s%-20s%-20s%-20s ", "1. Add First", "2. Add Last", "3. Add at Pos", "4. Remove"); System.out.printf("%-20s%-20s%-14s ", "5. Search", "6. Display", "7. Exit"); System.out.println("=========================================================================="); System.out.print("Enter your choice: "); ch = Integer.parseInt(sc.nextLine()); switch (ch) { case 1: System.out.print(" Enter ISBN number: "); isbn = sc.nextLine(); System.out.print("Enter book title: "); title = sc.nextLine(); System.out.print("Enter author name: "); authorName = sc.nextLine(); System.out.print("Enter number of pages: "); noOfPages = Integer.parseInt(sc.nextLine()); System.out.print("Enter price: "); price = Double.parseDouble(sc.nextLine());

list.addFirst(isbn, title, authorName, noOfPages, price); break; case 2: System.out.print(" Enter ISBN number: "); isbn = sc.nextLine(); System.out.print("Enter book title: "); title = sc.nextLine(); System.out.print("Enter author name: "); authorName = sc.nextLine(); System.out.print("Enter number of pages: "); noOfPages = Integer.parseInt(sc.nextLine()); System.out.print("Enter price: "); price = Double.parseDouble(sc.nextLine());

list.addLast(isbn, title, authorName, noOfPages, price); break; case 3: System.out.print("Enter position to insert: "); position = Integer.parseInt(sc.nextLine()); System.out.print(" Enter ISBN number: "); isbn = sc.nextLine(); System.out.print("Enter book title: "); title = sc.nextLine(); System.out.print("Enter author name: "); authorName = sc.nextLine(); System.out.print("Enter number of pages: "); noOfPages = Integer.parseInt(sc.nextLine()); System.out.print("Enter price: "); price = Double.parseDouble(sc.nextLine());

list.addAtIndex(position, isbn, title, authorName, noOfPages, price); break; case 4: System.out.print(" Enter book title to be removed: "); title = sc.nextLine(); list.remove(title); break; case 5: System.out.print(" Enter book title to search for: "); title = sc.nextLine(); list.search(title); break;

case 6: list.display(); break; case 7: System.out.println(" Thank you!"); break; default: System.out.println("Error: Invalid choice."); } } } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!