Create a java application

timer Asked: Oct 20th, 2015

Question description

Create a java application - BookReader to read from one of three files that will need to be chosen by the user. You will also be required to use methods. 

The output of the program should appear as follows: 

Which book file do you wish to read? 

 1. Computer Books 

 2. Fiction Books 

 3. Magic Books 

 4. Exit 

Your choice is: a

I am sorry, your answer was not valid. 

Which book file do you wish to read? 

1. Computer Books 

2. Fiction Books 

3. Magic Books 

4. Exit 

Your choice is: 5

I am sorry, your answer was not valid.

Which book file do you wish to read? 

1. Computer Books 

2. Fiction Books 

3. Magic Books 

4. Exit

Your choice is: 3 

Name                                                                                                                ISBN                     Is Valid                 Price     Mark Wilson's Complete Course in Magic                                             978-0762414550               Yes                  $15.36       Big Magic for Little Hands: 25 Astounding Illusions                               978-0761180098               Yes                  $12.71     Self-Working Card Tricks                                                                       978-0486233345               Yes                  $6.70     Easy-to-Do Magic Tricks for Children                                                    978-0486276137               Yes                  $4.49        101 Easy-to-Do Magic Tricks                                                                978-0486273679               Yes                  $13.06 Modern Coin Magic: 116 Coin Sleights and 236 Coin Tricks                 978-0486242583               Yes                  $9.28       The Royal Road to Card Magic                                                               978-0486408439               Yes                  $10.19 Expert Card Technique: Close-Up Table Magic                                     978-0486217550               Yes                  $11.60 Magic: 1400s-1950s                                                                                978-3836528078               Yes                  $48.26     The Complete Idiot's Guide to Street Magic                                            978-1592576753               Yes                 $12.95 

Total Value: $144.60 

Which book file do you wish to read? 

1. Computer Books 

2. Fiction Books 

3. Magic Books 

4. Exit

Your choice is: 4 

A minimum of the following methods must be used. You can use more methods than this but these 5 are required. Do not modify the given main method. Remember that all methods should exist in the class but out of the main method. 

1- private static void displayMenu() Displays the menu to the user. 

2- private static int getMenuChoiceFromUser() Gets the user’s input returning it only if it is valid. If not, prompts the user to enter the value again. The value must be between 1 and 4. Use a loop to run until a valid answer is given. This should call the displayMenu method. 

3- private static boolean displayBooksFromFile(String fileName) Outputs the properly formatted table to the user based on the file relative to the given file name. It returns true with no errors. Must return false if there were errors. This should call the printTable method. 

4- private static void printTable(Scanner fileData) Print the table from the scanner object that is reading the file. Use a loop to print each row of the table.  

5- private static boolean isbnIsValid(String isbnToCheck) Determines whether the given ISBN is a valid ISBN. Returns true if the ISBN is valid and false if it is not valid (Hint: all of the ISBNs are valid). 

Tutor Answer

(Top Tutor) Studypool Tutor
School: University of Maryland
Studypool has helped 1,244,100 students
flag Report DMCA
Similar Questions
Hot Questions
Related Tags

Brown University

1271 Tutors

California Institute of Technology

2131 Tutors

Carnegie Mellon University

982 Tutors

Columbia University

1256 Tutors

Dartmouth University

2113 Tutors

Emory University

2279 Tutors

Harvard University

599 Tutors

Massachusetts Institute of Technology

2319 Tutors

New York University

1645 Tutors

Notre Dam University

1911 Tutors

Oklahoma University

2122 Tutors

Pennsylvania State University

932 Tutors

Princeton University

1211 Tutors

Stanford University

983 Tutors

University of California

1282 Tutors

Oxford University

123 Tutors

Yale University

2325 Tutors