当前位置:网站首页 > 数据科学与大数据 > 正文

数据库课程设计图书管理系统(数据库课程设计图书管理系统数据类型定义)



1 问题

本次我们要提出的问题是设计一个简易的图书管理系统可以使图书管理变得不再那么困难。


2 方法

先建造一个Book的类,包含了书名、作者、价格、类型和是否被借的属性,且设置为private类型,提供了get和set方法。还有就是用户端的实现,同样使用get和set的方法。

代码清单 1

public class Book {
private String name;
private String author;
private int price;
private String type;
private boolean isBorrowed; //是否被借
public Book(){
}
public Book(String name,String author,int price,String type){
this.author = author;
this.name = name;
this.price = price;
this.type = type;
}
public String getName(){
return name;
}
public void setName(String name){
this.name = name;
}
public String getAuthor(){
return author;
}
public int getPrice(){
this.price = price;
}
public String getType(){
return type;
}
public void setType(String type){
this.type = type;
}
public boolean isBorrowed(){
return isBorrowed;
}
public void setBorrowed(boolean borrowed){
isBorrowed = borrowed;
}
public String toString(){
return "Book{" +
"书名:'" + name + '\''+
",作者:'" + author + '\''+
",价格:'" + price +
",类型:'" + type +'\'' +
",是否借出:" + isBorrowed +'}';
}
}














































3 结语

本次作业主要使用了类来完成,使用这个系统可以实现基础的借书流程,并且可以查询是谁借的,借的什么类型以及是否借出。但是这个系统提升空间还有很多,我们下来有时间继续完善此程序,类的用途很广泛,方便又简洁。在学习中,我认为自己还有很多不足,虽然书上的代码每周都认真重复敲,但还是有些不熟练,编写较长代码还是有困难,这学期课程比较有难度,因此很少有自己主动编写的程序后面应该找时间完善自己的全部作品

到此这篇数据库课程设计图书管理系统(数据库课程设计图书管理系统数据类型定义)的文章就介绍到这了,更多相关内容请继续浏览下面的相关推荐文章,希望大家都能在编程的领域有一番成就!

版权声明


相关文章:

  • score电竞(score电竞数据APP)2025-06-28 16:27:07
  • 卡巴斯基无法更新(卡巴斯基无法更新数据库)2025-06-28 16:27:07
  • orecal数据库(orecal数据库区分大小写吗)2025-06-28 16:27:07
  • 数据库基础知识整理思维导图(数据库基础知识整理思维导图怎么画)2025-06-28 16:27:07
  • odbc数据库(odbc数据库启用不起)2025-06-28 16:27:07
  • uchar是什么类型数据(uchar unsigned char是什么意思)2025-06-28 16:27:07
  • 红米手机数据传输到新手机(红米手机数据传输到新手机上)2025-06-28 16:27:07
  • swagger2.0api存数据库(swagger api文档)2025-06-28 16:27:07
  • spss17数据分析详细教程(spss 数据分析教程)2025-06-28 16:27:07
  • 大数据课程短期培训(大数据课程技术培训)2025-06-28 16:27:07
  • 全屏图片