图书管理系统web源码(图书管理系统jsp源码免费)
本文目录一览:
- 1、关于图书管理系统设计,求源码
- 2、跪求一份可以在MyEclipse运行的图书管理系统的源代码
- 3、急求用C语言编写的图书管理系统源代码
- 4、求一个javaweb+mysql的图书管理系统,可运行的
关于图书管理系统设计,求源码
绝对可以完成 1. 借书,还书; 2. 在图书馆中增加/删除一本书; 3. 按照作者名或专业领域检索一批书; 4. 找出被某位读者借出的一批书; 5. 找出最近借走某本图书的读者。
跪求一份可以在MyEclipse运行的图书管理系统的源代码
正好前段时间写过。看下符合需求不图书管理系统web源码,唉上传不图书管理系统web源码了,只有全发了
//该类是程序启动入口
package cn.bbs.gz.mybms;
import java.io.IOException;
public class Test
{
public static void main(String[] args) throws IOException
{
new BookManager().showMenu();
}
}
//该类是数据存储中心
package cn.bbs.gz.mybms;
import java.util.LinkedList;
public class Books
{
static LinkedListBook list=new LinkedListBook();
static{
//初始化数据
list.add(new Book("Java核心技术123","SunWu",168,"香港旺角","J123","2013-03-15"));
list.add(new Book("Java编程思想","老马",128,"广州","G111","2013-01-26"));
list.add(new Book("Java框架集","老孙",89,"广州","S520","2013-03-17"));
list.add(new Book("HTML+CSS","老牛",99,"上海","H119","2013-03-18"));
list.add(new Book("JavaWeb开发","小丽",118,"北京","B1314","2008-08-08"));
}
}
//该类是Book模型
package cn.bbs.gz.mybms;
public class Book
{
private String name;//书名
private String author;//作者
private double price;//价钱
private String publisher;//出版社
private String isbn;//书号
private String date;//出版日期
public Book() {
}
public Book(String name, String author, double price, String publisher,
String isbn, String date) {
super();
this.name = name;
this.author = author;
this.price = price;
this.publisher = publisher;
this.isbn = isbn;
this.date = date;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}
public String getPublisher() {
return publisher;
}
public void setPublisher(String publisher) {
this.publisher = publisher;
}
public String getIsbn() {
return isbn;
}
public void setIsbn(String isbn) {
this.isbn = isbn;
}
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
}
//该类是图书管理中心
package cn.itcast.gz.mybms;
import java.io.IOException;
import java.util.Collections;
import java.util.Comparator;
import java.util.LinkedList;
import java.util.Scanner;
public class BookManager
{
LinkedListBook list = Books.list;
public void showMenu() throws IOException
{
//显示主菜单(一级菜单)
System.out.println("-------------------欢迎光临本图书管理系统-------------------");
System.out.println("(A)查看 (B)增加 (C)删除 (D)修改 (X)退出");
Scanner sc = new Scanner(System.in);
String str = sc.nextLine();
if(str.equalsIgnoreCase("A"))
{
System.out.println("-------------------------查询界面--------------------------");
showSelect();
}
else if(str.equalsIgnoreCase("B"))
{
System.out.println("-------------------------增加界面--------------------------");
showAdd();
}
else if(str.equalsIgnoreCase("C"))
{
System.out.println("-------------------------删除界面--------------------------");
showDelete();
}
else if(str.equalsIgnoreCase("D"))
{
System.out.println("-------------------------修改界面--------------------------");
showUpdate();
}
else if(str.equalsIgnoreCase("X"))
{
System.out.println("系统退出");
System.exit(0);
}
else
{
System.out.println("输入无效字符!!!");
showMenu();
}
}
private void showUpdate() throws IOException
{
// -------------------------修改界面--------------------------
String name ="";//书名
String author="";//作者
double price=0.0;//价钱
String publisher="";//出版社
String isbn="";//书号
String date="";//出版日期
Scanner sc = new Scanner(System.in);//字符串
Scanner sc2 = new Scanner(System.in);//整型
Scanner sc3 = new Scanner(System.in);//double型
System.out.println("书号\t书名\t\t作者\t价格\t出版社\t编号\t出版日期");
for(int i=0;ilist.size();i++)
{
System.out.println(i+"\t"+list.get(i).getName()+"\t"+list.get(i).getAuthor()+"\t"+list.get(i).getPrice()
+"\t"+list.get(i).getPublisher()+"\t"+list.get(i).getIsbn()+"\t"+list.get(i).getDate());
}
System.out.println("请选择图书管理系统web源码你要修改图书管理系统web源码的书号:");
int num = sc2.nextInt();
if(num=0 numlist.size())
{
while(true)
{
System.out.println("请选择修改:(1)书名 (2)作者 (3)价格 (4)出版社 (5)编号 (6)出版日期 (7)保存修改 (8)退出");
int num2 = sc2.nextInt();
switch(num2)
{
case 1:
System.out.println("请输入新的书名:");
name = sc.nextLine();
break;
case 2:
System.out.println("请输入新的作者:");
author = sc.nextLine();
break;
case 3:
System.out.println("请输入新的价格:");
price = sc3.nextDouble();
break;
case 4:
System.out.println("请输入新的出版社:");
publisher = sc.nextLine();
break;
case 5:
System.out.println("请输入新的编号:");
isbn = sc.nextLine();
break;
case 6:
System.out.println("请输入新的出版日期:");
date = sc.nextLine();
break;
case 7:
/*if(!name.equals(""))
{
list.get(num).setName(name);
}
if(!author.equals(""))
{
list.get(num).setAuthor(author);
}
if(price!=0.0)
{
list.get(num).setPrice(price);
}
if(!publisher.equals(""))
{
list.get(num).setPublisher(publisher);
}
if(!isbn.equals(""))
{
list.get(num).setIsbn(isbn);
}
if(!date.equals(""))
{
list.get(num).setDate(date);
}*/
if(name.equals(""))
{
name = list.get(num).getName();
}
if(author.equals(""))
{
author = list.get(num).getAuthor();
}
if(price==0.0)
{
price = list.get(num).getPrice();
}
if(publisher.equals(""))
{
publisher = list.get(num).getPublisher();
}
if(isbn.equals(""))
{
isbn = list.get(num).getIsbn();
}
if(date.equals(""))
{
date = list.get(num).getDate();
}
list.set(num, new Book(name,author,price,publisher,isbn,date));
System.out.println("保存成功!");
break;
case 8:
showMenu();
break;
default :
System.out.println("输入不正确,请重新输入");
continue;
}
}
}
else
{
System.out.println("您输入的书号不正确!");
showUpdate();
}
}
private void showDelete() throws IOException
{
// -------------------------删除界面--------------------------
System.out.println("书号\t书名\t\t作者\t价格\t出版社\t编号\t出版日期");
for(int i=0;ilist.size();i++)
{
System.out.println(i+"\t"+list.get(i).getName()+"\t"+list.get(i).getAuthor()+"\t"+list.get(i).getPrice()
+"\t"+list.get(i).getPublisher()+"\t"+list.get(i).getIsbn()+"\t"+list.get(i).getDate());
}
System.out.println("请选择您要删除的书号:");
Scanner sc = new Scanner(System.in);
Scanner sc2 = new Scanner(System.in);
int num = sc.nextInt();
if(num=0 numlist.size())
{
if(list.remove(num)!=null)
{
System.out.println("删除成功!是否继续?(Y/N)");
String str = sc2.nextLine();
if(str.equalsIgnoreCase("Y"))
{
showDelete();
}
else
{
showMenu();
}
}
else
{
System.out.println("删除失败,请重新尝试");
showDelete();
}
}
else
{
System.out.println("您输入的数字不正确!");
showDelete();
}
}
private void showAdd() throws IOException
{
// -------------------------增加界面--------------------------
Scanner sc = new Scanner(System.in);
Scanner sc2 = new Scanner(System.in);
String name ="";//书名
String author="";//作者
double price=0.0;//价钱
String publisher="";//出版社
String isbn="";//书号
String date="";//出版日期
System.out.println("请输入书名:");
name = sc.nextLine();
System.out.println("请输入作者:");
author = sc.nextLine();
System.out.println("请输入价格:");
price = sc.nextDouble();
System.out.println("请输入出版社:");
publisher = sc2.nextLine();
System.out.println("请输入书号:");
isbn = sc2.nextLine();
System.out.println("请输入出版日期:");
date = sc2.nextLine();
boolean bo = list.add(new Book(name,author,price,publisher,isbn,date));
if(bo)
{
System.out.println("添加成功!");
System.out.println("您添加的书的信息是:");
System.out.println("书名:"+name);
System.out.println("作者:"+author);
System.out.println("价格:"+price);
System.out.println("出版社:"+publisher);
System.out.println("书号:"+isbn);
System.out.println("出版日期:"+date);
System.out.println("是否还要添加?(Y/N)");
String isAdd = sc2.nextLine();
if(isAdd.equalsIgnoreCase("Y"))
{
showAdd();
}
else
{
showMenu();
}
}
else
{
System.out.println("添加失败");
}
}
public void showSelect() throws IOException
{
//-------------------------查询界面--------------------------
System.out.println("书名\t\t作者\t价格\t出版社\t编号\t出版日期");
for(Book book : list)
{
System.out.println(book.getName()+"\t"+book.getAuthor()+"\t"+book.getPrice()
+"\t"+book.getPublisher()+"\t"+book.getIsbn()+"\t"+book.getDate());
}
System.out.println("请选择排序方式:(1)书名 (2)作者 (3)价格 (4)出版日期 (5)返回上一级");
Scanner sc = new Scanner(System.in);
String str = sc.nextLine();
select(str.charAt(0));
showSelect();
}
private void select(char c) throws IOException
{
ComparatorBook comparator = null;
switch(c)
{
case '1':
//按照 书名排序
comparator = new ComparatorBook(){
@Override
public int compare(Book o1, Book o2)
{
if(o1.getName().compareTo(o2.getName())!=0)
{
return o1.getName().compareTo(o2.getName());
}
return String.valueOf(o1.getPrice()).compareTo(String.valueOf(o2.getPrice()));
}
};
break;
case '2':
//按照 作者名称排序
comparator = new ComparatorBook(){
@Override
public int compare(Book o1, Book o2)
{
if(o1.getAuthor().compareTo(o2.getAuthor())!=0)
{
return o1.getAuthor().compareTo(o2.getAuthor());
}
return String.valueOf(o1.getPrice()).compareTo(String.valueOf(o2.getPrice()));
}
};
break;
case '3':
//按照价格排序
comparator = new ComparatorBook(){
@Override
public int compare(Book o1, Book o2)
{
Double d1 = new Double(o1.getPrice());
Double d2 = new Double(o2.getPrice());
if(d1.compareTo(d2)!=0)
{
return d1.compareTo(d2);
}
return o1.getName().compareTo(o2.getName());
}
};
break;
case '4':
//按照出版日期排序
comparator = new ComparatorBook(){
@Override
public int compare(Book o1, Book o2)
{
if(o1.getDate().compareTo(o2.getDate())!=0)
{
return o1.getDate().compareTo(o2.getDate());
}
return String.valueOf(o1.getPrice()).compareTo(String.valueOf(o2.getPrice()));
}
};
break;
case '5':
showMenu();
break;
default :
System.out.println("请输入合法标识");
showSelect();
break;
}
Collections.sort(list,comparator);
}
}
急求用C语言编写的图书管理系统源代码
#includestdio.h
#includestring.h
#includeconio.h
#includestdlib.h
#includectype.h
#define STACK_INIT_SIZE 10
#define OK 1
#define TRUE 1
#define FALSE 0
#define ERROR 0
struct student /*定义学生类型,用于存放借出的书籍*/
{
int carnum;
char lendbook[10];
}student[1000];
struct employ /*定义职工类型*/
{
int employnum;
char employname[15];
int employage;
char employsex[2];
char employleve[10];
long int employtage;
}employ[50];
struct book /*定义书的类型*/
{
int booknum;
char bookname[10];
char bookcreat[10];
int turefalse; /*用于借书和还书模块判断一本书是否借出的条件*/
}book[1000];
struct car /*借书卡的数据类型*/
{
int carnum;
char studentname[10];
int studentclass;
}car[100];
huanbook() /*还书函数*/
{
FILE *fp,*fp2; /*定义两个文件指针,fp2用于修改数据时设立临时文件用,防止数据遭破坏*/
int i,n;
int carnum;
char lendbook[10];
printf("请你输入你的卡号\n");
scanf("%d",carnum);
fp=fopen("car.txt","r"); /*读取卡号记录*/
for(i=0;fread(car[i],sizeof(struct car),1,fp)!=0;i++) /*for循环判断卡号是否存在*/
{
if(car[i].carnum==carnum) /*卡号存在,进入下一循环*/
{
n=i;
fclose(fp);
printf("请输入你要还的书的名字\n");
scanf("%s",lendbook);
fp=fopen("record.txt","r");
for(i=0;fread(student[i],sizeof(struct student),1,fp)!=0;i++) /*判断是否借阅图书管理系统web源码了输入的书*/
{
if(strcmp(student[i].lendbook,lendbook)==0) /*借阅了该书,进入下一循环,否则出错显示*/
{
fclose(fp);
fp=fopen("record.txt","r");
fp2=fopen("bookl.txt","w");
for(i=0;fread(student[i],sizeof(struct student),1,fp)!=0;i++)
{
if(strcmp(student[i].lendbook,lendbook)==0)
{
continue; /*删除还掉的书的借书记录*/
}
fwrite(student[i],sizeof(struct student),1,fp2); /*写入原来没还的书的记录*/
}
fclose(fp);
fclose(fp2);
fp=fopen("record.txt","w");
fp2=fopen("bookl.txt","r");
for(i=0;fread(student[i],sizeof(struct student),1,fp2)!=0;i++)
{
fwrite(student[i],sizeof(struct student),1,fp); /*将借书记录信息写回*/
}
fclose(fp);
fclose(fp2);
fopen("bookl.txt","w"); /*清临时文件的记录*/
fclose(fp2);
fp=fopen("book.txt","r");
fp2=fopen("bookl.txt","w");
for(i=0;fread(book[i],sizeof(struct book),1,fp)!=0;i++) /*将书的记录写入临时文件,防止因为修改信息破坏以前的记录*/
{
if(i==n)
{
book[i].turefalse=1;
fwrite(book[i],sizeof(struct book),1,fp2); /*将还的书的原来状态设为无人借阅的*/
continue;
}
fwrite(book[i],sizeof(struct book),1,fp2);
}
fclose(fp);
fclose(fp2);
fp=fopen("book.txt","w");
fp2=fopen("bookl.txt","r");
for(i=0;fread(book[i],sizeof(struct book),1,fp2)!=0;i++)
{
fwrite(book[i],sizeof(struct book),1,fp); /*将临时文件写回*/
}
fclose(fp);
fclose(fp2);
fopen("bookl.txt","w"); /*清临时文件*/
fclose(fp2);
printf("还书完毕,按任意键返回\n");
getch();
return 1;
}
}
printf("你没有借这样的书,任意键返回\n"); /*出错提示*/
fclose(fp);
getch();
return 0;
}
}
printf("系统没这样的卡,和管理员联系,按任意键返回\n"); /*出错提示*/
fclose(fp);
getch();
}
findbook()
{
FILE *fp;
char bookname[10];
int ture,i;
fp=fopen("book.txt","r");
printf("请输入你要查找的书名\n");
scanf("%s",bookname);
for(i=0;fread(book[i],sizeof(struct book),1,fp)!=0;i++)
{
if(strcmp(bookname,book[i].bookname)==0)
{
if(book[i].turefalse==1)
{
printf("这本书的详细资料是:%d %s %s 此书现在无人借阅\n按任意键返回\n",book[i].booknum,book[i].bookname,book[i].bookcreat);
}
else {printf("这本书已经有人借出\n");fclose(fp);return 0;}
fclose(fp);
return FALSE;
}
}
printf("没有你要查询的书籍\n");
fclose(fp);
return FALSE;
}
findbook1()
{
FILE *fp;
char bookcreat[10];
int ture,i;
fp=fopen("book.txt","r");
printf("请输入你要查找的作者名\n");
scanf("%s",bookcreat);
for(i=0;fread(book[i],sizeof(struct book),1,fp)!=0;i++)
{
if(strcmp(bookcreat,book[i].bookcreat)==0)
{
if(book[i].turefalse==1)
{
printf("这本书的详细资料是:%d %s %s 此书现在无人借阅\n按任意键返回\n",book[i].booknum,book[i].bookname,book[i].bookcreat);
}
else {printf("这本书已经有人借出\n");fclose(fp);return 0;}
fclose(fp);
return FALSE;
}
}
printf("没有你要查询的书籍\n");
fclose(fp);
return FALSE;
}
lendcount()
{
FILE *fp;
int i,n=0;
fp=fopen("record.txt","r");
for(i=0;fread(student[i],sizeof(struct student),1,fp)!=0;i++)
{
printf("卡号:%d 借出的书籍:%s \n",student[i].carnum,student[i].lendbook);
n=n+1;
}
fclose(fp);
printf("目前共有%d本书借出\n",n);
printf("按任意键\n");
getch();
return n;
}
chabook()
{
char ch5;
do
{
printf("---------------欢迎进入图书查询系统!--------------\n");
printf(" 1:按书名查找\n");
printf(" 2:按作者查找\n");
printf(" 0:返回\n");
printf("请输入0--2,其他输入非法!\n");
scanf("%s",ch5);
switch(ch5)
{
case '1':findbook();getch();break;
case '2':findbook1();getch();break;
case '0':break;
default:printf("无此操作\n");getch();break;
}
}while(ch5!='0');
return FALSE;
}
lendbook()
{
FILE *fp,*fp2;
int i,n;
int carnum;
printf("请你输入你的卡号\n");
scanf("%d",carnum);
fp=fopen("car.txt","r");
for(i=0;fread(car[i],sizeof(struct car),1,fp)!=0;i++)
{
if(car[i].carnum==carnum)
{
n=i;
fclose(fp);
printf("请输入你要借阅的书的名字\n");
scanf("%s",student[n].lendbook);
fp=fopen("book.txt","r");
for(i=0;fread(book[i],sizeof(struct book),1,fp)!=0;i++)
{
if(strcmp(book[i].bookname,student[n].lendbook)==0)
{
if(book[i].turefalse==0) {printf("对不起,此书有人借出,请借其他书\n");fclose(fp);getch();return;}
else
fclose(fp);
fp=fopen("record.txt","a+");
student[n].carnum=carnum;
fwrite(student[n],sizeof(struct student),1,fp);
fclose(fp);
fp=fopen("book.txt","r");
fp2=fopen("bookl.txt","w");
for(i=0;fread(book[i],sizeof(struct book),1,fp)!=0;i++)
{
if(strcmp(book[i].bookname,student[n].lendbook)==0)
{
book[i].turefalse=0;
fwrite(book[i],sizeof(struct book),1,fp2);
continue;
}
fwrite(book[i],sizeof(struct book),1,fp2);
}
fclose(fp);
fclose(fp2);
fp=fopen("book.txt","w");
fp2=fopen("bookl.txt","r");
for(i=0;fread(book[i],sizeof(struct book),1,fp2)!=0;i++)
{
fwrite(book[i],sizeof(struct book),1,fp);
}
fclose(fp);
fclose(fp2);
fopen("bookl.txt","w");
fclose(fp2);
printf("借书完毕,按任意键返回\n");
getch();
return;
}
}
printf("不存在这样的书,任意键返回\n");
fclose(fp);
getch();
return;
}
}
printf("你的卡号不存在,请申请新卡,按任意键返回\n");
fclose(fp);
getch();
}
carcount()
{
FILE *fp;
int i,n=0;
fp=fopen("car.txt","r");
for(i=0;fread(car[i],sizeof(struct car),1,fp)!=0;i++)
{
printf("第%d张卡卡号:%d 姓名:%s 班级:%d\n",i+1,car[i].carnum,car[i].studentname,car[i].studentclass);
n=n+1;
}
fclose(fp);
printf("目前共有%d本书\n",n);
printf("按任意键\n");
getch();
}
delcar()
{
FILE *fp,*fp2;
int i;
int carnum;
char choice;
fp=fopen("car.txt","r");
fp2=fopen("bookl.txt","w");
printf("请输入你要删除的卡号\n");
printf("如果你输入的卡号存在,系统自动删除该信息!如果不存在,系统不做任何改动\n");
scanf("%d",carnum);
for(i=0;fread(car[i],sizeof(struct car),1,fp)!=0;i++)
{
if(car[i].carnum!=carnum)
{
fwrite(car[i],sizeof(struct car),1,fp2);
}
}
fclose(fp);
fclose(fp2);
printf("是否真的要删除该卡图书管理系统web源码?删除后该书籍的所有信息将无法恢复《Y/N》\n");
scanf("%s",choice);
if(choice=='y'||choice=='Y')
{
fp=fopen("car.txt","w");
fp2=fopen("bookl.txt","r");
for(i=0;fread(car[i],sizeof(struct car),1,fp2)!=0;i++)
{
fwrite(car[i],sizeof(struct car),1,fp);
}
fclose(fp);
fclose(fp2);
fp2=fopen("bookl.txt","w");
fclose(fp2);
printf("按任意键返回\n");
getch();
return;
}
else
{
printf("按任意键返回\n");
getch();
return;
}
}
addcar()
{
FILE *fp;
int i=0;
fp=fopen("car.txt","a+");
printf("请你输入卡号\n");
scanf("%d",car[i].carnum);
printf("请你输入学生姓名\n");
scanf("%s",car[i].studentname);
printf("请你输入班级\n");
scanf("%d",car[i].studentclass);
fwrite(car[i],sizeof(struct car),1,fp);
fclose(fp);
printf("输入完毕,任意键返回\n");
getch();
}
求一个javaweb+mysql的图书管理系统,可运行的
在CSDN下载专区搜索关键词如“图书管理系统”“javaweb”“mysql”图书管理系统web源码,很容易找到满足你需求的项目。
如果没有积分可以在t宝上买一个账号图书管理系统web源码,也很便宜的。
jsp+mysql图书馆管理系统 jsp做的图书馆管理系统,用的数据库是mysql,附带有library.sql文件,可以直接导入生成数据库,还有使用说明,是菜鸟不可多得的源码。
图书管理系统 Java + MySQL 完整实训代码,包含所有用到的图片资源以及数据库文件,大三上学期实训,注释很详细,按照阿里巴巴Java编程规范编写
图书管理系统,用JAVA和MYSQL。。。