Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

🎯 Objective

Develop a program that utilizes a class named LibraryBook to manage a library's book collection. The program should prompt the user to input details about a book, then display that book's information.

Instructions:

  1. Class Definition: LibraryBook

    This class represents a book in the library's collection.

    Attributes:

    • Book Title

    • Author's Name

    • Publication Year

    • ISBN Number

    • Check-out Status (whether the book is checked out or available)

    Constructor(s):

    • Define the constructor(s) as per your discretion and understanding.

    Methods:

    • Getters/Setters for each book attribute

    • checkOut() and returnBook() methods to change the Check-out Status of a book

    • printBookInfo() to display the book's information, including its check-out status.

  2. User Prompts:

    Your program should prompt the user for the following book attributes:

    • Book Title

    • Author's Name

    • Publication Year

    • ISBN Number

  3. LibraryBook Class Processing:

    After obtaining user input, the program should use the LibraryBook class to:

    • Create a new book object with the inputted attributes, with the Check-out Status set to 'available'

    • Give the user the option to 'check out' the book, changing the Check-out Status to 'checked out'

  4. Program Outputs:

    Lastly, your program should print out the book's information, including:

    • Book Title

    • Author's Name

    • Publication Year

    • ISBN Number

    • Check-out Status

    Here's an example output:

    Title: The Great Gatsby
    Author: F. Scott Fitzgerald
    Publication Year: 1925
    ISBN: 1234567890
    Check-out Status: Available

    Then, after the book is checked out:

    Title: The Great Gatsby
    Author: F. Scott Fitzgerald
    Publication Year: 1925
    ISBN: 1234567890
    Check-out Status: Checked Out

🚚  Deliverables

Upload the following files in a zip folder that you have created:

  1. Java class files

  2. Screenshot of the Console with the code executing

  • No labels