資源簡介
SSD3 exercise5 答案 保證正確
SSD3 exercise5 答案 保證正確SSD3 exercise4 答案 保證正確
SSD3 exercise5 答案 保證正確
SSD3 exercise5 答案 保證正確SSD3 exercise4 答案 保證正確
SSD3 exercise5 答案 保證正確

代碼片段和文件信息
import?java.io.*;
import?java.util.*;
//import?java.text.*;
/**
?*?This?class?implements?a?gourmet?coffee?system.
?*?
?*?@author?LinChen
?*?@version?1.1.0
?*?@see?Product
?*?@see?Coffee
?*?@see?CoffeeBrewer
?*?@see?Catalog
?*?@see?OrderItem
?*?@see?Order
?*?@see?SalesFormatter
?*?@see?PlainTextSalesFormatter
?*?@see?HTMLSalesFormatter
?*?@see?xmlSalesFormatter
?*/
public?class?GourmetCoffee?{
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?Sales?sales;
private?SalesFormatter?salesFormatter;
/**
?*?Loads?data?into?the?catalog?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?{
GourmetCoffee?application?=?new?GourmetCoffee();
application.run();
}
/**
?*?Constructs?a?GourmetCoffee
?object?and?initializes?the
?*?catalog?and?sales?data.
?*?
?*?@param?initialCatalog
?*????????????a?product?catalog
?*/
private?GourmetCoffee()?{
this.sales?=?new?Sales();
this.salesFormatter?=?PlainTextSalesFormatter.getSingletonInstance();
loadSales(loadCatalog());
}
/**
?*?Creates?an?empty?catalog?and?then?add?products?to?it.
?*?
?*?@return?a?product?catalog
?*/
private?Catalog?loadCatalog()?{
Catalog?catalog?=?new?Catalog();
catalog.addProduct(new?Coffee(“C001“?“Colombia?Whole?1?lb“?17.99
“Colombia“?“Medium“?“Rich?and?Hearty“?“Rich“?“Medium“
“Full“));
catalog.addProduct(new?Coffee(“C002“?“Colombia?Ground?1?lb“?18.75
“Colombia“?“Medium“?“Rich?and?Hearty“?“Rich“?“Medium“
“Full“));
catalog.addProduct(new?Coffee(“C003“?“Italian?Roasts?Whole?1?lb“
16.80?“Latin?American?Blend“?“Italian?Roast“
“Dark?and?heavy“?“Intense“?“Low“?“Medium“));
catalog.addProduct(new?Coffee(“C004“?“Italian?Roasts?Ground?1?lb“
17.55?“Latin?American?Blend“?“Italian?Roast“
“Dark?and?heavy“?“Intense“?“Low“?“Medium“));
catalog
.addProduct(new?Coffee(“C005“?“French?Roasts?Whole?1?lb“
16.80?“Latin?American?Blend“?“French?Roast“
“Bittersweet?full?intense“?“Intense?full“?“None“
“Medium“));
catalog
.addProduct(new?Coffee(“C006“?“French?Roasts?Ground?1?lb“
17.55?“Latin?American?Blend“?“French?Roast“
“Bittersweet?full?intense“?“Intense?full“?“None“
“Medium“));
catalog.addProduct(new?Coffee(“C007“?“Guatemala?Ground?1?lb“?17.99
“Guatemala“?“Medium“?“Rich?and?complex“?“Spicy“
“Medium?to?high“?“Medium?to?full“));
catalog.addProduct(new?Coffee(“C008“?“Guatemala?Ground?1?lb“?18.75
“Guatemala“?“Medium“?“Ric
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????7504??2010-01-16?00:05??exercise5\GourmetCoffee.java
?????文件???????2053??2010-01-16?00:06??exercise5\HTMLSalesFormatter.java
?????文件???????1899??2010-01-16?00:06??exercise5\PlainTextSalesFormatter.java
?????文件????????410??2010-01-16?00:06??exercise5\SalesFormatter.java
????..A.SH.??????4608??2010-01-15?23:55??exercise5\Thumbs.db
?????文件???????1824??2010-01-16?00:06??exercise5\xm
?????目錄??????????0??2010-01-16?00:06??exercise5
-----------?---------??----------?-----??----
????????????????18298????????????????????7
評論
共有 條評論