Project On Library System
Project On Library System
package BOOk;
public Book(String name, String author, double price, int store, String
publishDate) {
this.name = name;
this.author = author;
this.price = price;
this.store = store;
this.publishDate = publishDate;
}
public Book() {
super();
return name;
this.name = name;
return author;
this.author = author;
return price;
}
public void setPrice(double price) {
this.price = price;
return store;
this.store = store;
return publishDate;
this.publishDate = publishDate;
}
package BOOk;
import java.util.Scanner;
System.out.println("Login Success");
else
System.out.println("Login failed");
book[0] = b1;
book[1] = b2;
book[2] = b3;
book[3] = b4;
book[4] =b5;
do {
System.out.println("\t1.View Books");
System.out.println("\t3.Book Outbound");
System.out.println("\t4.Add a book");
System.out.println("\t5.exit");
System.out.println("Please do your operation");
switch (num) {
Book b = book[i];
System.out.println(b.getName() + "\t" +
b.getAuthor() + "\t" + b.getPrice() + "\t" + b.getStore()
+ "\t" +
b.getPublishDate());
break;
case 2:
// Book storage;
System.out.println("Please enter to
increase inventory");
if (name.equals(book[i].getName())) {
book[i].setStore(book[i].getStore() + store);
break;
break;
if (name1.equals(book[i].getName())) {
book[i].setStore(book[i].getStore() - store1);
break;
break;
case 4:
String name2=input.next();
String author2=input.next();
double price2=input.nextDouble();
int store2=input.nextInt();
System.out.println("Please enter the publication
date");
String publicDate=input.next();
b5.setName(name2);b5.setAuthor(author2);b5.setPrice(price2);b5.setStore(store2);
b5.setPublishDate(publicDate);
break;
case 5:
return;
} while (true);