EssayGhost Assignment代写,Essay代写,网课代修,Quiz代考

EssayGhost-Essay代写,作业代写,网课代修代上,cs代写代考

一站式网课代修,论文代写

高质量的Assignment代写、Paper代写、Report代写服务

EG1hao
网课代修代上,cs代写代考
Java代写
您的位置: 主页 > 编程案例 > Java代写 >
代写Java:Libraries of SmallTownX留学生CS英文题目:Project 4 (summative - Java代写
发布时间:2021-07-25 09:59:26浏览次数:
Project 4 (summativeproject) Due date: Latest by 12/19/2017 6:00PM,Not late project will be acceptedThe libraries of SmallTownX need a new electronic rental system, and it is up to you to build it. SmallTownX has two libraries. Each library offers many books to rent. Customers can print the list of available books, borrow, and return books.Problems:We provide two classes, Book and Library that provide the functionality for the book database. You must implement the missing methods to make these classes work.Step One: Implement Book First we need a class to model books. Start by creating a class called Book. Copy and paste the skeleton below. This class defines methods to get the title of a book, find out if it is available, borrow the book, and return the book. However, theskeleton that we provide is missing the implementations of the methods. Fill in the body of the methods with the appropriate code. The main method tests the methods. When you run the program, the output should be: Title (should be The Da Vinci Code): The Da Vinci CodeRented? (should be false): falseRented? (should be true): trueRented? (should be false): false Hint: Look at the main method to see how the methods are used, then fill in the code for each method.Step Two: Implement Library Next we need to build the class that will represent each library, and manage a collection of books. All libraries have the same hours: 9 AM to 5 PM daily. However, they have different addresses and book collections (i.e., arrays of Book objects). Create a class called Library. Copy and paste the skeleton below. We provide a main method that creates two libraries, and then performs some operations on the books. However, all the methods and member variables are missing. You will need to define and implement the missing methods. Read the main method and look at the compile errors to figure out what methods are missing. Notes : Some methods will need to be static methods, and some need to be instance methods.Be careful when comparing Strings objects. Use string1.equals(string2) for comparing the contents ofstring1 and string2.You should get a small part working at a time. Start by commenting the entire main method, then uncomment it lineby line. Run the program, get the first lines working, then uncomment the next line, get that working, etc.You must not modify the main method.The output when you run this program should be similar to the following:Library hours:Libraries are open daily from 9am to 5pm.Library addresses:10 Main St.228 Liberty St.Borrowing The Lord of the Rings:You successfully borrowed The Lord of the RingsSorry, this book is already borrowed.Sorry, this book is not in our catalog.Books available in the first library:The Da Vinci CodeLe Petit PrinceA Tale of Two CitiesBooks available in the second library:No book in catalogReturning The Lord of the Rings:You successfully returned The Lord of the RingsBooks available in the first library:The Da Vinci CodeLe Petit PrinceA Tale of Two CitiesThe Lord of the RingsBook.javapublic class Book { String title;boolean borrowed;// Creates a new Book public Book(String bookTitle) { // Implement this method } // Marks the book as rented public void borrowed() { // Implement this method } // Marks the book as not rentedpublic void returned() { // Implement this method } // Returns true if the book is rented, false otherwise public boolean isBorrowed() { // Implement this method } // Returns the title of the book public String getTitle() { // Implement this method }public static void main(String[] arguments) { // Small test of the Book class Book example = new Book( The Da Vinci Code System.out.println( Title (should be The Da Vinci Code): + example.getTitle());System.out.println( Borrowed? (should be false): + example.isBorrowed());example.rented();System.out.println( Borrowed? (should be true): + example.isBorrowed());example.returned();System.out.println( Borrowed? (should be false): + example.isBorrowed());} }Library.java public class Library { // Add the missing implementation to this class public static void main(String[] args) { // Create two librariesLibrary firstLibrary = new Library( 10 Main St. Library secondLibrary = new Library( 228 Liberty St. // Add four books to the first library firstLibrary.addBook(new Book( The Da Vinci Code ));firstLibrary.addBook(new Book( Le Petit Prince ));firstLibrary.addBook(new Book( A Tale of Two Cities ));firstLibrary.addBook(new Book( The Lord of the Rings ));// Print opening hours and the addresses System.out.println( Library hours: printOpeningHours();System.out.println();System.out.println( Library addresses: firstLibrary.printAddress();secondLibrary.printAddress();System.out.println();// Try to borrow The Lords of the Rings from both libraries System.out.println( Borrowing The Lord of the Rings: firstLibrary.borrowBook( The Lord of the Rings firstLibrary.borrowBook( The Lord of the Rings secondLibrary.borrowBook( The Lord of the Rings System.out.println();// Print the titles of all available books from both libraries System.out.println( Books available in the first library: firstLibrary.printAvailableBooks();System.out.println();System.out.println( Books available in the second library: secondLibrary.printAvailableBooks();System.out.println();}}Make sure you apply comment(s) and coding indentationto make your code look clearly.Make sure you run and compile your code with bug free.Make sure you email send successfully with the correct file attached.Not time for you to change and fix it the issue due to the final grade schedule.Not late project will be accepted.

所有的编程代写范围:essayghost为美国、加拿大、英国、澳洲的留学生提供C语言代写、代写C语言、C语言代做、代做C语言、数据库代写、代写数据库、数据库代做、代做数据库、Web作业代写、代写Web作业、Web作业代做、代做Web作业、Java代写、代写Java、Java代做、代做Java、Python代写、代写Python、Python代做、代做Python、C/C++代写、代写C/C++、C/C++代做、代做C/C++、数据结构代写、代写数据结构、数据结构代做、代做数据结构等留学生编程作业代写服务。