|
|
|
@ -0,0 +1,19 @@ |
|
|
|
public class Stock{ |
|
|
|
|
|
|
|
public String name; |
|
|
|
public String symbol; |
|
|
|
public double openingPrice; |
|
|
|
public double closingPrice; |
|
|
|
|
|
|
|
public void getChangeInPrice(){ |
|
|
|
double change= closingPrice-openingPrice; |
|
|
|
System.out.println("Change is" + change); |
|
|
|
} |
|
|
|
public void printStockInfo(){ |
|
|
|
System.out.println("Name: " + name); |
|
|
|
System.out.println("Symbol: " + symbol); |
|
|
|
System.out.println("Opening Price: " + openingPrice); |
|
|
|
System.out.println("Closing Price: "+ closingPrice); |
|
|
|
|
|
|
|
} |
|
|
|
} |