图书馆管理系统

package xcdq.图书馆系统;

import java.util.Scanner;

public class caidan {
    ziliaoku yang = new ziliaoku();
    Scanner scanner = new Scanner(System.in);

    public void mi(){
        ziliaoku shu = new ziliaoku();
        shu.name = "java基础教程";
        shu.kk = 0;
        shu.shi = 2015-7-1;
        ziliaoku ju = new ziliaoku();
        ju.name = "数据库技术";
        ju.kk = 1;
        ju.shi = 0;
        ziliaoku ren = new ziliaoku();
        ren.shi = 0;
        ren.name = "人月神话";
        ren.kk = 1;
        yang.yang[0] = shu;
        yang.yang[1] = ju;
        yang.yang[2] = ren;
    }
    public void yi(){
        boolean flag = true;
        do {
            System.out.println("欢迎使用图书管理系统");
            System.out.println("——————————————————————————————————————————————");
            System.out.println("1.查看图书");
            System.out.println("2.新增图书");
            System.out.println("3.删除图书");
            System.out.println("4.借出图书");
            System.out.println("5.归还图书");
            System.out.println("6.退出");
            System.out.println("请选择:");
            int ll = scanner.nextByte();
            switch (ll) {
                case 1 -> {
                    System.out.println("查看图书");
                    cha();
                }
                case 2 -> {
                    System.out.println("新增图书");
                    ww();
                }
                case 3 -> {
                    System.out.println("删除图书");
                    bb();
                }
                case 4 -> {
                    System.out.println("借出图书");
                    jj();
                }
                case 5 -> {
                    System.out.println("归还图书");
                    aa();
                }
                case 6 -> {
                    System.out.println("谢谢使用");
                    flag = false;
                }
                default -> System.out.println("输入不符合要求请重新输入!");
            }
        }while (flag);

    }

    public static void main(String[] args) {
        caidan bo = new caidan();
        bo.mi();
        bo.yi();
    }
    public void cha(){
        System.out.println("编号\t书名\t借出\t日期");
        for (int i = 0; i
package xcdq.图书馆系统;

public class kongjian {
    caidan[] yang = new caidan[30];
}

package xcdq.图书馆系统;

public class ziliaoku {
    public String name;
    public int kk;
    public int shi;
    public ziliaoku[] yang;

    public void pp(int index){
        System.out.println(index+name+"\t"+kk+"\t"+shi);
    }
}

你可能感兴趣的:(图书馆管理系统)