NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

Write a Java program for the given requirements. Do nothing more than the requirements below.
a. A book has a name, number of the pages, author name and the publisher. We can
change the name of the book and read the name of the book. We can get all of the
information of the book with a single method.
b. A library has a name, the manager’s name, surname and a list of books. We can read
and change the name of the manager. The capacity of the library is 1,000 books. We
can add a new book to the library. If someone tries to remove a book from the
library he gets a message “You cannot delete a book!”. We can get the names of all
the books in the library.
c. A student has a name, surname, and department information. The student can read
a book.
d. A university has a library and a list of students. We can add a new student to the
university (Either an arraylist or an array can be used for this method). The maximum
capacity of the University is 5,000 students. We can print the names of all the
students.
Sample scenario is given below by using Driver class:
(Hints: No static variables/methods are needed. Just implement the methods given as reqirements.
Nothing more.)
publicclass Driver {
publicstaticvoid main(String[] args) {
Book b1 = new Book("WUTHERING",90,"Ufuk","Pearson");
Book b2 = new Book("BLACK BOOK",110,"Aydin","Wiley");
b1.setbName("New book 1");
System.out.println(b1.toString() + b2.toString());
System.out.println(b2.getbName());
System.out.println();
Library lib = new Library();
lib.addBook(b1);
lib.addBook(b1);
lib.addBook(b2);
lib.removeBook();
System.out.println();
lib.printBookList();
Student stu1 = new Student("Ufuk","Aydan","CENG");
Student stu2 = new Student("George","Michael","MECH");
stu1.read_a_book(b2);
System.out.println();
University uni = new University();
uni.addStudent(stu1);
uni.addStudent(stu2);
uni.printStudentList();
}
}
The output is:
Book Name : New book 1
Author : Ufuk
Number of Pages : 90
Publisher : Pearson
Book Name : BLACK BOOK
Author : Aydin
Number of Pages : 110
Publisher : Wiley
BLACK BOOK
You cannot delete a book !
Number of books: 3
New book 1
New book 1
BLACK BOOK
Ufuk is reading book: BLACK BOOK
University is constructed
Number of students is: 2
Ufuk
George
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.