The Librarian of Universal Library wants to maintains log for all the books in the library.
Help the librarian to maintain the log in such a way that a book's name should be followed by its Author's name. Refer the output statements for the format.
Note:
- The Book name and Author name can contain space in between them.
- If the length of book name is less than or equal to 3 display "Invalid Book Name" and terminate the program.
- If the length of author name is less than to 6 display "Invalid Author Name".
Please do not use System.exit(0) to terminate the program.
Sample Input 1:
Enter the book name:
Programming in C
Enter the author name:
Richies
Sample Output 1:
Programming in C book was written by Richies
Sample Input 2:
Enter the book name:
Programming in C
Enter the author name:
Rich
Sample Output 2:
Invalid Author Name
Sample Input 3:
Enter the book name:
C++
Sample Output 3:
Invalid Book Name
Result Description
Comments
Post a Comment