Assignment4.java - case'A\/Add Book book1 = new Book System.out.print\"Please enter the book information\\n System.out.print\"Enter a book title\\n bookTitle

Assignment4.java - case'A/Add Book book1 = new Book...

This preview shows page 1 - 2 out of 2 pages.

// Assignment #: 4 /// Name: Arun Das (Teaching Assistant) // StudentID: XXXXXXXXXX // Lecture: T TH 12:00-1:15 PM // Description: Implementation of an abstraction of a physical Book and its various physical attributes // such as Title, Publisher and Reviews. This driver method allows access to the Book class // and allows creation of new Book objects and add ratings, and report on them. // import java.io.*; import java.util.*; public class Assignment4 { public static void main (String[] args) { // local variables, can be accessed anywhere from the main method char input1 = 'Z'; String inputInfo; String bookTitle; String bookPublisher; double rating; String line = new String(); // instantiate a Book object Book book1 = new Book(); printMenu(); //Create a Scanner object to read user input Scanner scan = new Scanner(System.in); do // will ask for user input { System.out.println("What action would you like to perform?"); line = scan.nextLine(); if (line.length() == 1) { input1 = line.charAt(0); input1 = Character.toUpperCase(input1); // matches one of the case statement switch (input1)
Image of page 1
Image of page 2

You've reached the end of your free preview.

Want to read both pages?

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture