資源簡介
大學學習java SSD3的標準答案。
exam1
exam2
exercise1
exercise2
exercise3
exercise4
...................

代碼片段和文件信息
import??java.io.*;
/**
?*?objects?of?this?class?store?stock?information?for?a?company.
?*?The?following?information?is?stored.
?*?
?*?- the?Dow?Jones?symbol?for?the?company?a?
String
.
?*?- the?name?of?the?company?a?
String
.
?*?- the?highest?price?reached?during?the?course?of?the?day
?*?????a?double
?*?- the?lowest?price?reached?during?the?course?of?the?day
?*?????a?double
?*?- the?last?trading?price?recorded?when?the?market?closed?on?the?day
?*?????a?double
?*?
?*
?*?@author?iCarnegie
?*?@version??1.0.0
?*/
public?class?Stock??{
/**?Dow?Jones?symbol?for?the?company?*/
private?String??symbol;
/**?the?name?of?the?company?*/
private?String??name;
/**?the?highest?price?reached?during?the?course?of?the?day?*/
private?double??highestPrice;
/**?the?lowest?price?reached?during?the?course?of?the?day?*/
private?double??lowestPrice;
/**?the?last?trading?price?recorded?when?the?market?closed?on?the?day?*/
private?double??lastPrice;?
/**
?*?Constructs?a?Stock
?object.
?*
?*?@param?initialSymbol??the?symbol?of?the?stock.
?*?@param?initialName??the?name?of?the?company.
?*?@param?initialHighestPrice???the?highest?price?of?the?stock.
?*?@param?initialLowestPrice???the?lowest?price?of?the?stock.
?*?@param?initialLastPrice???the?close?price?of?the?stock.
?*/
public?Stock?(
String?initialSymbol
String?initialName
double?initialHighestPrice
double?initialLowestPrice
double?initialLastPrice)?{
this.symbol?=?initialSymbol;
this.name?=?initialName;
this.highestPrice?=?initialHighestPrice;
this.lowestPrice?=?initialLowestPrice;
this.lastPrice?=?initialLastPrice;
}
/**
?*?Obtains?the?symbol?of?this?stock.
?*
?*?@return??the?symbol?of?this?stock.
?*/
public?String??getSymbol()??{
return??this.symbol;
}
/**
?*?Obtains?the?name?of?this?stock.
?*
?*?@return??the?name?of?this?stock.
?*/
public?String??getName()??{
return??this.name;
}
/**
?*?Obtains?the?highest?price?of?the?stock.
?*
?*?@return??the?highest?price?of?this?stock.
?*/
public?double??getHighestPrice()??{
return??this.highestPrice;
}
/**
?*?Obtains?the?lowest?price?of?the?stock.
?*
?*?@return??the?lowest?price?of?this?stock.
?*/
public?double??getLowestPrice()??{
return??this.lowestPrice;
}
/**
?*?Obtains?the?close?price?of?the?stock.
?*
?*?@return??the?close?price?of?this?stock.
?*/
public?double??getLastPrice()??{
return??this.lastPrice;
}
/**
?*?Returns?a?{@link?String}?with?the?stock?info?in?a?xml?format
?*
?*?@return??the?newly?created?{@link?String}?with?the?stock?info
?*/
public?String??getxml()??{
/*?Line?separator?*/
String?NEW_LINE?=?System.getProperty(“line.separator“);
return??““
+?NEW_LINE
+?“?????“+?getSymbol()?+?“?
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????91629??2010-04-10?17:58??SSD3答案\exam1\EmployeeInformationSystem.jpg
-----------?---------??----------?-----??----
????????????????91629????????????????????1
評論
共有 條評論