Write a class TestLibraryRecords with followingdetails · Defines anarray author
ID: 3610713 • Letter: W
Question
Write a class TestLibraryRecords with followingdetails
· Defines anarray author of type String and size 100.
· Defines anarray title of type String and size 100.
· Read theauthors names from file authors.txt and storesthem in array author.
· Read the booktitles from file titles.txt and stores them inarray title.
· Both filescontains equal number of lines (records) less than or equal to 100,therefore author and title arrays may not befilled completely. You have to count number of lines (records) youread from file.
· Display themenu
· Implementeach option/choice of menu using switchconstruct.
· In eachoption 1 and 2 (displaying and searching), use records stored inarrays. Do not use the files again.
· Ignore thecase in searching (option 2).
Explanation / Answer
please rate - thanks import java.util.*; import java.io.*; public class authors {static Scanner in=new Scanner(System.in); public static void main(String[] args)throwsFileNotFoundException {String[] author=new String[100]; String [] title=new String[100]; int count=0,i,choice; try{Scanner authors=new Scanner(new FileReader("authors.txt")); Scanner titles=new Scanner(newFileReader("titles.txt")); while(authors.hasNextLine()&&countRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.