labtest1
Class GoldPrice
java.lang.Object
labtest1.GoldPrice
public class GoldPrice
- extends Object
This utility class provides gold prices.
Method Summary |
static double |
get(int days)
Returns the price of one troy ounce of gold the
given number of days ago. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GRAMS_PER_TROY_OUNCE
public static final double GRAMS_PER_TROY_OUNCE
- Number of grams per troy ounce.
- See Also:
- Constant Field Values
get
public static double get(int days)
- Returns the price of one troy ounce of gold the
given number of days ago. For example, if
the given number is zero, then today's price
is returned.
- Parameters:
days
- number of days ago.- Precondition:
- days >= 0
- Returns:
- the price of one troy ounce of gold the
given number of days ago.