Class Sector

java.lang.Object
  |
  +--Sector

public class Sector
extends java.lang.Object

Homework Assignment Number: 3, Problem Number: 2, File Name: Sector.java Creates a sector classification used for each Stock object.

See Also:
Stock, StockCertificate, Portfolio, PortfolioTest

Constructor Summary
Sector()
          default constuctor
Sector(java.lang.String secName, double secChance, double secIndicator)
          construcutor method to allow input
 
Method Summary
 double getChance()
          method to get the chance
 boolean getGoodDay()
          boolean method to determine whether it was a good day for the sector
 double getIndicator()
          method to get the indicator
 java.lang.String getName()
          method to get the name of the sector
 double getTypeDay()
          method to get the type of day for the sector
 void goodDay()
          method to set whether it is a good day for the sector based on the randomly chosen typeDay variable and comparing it to the chance variable
 void setTypeDay()
          method to randomly choose a number between 0 and 1 and assign it to typeDay
 java.lang.String toString()
          report for validation purposes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Sector

public Sector()
default constuctor

Sector

public Sector(java.lang.String secName,
              double secChance,
              double secIndicator)
construcutor method to allow input
Method Detail

getName

public java.lang.String getName()
method to get the name of the sector

getChance

public double getChance()
method to get the chance

getIndicator

public double getIndicator()
method to get the indicator

getTypeDay

public double getTypeDay()
method to get the type of day for the sector

getGoodDay

public boolean getGoodDay()
boolean method to determine whether it was a good day for the sector

setTypeDay

public void setTypeDay()
method to randomly choose a number between 0 and 1 and assign it to typeDay

goodDay

public void goodDay()
method to set whether it is a good day for the sector based on the randomly chosen typeDay variable and comparing it to the chance variable
Parameters:
no - parameters

toString

public java.lang.String toString()
report for validation purposes
Parameters:
no - parameters
Returns:
report with name, indicator, chance and type of day
Overrides:
toString in class java.lang.Object