「java编写图书馆系统」java 图书馆

博主:adminadmin 2023-03-18 00:02:11 554

今天给各位分享java编写图书馆系统的知识,其中也会对java 图书馆进行解释,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!

本文目录一览:

用java编写一个 图书馆图书借阅管理系统

---------------------------------------------------

给你修改了三个地方:

1.borrowBooks方法中,将System.out.println("你要借吗?"); 改为:

System.out.println("你要借吗?输入1表示借,其他数字表示不借。");

保证输入的时候输入的数字,否则会报出异常。

2.borrowBooks方法中,将self[score] = all[9]; 改为:self[score] = all[i];

如果是all[9],那么就始终是最后一本书籍信息了。

3.have方法中,你是想将所借的书籍信息都打印出来。修改的比较多,下面注释代码是原来的。

void have(Books[] self) {

// for (int i = 0; i 2; i++) {

// self[i].showBookInfo();

// }

for (int i = 0; i 3; i++) {

if(self[i]!=null)

self[i].showBookInfo();

}

}

****************** 附上所有代码:*************************

import java.util.Scanner;

public class TestBook {

public static void main(String[] args) {

Books all[] = new Books[10];

Books self[] = new Books[3];

all[0] = new Books("java", 1, "12345", "tom", 34.0f, "人民出版社");

all[1] = new Books("c", 2, "12346", "tnn", 31.0f, "人民出版社");

all[2] = new Books("c++", 3, "12445", "mm", 35.0f, "人民出版社");

all[3] = new Books("c#", 4, "12365", "tt", 38.0f, "人民出版社");

all[4] = new Books("j2se", 5, "13345", "tosm", 31.1f, "人民出版社");

all[5] = new Books("j2ee", 6, "18345", "ttm", 32.0f, "人民出版社");

all[6] = new Books("jsp", 7, "12335", "cc", 33.0f, "人民出版社");

all[7] = new Books("net", 8, "12341", "bb", 36.0f, "人民出版社");

all[8] = new Books("ip", 9, "12343", "aa", 37.0f, "人民出版社");

all[9] = new Books("tcp", 10, "22345", "jj", 39.0f, "人民出版社");

Readers r = new Readers("xiaoming", 101, "1", 3);

r.searchAllBooks(all);

r.borrowBooks(all, self);

r.have(self);

r.give(all, self);

}

}

class Readers {

Scanner scan = new Scanner(System.in);

String names;

int nums;

String classes;

int grade;

int score = 0;

// Books self[]=new Books[3];

Readers(String n, int u, String c, int g) {

names = n;

nums = u;

classes = c;

grade = g;

}

void searchAllBooks(Books[] all) {// 查书

for (int i = 0; i 10; i++)

all[i].showBookInfo();

// self[score]=all[0];

}

void give(Books[] all, Books[] self) {// 还书

System.out.println("请输入您要还的书的书号");

int n = scan.nextInt();

for (int i = 0; i 10; i++) {

if (n == all[i].num) {

for (int j = 0; j 3; j++) {

if (self[j] == all[i]) {

self[j] = null;

System.out.println("还书成功");

}

}

}

}

}

void have(Books[] self) {

// for (int i = 0; i 2; i++) {

// self[i].showBookInfo();

// }

for (int i = 0; i 3; i++) {

if(self[i]!=null)

self[i].showBookInfo();

}

}

void giveMoney() {

}

void borrowBooks(Books[] all, Books[] self) {

System.out.println("请输入您要查找的书名:");

String n = scan.next();

int i;

for (i = 0; i 10; i++) {

if (n.equals(all[i].name)) {

all[i].showBookInfo();

break;

}

}

//System.out.println("你要借吗?");

System.out.println("你要借吗?输入1表示借,其他数字表示不借。");

int j;

j = scan.nextInt();

if (j == 1) {

System.out.println("借阅成功");

//self[score] = all[9];

self[score] = all[i];

score += 1;

}

if (score 4) {

System.out.println("您还可以借阅" + (3 - score) + "本");

} else {

System.out.println("对不起,一个人只能借3本");

}

}

}

class Books {

String name;

int num;

String ISBN;

String writer;

float price;

String publisher;

Books(String n, int u, String i, String w, float p, String l) {

name = n;

num = u;

ISBN = i;

writer = w;

price = p;

publisher = l;

}

void showBookInfo() {

System.out.println("**************************");

System.out.println("书名:" + name);

System.out.println("索书号:" + num);

System.out.println("ISBN号:" + ISBN);

System.out.println("价格:" + price);

System.out.println("出版社:" + publisher);

System.out.println("**************************");

}

}

----------------------------------------------------

用java编写一个,图书管理系统

可以使用Baiduhi告诉我你的题目

有空能搞定你无法解决的题目

如果你有类似的要求也能联系我

ES:\\F3BE205E98C61E3942B3CDFC44D10E6F

交易提醒:预付定金有风险

交易提醒:用户名中包含联系方式勿轻信

用java语言编写 图书馆管理系统

工程量比较大!主要是数据库设计、用户介面设计。数据库连接建议使用JDBC纯JAVA驱动。

哪一位编程大师帮我用java写一份图书馆管理系统,

运行一下看要不要咯。

package booksborrow;

import java.io.BufferedReader;

import java.io.IOException;

import java.io.InputStreamReader;

class Student{

String number;

String name;

String[] booksName=new String[4];

int booksNum;

public Student(String number,String name,String booksName,int booksNum){

this.number=number;

this.name=name;

this.booksNum=booksNum;

for(int i=0;i4;i++) {

this.booksName[i]=new String("");

}

}

}

class Books{

static String bname[]={"红楼梦","西游记","三国演义","水浒传","聊斋志异",

"java编程经典","数字电子技术","老人与海","电子商务","子夜","中国十大皇帝",

"邓小平文选","鲁迅散文全集","空蝉","商法","刑法","民法","数据库导论",

"管理信息系统","财务管理","统计学","线性代数","离散数学","逻辑学",

"高等代数"};

static String biden[]=new String[bname.length+1];

static int[] bnum=new int[bname.length+1];

public Books(){

for(int i=0;ibname.length;i++){

bnum[i]=7;

switch(i/10){

case 0:biden[i]="112200"+i;break;

case 1:

case 2:

case 3:biden[i]="11220"+i;break;

}

}

}

boolean count(String books_identifier,int borr_or_retur){

final int borr=0;

final int retur=1;

int i;

for(i=0;biden[i]!=null;i++) {

if(biden[i].equals(books_identifier)) {

break;

}

}

if(biden[i]==null){

System.out.println("\t\t**********无此书!**********");

return false;

}

else if(borr_or_retur==borr) {

if(bnum[i]==0){

System.out.println("\t\t*****此书已全部被借走!*****");

return false;

}

else {

bnum[i]--;

}

}

else {

bnum[i]++;

}

return true;

}

}

class Borrow{

public void borrow(String number,String name,String booksName,String books_identifier,Student[] stu,Books book){

int i,j;

boolean judge=false;

for(i=0;!"".equals(stu[i].number) || stu[i].number.equals("-1");i++) {

if(stu[i].number.equals(number) || stu[i].name.equals(name)){judge=true;break;}

}

if(stu[i].booksNum=4) {

System.out.println("\t对不起,您所借的图书已达到上限,请还书后再继续借书!");

}

else if(book.count(books_identifier,0)) {

if(judge==false) {

stu[i].number=number;

stu[i].name=name;

stu[i].booksName[0]=booksName;

stu[i].booksNum=1;

}

else{

for(j=0;!stu[i].booksName[j].equals("") !stu[i].booksName[j].equals("-1");j++);

stu[i].booksName[j]=booksName;

stu[i].booksNum++;

}

}

}

}

class Return{

public void retur(String number,String name,String booksName,String books_identifier,Student[] stu,Books book){

int i,j;

for(i=0;!"".equals(stu[i].name) || stu[i].name.equals("-1");i++) {

if(stu[i].name.equals(name)) {

break;

}

}

if("".equals(stu[i].name)) {

System.out.println("\t\t**请核实: 您之前并未借书!**");

}

else if(book.count(books_identifier,1)){

for(j=0;!stu[i].booksName[j].equals("") || stu[i].booksName[j].equals("-1");j++) {

if(stu[i].booksName[j].equals(booksName)){

stu[i].booksName[j]="-1";

break;

}

}

stu[i].booksNum--;

if(stu[i].booksNum==0){

stu[i].number="-1";

stu[i].name="-1";

}

}

}

}

class BooksBorrow{

public static void main(String[] args){

Student[] stu=new Student[100000];

String number;

String name;

String booksName;

String books_identifier;

int going=0;

int conti;

int title=0;

Books book=new Books();

Borrow bo=new Borrow();

Return re=new Return();

for(int i=0;i100000;i++) {

stu[i]=new Student("","","",0);

}

do{

System.out.print("\t\t请从以下菜单中选择操作:\n\t\t\t1---------查询图书馆藏"

+ "书概况\n\t\t\t2---------借书\n\t\t\t3---------还书\n\t\t请输入:");

try{BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

title=Integer.parseInt(br.readLine());

}catch(IOException | NumberFormatException e){}

if(title==1){

System.out.println("图书馆藏书概况如下:\n编号\t\t 书名\t\t 可借阅本数");

try{for(int i=0;Books.bname[i]!=null;i++) {

System.out.println(Books.biden[i]+"\t\t"+Books.bname[i]+"\t\t"+Books.bnum[i]);

}

}catch(ArrayIndexOutOfBoundsException e){}

}

else if(title==2) {

try{System.out.print("t********************借书*******************\n\t\t请输入学号:");

BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

number=br.readLine();

System.out.print("\t\t请输入姓名:");

name=br.readLine();

do

{System.out.print("\t\t请输入书号:");

books_identifier=br.readLine();

System.out.print("\t\t请输入书名:");

booksName=br.readLine();

bo.borrow(number,name,booksName,books_identifier,stu,book);

System.out.print("\t\t是否继续(1--Y/0--N请输入1或0): ");

conti=Integer.parseInt(br.readLine());

}while(conti==1);

}catch(IOException | NumberFormatException e){System.err.println(e);}

}

else if(title==3) {

try{System.out.print("\t********************还书********************\n\t\t请输入学号:");

BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

number=br.readLine();

System.out.print("\t\t请输入姓名:");

name=br.readLine();

do

{System.out.print("\t\t请输入书号:");

books_identifier=br.readLine();

System.out.print("\t\t请输入书名:");

booksName=br.readLine();

re.retur(number,name,booksName,books_identifier,stu,book);

System.out.print("\t\t是否继续(1--Y/0--N请输入1或0): ");

conti=Integer.parseInt(br.readLine());

}while(conti==1);

}catch(IOException | NumberFormatException e){System.err.println(e);}

}

else {

System.out.println("\t\t*********输入错误*********!");

}

try{System.out.print("是否退出(1--Y/0--N请输入1或0):");

BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

going=Integer.parseInt(br.readLine());

}catch(IOException | NumberFormatException e){}

}while(going==0);

}

}

用JAVA编写图书信息管理系统,进行可行性分析.300-400字。需要原创

技术可行性:前面我们已经学习过java的编程知识,会用java进行小的程序项目的编写,开发。并且图书信息管理系统通过java的界面编程来实现还是比价简单。通过java可以很容易的编写出来,所以,技术上是可行的。

经济可行性:现在计算机各种软件已经充斥了我们的工作生活学习,我们的衣食住行都需要软件来给我们提供方便的管理,减轻人们的负担。因此对于图书馆的信息管理,为了减轻图书管理员的负担,开发图书信息管理系统是有必要的。图书馆对图书信息管理

图书馆管理系统java怎么做

先考虑软件环境问题,确定好开发工具和数据库。图书馆管理系统,我的理解就是一个档案管理而已,数据库用sql server;然后最好设计一个数据库模型和功能模型,把你的系统的主要功能和需要的数据库表有一个雏形。你需要用户登录,则至少有一个用户管理的功能,如果更复杂一点,应该有一个权限管理,日志管理。如果还要分角色,则需要角色管理。然后肯定得有一个图书入库,图书借出,图书归还等等功能;然后就是详细设计了,每个功能模块大概需要哪些更详细的功能点;做好前面几部非常关键,不然后面才发现设计跟需求出现大的偏差,后果就非常严重了;后面就是代码编写测试,纯技术问题,一般问题不大。

关于java编写图书馆系统和java 图书馆的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站。