Create a Java program that simulates a simple library book tracking system. The library has a fixed number of books, and the program should allow the librarian to view, update, and search the books. The program must utilize one-dimensional arrays to manage the information. Most of the requirements have been fulfilled. Starter code is given. Fill in what is missing. Only add to the part where says your code goes here.

Given Code:
import java.util.Scanner;
public class LibraryBookTracker {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String[] bookCatalog = {
"Moby Dick", "The Great Gatsby", "To Kill a Mockingbird",
"Pride and Prejudice", "1984", "Brave New World",
"The Catcher in the Rye", "Lord of the Rings", "Harry Potter and
the Sorcerer's Stone",
"Animal Farm"
};
int capacity = bookCatalog.length;
while (true) {
System.out.println("Welcome to Library Book Tracker!");
System.out.println("1. View Catalog");
System.out.println("2. Search Book");
System.out.println("3. Add Book");
System.out.println("4. Remove Book");
System.out.println("5. Exit");
System.out.print("Select an option: ");
int choice = scanner.nextInt();
scanner.nextLine(); // Consume the newline character
switch (choice) {
case 1:
viewCatalog(bookCatalog);
break;
case 2:
searchBook(scanner, bookCatalog);
break;
case 3:
addBook(scanner, bookCatalog, capacity);
break;
case 4:
removeBook(scanner, bookCatalog);
break;
case 5:
System.out.println("Goodbye!");
scanner.close();
return;
default:
System.out.println("Invalid option. Please select a valid
option.");
}
}
}
public static void viewCatalog(String[] bookCatalog) {
//Your code goes here
}
public static void searchBook(Scanner scanner, String[] bookCatalog) {
//Your code goes here
}
public static void addBook(Scanner scanner, String[] bookCatalog, int capacity)
{
//Your code goes here
}
public static void removeBook(Scanner scanner, String[] bookCatalog) {
System.out.print("Enter the title of the book to remove: ");
String titleToRemove = scanner.nextLine();
int position = findBookPosition(titleToRemove, bookCatalog);
if (position != -1) {
bookCatalog[position] = null;
System.out.println("Book \"" + titleToRemove + "\" removed from the
catalog.");
} else {
System.out.println("Book not found.");
}
}
public static int findBookPosition(String title, String[] bookCatalog) {
for (int i = 0; i < bookCatalog.length; i++) {
if (bookCatalog[i] != null && bookCatalog[i].equalsIgnoreCase(title)) {
return i;
}
}
return -1;
}
}

import java.util.Scanner;

public class LibraryBookTracker {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String[] bookCatalog = {
"Moby Dick", "The Great Gatsby", "To Kill a Mockingbird",
"Pride and Prejudice", "1984", "Brave New World",
"The Catcher in the Rye", "Lord of the Rings", "Harry Potter and the Sorcerer's Stone",
"Animal Farm"
};
int capacity = bookCatalog.length;

while (true) {
System.out.println("Welcome to Library Book Tracker!");
System.out.println("1. View Catalog");
System.out.println("2. Search Book");
System.out.println("3. Add Book");
System.out.println("4. Remove Book");
System.out.println("5. Exit");
System.out.print("Select an option: ");
int choice = scanner.nextInt();
scanner.nextLine(); // Consume the newline character

switch (choice) {
case 1:
viewCatalog(bookCatalog);
break;
case 2:
searchBook(scanner, bookCatalog);
break;
case 3:
addBook(scanner, bookCatalog, capacity);
break;
case 4:
removeBook(scanner, bookCatalog);
break;
case 5:
System.out.println("Goodbye!");
scanner.close();
return;
default:
System.out.println("Invalid option. Please select a valid option.");
}
}
}

public static void viewCatalog(String[] bookCatalog) {
System.out.println("Catalog:");
for (String bookTitle : bookCatalog) {
if (bookTitle != null) {
System.out.println(bookTitle);
}
}
}

public static void searchBook(Scanner scanner, String[] bookCatalog) {
System.out.print("Enter the title of the book to search: ");
String bookToSearch = scanner.nextLine();
int position = findBookPosition(bookToSearch, bookCatalog);
if (position != -1) {
System.out.println("Book \"" + bookToSearch + "\" found at position " + position + " in the catalog.");
} else {
System.out.println("Book not found.");
}
}

public static void addBook(Scanner scanner, String[] bookCatalog, int capacity) {
if (bookCatalog.length == capacity) {
System.out.println("No more space in the catalog.");
return;
}

System.out.print("Enter the title of the book to add: ");
String bookToAdd = scanner.nextLine();
int position = findBookPosition(bookToAdd, bookCatalog);

if (position != -1) {
System.out.println("Book already exists in the catalog.");
} else {
for (int i = 0; i < bookCatalog.length; i++) {
if (bookCatalog[i] == null) {
bookCatalog[i] = bookToAdd;
System.out.println("Book \"" + bookToAdd + "\" added to the catalog at position " + i + ".");
break;
}
}
}
}

public static void removeBook(Scanner scanner, String[] bookCatalog) {
System.out.print("Enter the title of the book to remove: ");
String titleToRemove = scanner.nextLine();
int position = findBookPosition(titleToRemove, bookCatalog);
if (position != -1) {
bookCatalog[position] = null;
System.out.println("Book \"" + titleToRemove + "\" removed from the catalog.");
} else {
System.out.println("Book not found.");
}
}

public static int findBookPosition(String title, String[] bookCatalog) {
for (int i = 0; i < bookCatalog.length; i++) {
if (bookCatalog[i] != null && bookCatalog[i].equalsIgnoreCase(title)) {
return i;
}
}
return -1;
}
}