当前位置: 首页 > news >正文

企业网站建设基本流程图短视频营销的优势和劣势

企业网站建设基本流程图,短视频营销的优势和劣势,word文档怎么做网站跳转链接,免费购物系统文章目录 1.书类2.图书列表3.新增图书4.借阅图书5.删除图书6.显示图书7.退出系统8.查找图书9.接口10.归还图书11.管理员菜单12.普通用户菜单13.用户类14.主函数 1.书类 package book;public class Book {private String name;private String author;private int price;private… 文章目录 1.书类2.图书列表3.新增图书4.借阅图书5.删除图书6.显示图书7.退出系统8.查找图书9.接口10.归还图书11.管理员菜单12.普通用户菜单13.用户类14.主函数 1.书类 package book;public class Book {private String name;private String author;private int price;private String type;private boolean isBorrowed;public Book(String name, String author, int price, String type) {this.name name;this.author author;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 void setAuthor(String author) {this.author author;}public int getPrice() {return price;}public void setPrice(int price) {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;}Overridepublic String toString() {return book{ name name \ , author author \ , price price , type type \ (isBorrowed true ? 已借出 : 未借出 )};} }2.图书列表 package book;public class BookList {public Book[] bookList new Book[10];private int usedSize;//当前书架上书的数目public BookList() {bookList[0] new Book(三国演义,罗贯中,18,小说);bookList[1] new Book(水浒传,施耐庵,48,小说);bookList[2] new Book(西游记,吴承恩,28,小说);this.usedSize 3;}public int getUsedSize() {return usedSize;}public void setUsedSize(int usedSize) {this.usedSize usedSize;}//把书放到pos位置public void setBookList(int pos,Book book) {bookList[pos] book;}//获取pos位置的书public Book getBook(int pos) {return bookList[pos];}//这里本质上是可以写借阅书籍等操作的 }3.新增图书 package operation;import book.Book; import book.BookList;import java.util.Scanner;public class AddOperation implements IOperation {public void work(BookList bookList) {System.out.println(新增图书);Scanner scanner new Scanner(System.in);System.out.println(输入你要新增书籍的名字);String name scanner.nextLine();System.out.println(输入你要新增书籍的作者);String author scanner.nextLine();System.out.println(输入你要新增书籍的类型);String type scanner.nextLine();System.out.println(输入你要查找新增书籍的价格);int price scanner.nextInt();Book book new Book(name,author,price,type);int currentSize bookList.getUsedSize();bookList.setBookList(currentSize,book);bookList.setUsedSize(currentSize 1);//放入一本书System.out.println(新增成功);} }4.借阅图书 package operation;import book.Book; import book.BookList;import java.util.Scanner;public class BorrowOperation implements IOperation {public void work(BookList bookList) {System.out.println(借阅图书);Scanner scanner new Scanner(System.in);System.out.println(输入你要借阅的书籍);String name scanner.nextLine();int currentSize bookList.getUsedSize();for (int i 0; i currentSize; i) {Book book bookList.getBook(i);if (book.getName().equals(name)) {book.setBorrowed(true);System.out.println(借阅成功借阅书籍信息如下);System.out.println(book);return;}}System.out.println(借阅失败没有这本书籍);} }5.删除图书 package operation;import book.Book; import book.BookList;import java.util.Scanner;public class DelOperation implements IOperation {public void work(BookList bookList) {System.out.println(删除图书);Scanner scanner new Scanner(System.in);System.out.println(输入你要删除书籍);String name scanner.nextLine();int currentSize bookList.getUsedSize();int index -1;for (int i 0; i currentSize; i) {Book book bookList.getBook(i);if (book.getName().equals(name)) {index i;break;}}//如果index-1说明没有这本书if (index -1) {System.out.println(没有你要删除的图书);return;}//从这里开始删除for (int i 0; i currentSize-1; i) {Book book bookList.getBook(i 1);bookList.setBookList(i,book);}bookList.setUsedSize(currentSize - 1);} }6.显示图书 package operation;import book.Book; import book.BookList;public class DisplayOperation implements IOperation {public void work(BookList bookList) {System.out.println(显示图书);int currentSize bookList.getUsedSize();for (int i 0; i currentSize; i) {Book book bookList.getBook(i);System.out.println(book);}} }7.退出系统 package operation;import book.BookList;public class ExitOperation implements IOperation{public void work(BookList bookList){//可以对书架进行手动清空System.out.println(退出系统);System.exit(0);} }8.查找图书 package operation;import book.Book; import book.BookList;import java.util.Scanner;public class FindOperation implements IOperation {public void work(BookList bookList) {System.out.println(查找图书);Scanner scanner new Scanner(System.in);System.out.println(输入你要查找的书籍);String name scanner.nextLine();int size bookList.getUsedSize();for (int i 0; i size; i) {Book book bookList.getBook(i);if (book.getName().equals(name)) {System.out.println(找到了这本书);System.out.println(book);return;}}System.out.println(没有这本书);} }9.接口 package operation;import book.BookList;public interface IOperation {void work(BookList bookList); }10.归还图书 package operation;import book.Book; import book.BookList;import java.util.Scanner;public class ReturnOperation implements IOperation {public void work(BookList bookList) {System.out.println(归还图书);Scanner scanner new Scanner(System.in);System.out.println(输入你要归还的书籍);String name scanner.nextLine();int currentSize bookList.getUsedSize();for (int i 0; i currentSize; i) {Book book bookList.getBook(i);if (book.getName().equals(name)) {book.setBorrowed(false);System.out.println(归还成功归还书籍信息如下);System.out.println(book);return;}}System.out.println(归还失败没有这本书籍);} }11.管理员菜单 package user;import operation.*;import java.util.Scanner;public class AdiminUser extends User {public AdiminUser(String name) {super(name);this.iOperations new IOperation[] {new ExitOperation(),new FindOperation(),new AddOperation(),new DelOperation(),new DisplayOperation()};}public int menu() {System.out.println(管理员菜单);System.out.println(hello this.name 欢迎来到图书小练习 );System.out.println(1.查找图书);System.out.println(2.新增图书);System.out.println(3.删除图书);System.out.println(4.显示图书);System.out.println(0.退出系统);System.out.println();Scanner scanner new Scanner(System.in);int choice scanner.nextInt();return choice;} }12.普通用户菜单 package user;import operation.*;import java.util.Scanner;public class NormaUser extends User {public NormaUser(String name) {super(name);this.iOperations new IOperation[] {new ExitOperation(),new FindOperation(),new BorrowOperation(),new ReturnOperation()};}public int menu() {System.out.println(普通用户菜单);System.out.println(hello this.name 欢迎来到图书小练习 );System.out.println(1.查找图书);System.out.println(2.借阅图书);System.out.println(3.归还图书);System.out.println(0.退出系统);System.out.println(请输入你的操作);Scanner scanner new Scanner(System.in);int choice scanner.nextInt();return choice;} }13.用户类 package user;import book.BookList; import operation.IOperation;public abstract class User {protected String name;protected IOperation[] iOperations;public User(String name) {this.name name;}public abstract int menu();public void doOperation(int choice, BookList bookList) {this.iOperations[choice].work(bookList);} }14.主函数 import book.BookList; import user.AdiminUser; import user.NormaUser; import user.User;import java.util.Scanner;public class Main {public static User login() {System.out.println(请输入你的姓名);Scanner scanner new Scanner(System.in);String name scanner.nextLine();System.out.println(请输入你的身份1管理员 0普通用户);int choice scanner.nextInt();if (choice 1) {return new AdiminUser(name);}else{return new NormaUser(name);}}public static void main(String[] args) {BookList bookList new BookList();User user login();//User user AdiminUser(name);//User user NormaUser(name);while (true){int choice user.menu();user.doOperation(choice,bookList);}} }
http://www.sadfv.cn/news/152655/

相关文章:

  • 淄博网站制作企业营销网站点击按钮排序
  • 利用ps怎么做网站首页万户做网站怎么样
  • 网站建设哪几家公司好wordpress标签 扩展
  • 如何不备案建网站wordpress连续id
  • 网站建设图片链接方法游戏软件开发定制
  • 南通智能模板建站wordpress教程安装教程
  • 免费手机版网站建设活动策划方案详细模板
  • 用jsp做的网站前后端交互wordpress静态网址
  • 丹江口网站制作包装设计公司排行榜
  • 怎么给网站做支付接口网站设计成品
  • 济南网站建设索q479185700国际交流网站建设方案
  • 建网站 收费标准ui界面设计报告
  • 青浦苏州网站建设wordpress微笑信息授权
  • 秦皇岛网站制作专家北京建设网经济适用房
  • 崇信县门户网站官网wordpress img相对路径
  • 智能城市 电子商务网站建设长沙租房网
  • 从做系统后以前的网站打不开了怎么办百度在线搜索
  • 湖南做网站 要上磐石网络php可以做移动端网站
  • 做网站seo的公司网站建设方案书 icp备案
  • 使用top域名做网站建设门户网站预算
  • 服务范围 网站建设公司传奇网站模板使用
  • 设计网站大全扣西湖南岚鸿首选公司做网站应记入哪个会计科目
  • 深圳公司的网站设计利用云盘做网站
  • html网站 怎么做seo网络营销常用工具
  • 企业网站的建设论文360搜索网址是多少
  • 个人服务器 网站建设济南全网推广
  • 国外用tornado做的网站河北省建设资格执业中心网站
  • vps 网站备案漳州网站建设选博大不错
  • 北京网站外包公司辽宁建设工程信息网进不去
  • 彭州建设局网站a wordpress