을 int로.) 나는 (60)의 배열이 보유하고 사용이 책을 저장하기위한 ISBN
6) 종료는 어떻게이 같은 메뉴가 도서관 시스템을 만들고 싶어 (60)의 위치 문자열의 배열에 저장하고
에서 책을 삭제) 모든 책
5.보기)를 ISBN
4에서 책을 검색 . 이 책은해야합니다 :
1) ISBN (문자열)
2) 이름 (문자열)
3) 저자 (문자열)
4) 도서 번호 (INT)
지금까지 내가했던이 ..
//This goes above your class declaration, this is importing the Scanner class.
import java.lang.reflect.Array;
import java.lang.Object.*;
import java.util.Scanner;
import java.util.Arrays;
public class BookLibrary {
public static void main (String[] args)
{
// allocates memory for 60 slots
String[] book_array;
//Program keeps running till this condition updates. Only updates
//if the user "chooses" quit option.
boolean keepRunning = true;
//User choice from the menu is stored here.
int userChoice = 0;
Scanner keyboard = new Scanner(System.in);
while (true)
{
//your code here
System.out.println("");
System.out.println("");
System.out.println("Choose:");
System.out.println("1:Add a new Book");
System.out.println("2:Edit Book Infos");
System.out.println("3:Search a Book (From ISBN)");
System.out.println("4:Show all the Books");
System.out.println("5:Delete a Book (From ISBN)");
System.out.println("6:Exit");
int choose = keyboard.nextInt();
if (choose == 1)
{
System.out.println("You Choose to Add a New Book1 ");
String zero = keyboard.nextLine();
System.out.println("Book Name:");
String book = keyboard.nextLine();
System.out.println("Author:");
String author = keyboard.nextLine();
System.out.println("ISBN:");
String isbn = keyboard.nextLine();
System.out.println("# of Books:");
int numbooks = keyboard.nextInt();
System.out.println("");
System.out.println("");
String bookinfo = book + " ," + author + " ," + isbn;
//String[] splits = bookinfo.split(",");
System.out.println(bookinfo);
System.out.println("Name of Book | " + "Author | " + "ISBN");
// System.out.println(splits[0] +" | "+ splits[1] +" | "+ splits[2]);
}
else
if (choose == 2)
{
System.out.println("You Choose to Edit an existing Book ");
String zero = keyboard.nextLine();
}
else
if (choose == 3)
{
System.out.println("You Choose to Search a Book ");
String zero = keyboard.nextLine();
}
else
if (choose == 4)
{
System.out.println("You Choose to view all the Books ");
String zero = keyboard.nextLine();
}
else
if (choose == 5)
{
System.out.println("You Choose to Delete a Book ");
String zero = keyboard.nextLine();
}
else
if(choose == 6)
{
System.out.println("Library System Terminated!!! ");
String zero = keyboard.nextLine();
System.exit(0);
}
else
{
System.out.println("Wrong Choice");
}
}
}
}
당신이 도와 주실 수
?
이 * 1) ISBN (문자열을 보유 할'Book' 클래스를 만들기) 2 :이 여기
이 코드가 수정되는 책 클래스와 생성자) 이름 (문자열) 3) author (문자열) 4) 책의 수 (int) * 그리고 프로그램에'Book' 배열을 만듭니다. – SudoRahul