资源简介
西工大西北工业大学,面向对象设计与编程实验,当初自己做的时候用了不少力气,现在分享给大家参考。顺便赚点分数。

代码片段和文件信息
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* This class implements a Bright Fresh Milk System.
*
* @author author name
* @version 1.0
*/
public class BrightFreshMilkSystem {
private static BufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in));
private static PrintWriter stdOut = new PrintWriter(System.out true);
private static PrintWriter stdErr = new PrintWriter(System.err true);
private Catalog catalog;
private Sale sale;
private CurrentOrder currentOrder;
/**
* Loads data and starts the application.
*
* @param args
* String arguments. Not used.
* @throws IOException
* if there are errors in the input.
*/
public static void main(String[] args) throws IOException {
BrightFreshMilkSystem application = new BrightFreshMilkSystem();
application.run();
}
/**
*
* @param initial
*/
private BrightFreshMilkSystem() {
this.catalog = loadCatalog();
this.sale = loadSale();
this.currentOrder = loadCurrentOrder();
}
/**
* Initializes the Catalog object.
*/
private Catalog loadCatalog() {
Catalog catalog = new Catalog();
List productList = new ArrayList();
productList.add(new PureMilk(“A001“ “milk400ml“ new BigDecimal(“10“) new Date() “25 days“ “China“ “3.5%“
“2.9%“));
productList.add(new PureMilk(“A002“ “skim milk800ml“ new BigDecimal(“18“) new Date() “30 days“ “China“
“3.1%“ “3.9%“));
productList.add(new Jelly(“B001“ “solid250ml“ new BigDecimal(“8.5“) new Date() “15 days“ “solid“ “80%“));
productList.add(new Jelly(“B002“ “solid400ml“ new BigDecimal(“14“) new Date() “16 days“ “solid“ “85%“));
productList.add(
new Yogurt(“C001“ “chocolate flavor270ml“ new BigDecimal(“5“) new Date() “40 days“ “chocolate“));
productList.add(new Yogurt(“C002“ “strawberry flavor400ml“ new BigDecimal(“10“) new Date() “40 days“
“strawberry“));
productList.add(new MilkDrink(“D001“ “taro flavor250ml“ new BigDecimal(“13.1“) new Date() “25 days“
“taro“ “2.9%“));
productList.add(new MilkDrink(“D002“ “apple flavor400ml“ new BigDecimal(“16“) new Date() “30 days“
“apple“ “3.8%“));
catalog.setProductList(productList);
return catalog;
}
/**
* Initializes the Sale object.
*/
private Sale loadSale() {
Sale sale = new Sale();
List orderList = new ArrayList();
sale.setOrderList(orderList);
return sale;
}
/**
* Initializes the CurrentOrder object.
*/
private CurrentOrder loadCurrentOrder() {
CurrentOrder currentOrder = new CurrentOrder(null);
List orderItemList = new ArrayList();
PureMilk pureMilk = new Pure
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 374 2017-10-20 13:13 实验课\unit2_1\java\.classpath
文件 380 2017-10-13 14:11 实验课\unit2_1\java\.project
文件 598 2017-10-13 14:11 实验课\unit2_1\java\.settings\org.eclipse.jdt.core.prefs
文件 374 2017-10-20 13:13 实验课\unit2_1\java\bin\.classpath
文件 380 2017-10-13 14:11 实验课\unit2_1\java\bin\.project
文件 598 2017-10-13 14:11 实验课\unit2_1\java\bin\.settings\org.eclipse.jdt.core.prefs
文件 8967 2017-10-20 13:39 实验课\unit2_1\java\bin\BrightFreshMilkSystem.class
文件 1057 2017-10-20 13:14 实验课\unit2_1\java\bin\Catalog.class
文件 1043 2017-10-20 13:14 实验课\unit2_1\java\bin\CurrentOrder.class
文件 1201 2017-10-20 13:14 实验课\unit2_1\java\bin\Jelly.class
文件 1186 2017-10-20 13:14 实验课\unit2_1\java\bin\MilkDrink.class
文件 772 2017-10-20 13:14 实验课\unit2_1\java\bin\OrderItem.class
文件 1538 2017-10-20 13:14 实验课\unit2_1\java\bin\Product.class
文件 1392 2017-10-20 13:14 实验课\unit2_1\java\bin\PureMilk.class
文件 717 2017-10-20 13:14 实验课\unit2_1\java\bin\Sale.class
文件 1009 2017-10-20 13:14 实验课\unit2_1\java\bin\Yogurt.class
文件 10024 2017-10-20 13:39 实验课\unit2_1\java\src\unit2\BrightFreshMilkSystem.java
文件 552 2017-10-13 17:33 实验课\unit2_1\java\src\unit2\Catalog.java
文件 756 2017-10-13 17:33 实验课\unit2_1\java\src\unit2\CurrentOrder.java
文件 744 2017-10-13 17:33 实验课\unit2_1\java\src\unit2\Jelly.java
文件 657 2017-10-13 17:33 实验课\unit2_1\java\src\unit2\MilkDrink.java
文件 511 2017-10-13 17:33 实验课\unit2_1\java\src\unit2\OrderItem.java
文件 1082 2017-10-13 17:33 实验课\unit2_1\java\src\unit2\Product.java
文件 921 2017-10-13 17:33 实验课\unit2_1\java\src\unit2\PureMilk.java
文件 366 2017-10-13 17:33 实验课\unit2_1\java\src\unit2\Sale.java
文件 513 2017-10-13 17:33 实验课\unit2_1\java\src\unit2\Yogurt.java
文件 9644 2017-10-13 17:30 实验课\unit2_1\unit2\BrightFreshMilkSystem.java
文件 552 2017-10-13 16:58 实验课\unit2_1\unit2\Catalog.java
文件 756 2017-10-13 17:17 实验课\unit2_1\unit2\CurrentOrder.java
文件 744 2017-10-13 17:14 实验课\unit2_1\unit2\Jelly.java
............此处省略533个文件信息
相关资源
- SpringBoot+H2+mybatis-plus59130
- 登录注册界面.zip48872
- 数字华容道
- Python全栈学习笔记面向对象大作业:
- SSM+Shiro+redis实现单点登陆
- jstl-api-1.2和jstl-impl-1.2
- vrml学习实例
- 基于MVC模式的会员管理系统
- 国内一家大型软件公司内部的正规软
- 仿windows记事本
- 组态软件IFIX 学习 教程
- JM阅读笔记(学习H264)
- GUI银行管理系统
- 超市收银系统eclipse access大学课程设计
- 模拟ATM柜员机系统--连接数据库
- 茶叶网站源码茶叶仅供学习
- C51单片机汇编指令查询、学习工具集
- A*算法的2D演示(带源码)
- VHDL学习及实例(100个例子)
- 代码审查表和代码审查实例
- 日语助词详解(对于初级中级学习者
- 仿126 网易 163 邮箱 界面
- Tomcat6.x
- 简单的行编辑器
- 扫雷(MVC架构)
- 302 Found
- window ping命令加时间并记录日志
- 学习强国auto.js
- ARM64 完整指令集,学习必备
- ppt 机器学习.ppt
评论
共有 条评论