- /**====================================================
- Christopher Carlsen
- 05/15/2012
- Lab 5:B - MonthlyEggCount Class
- ====================================================**/
- import java.util.Random; //Imports the Random class
- /** Class: MonthlyEggCount.java
- ** Purpose: This class, when called on, will generate a
- ** MonthlyEggCount object, which will then randomly produce
- ** three integer values for the three seperate "chicken"
- ** attributes. It will then store those values and allow the
- ** calling program to "get" them. */
- public class MonthlyEggCount
- {
- private int chicken1;
- private int chicken2;
- private int chicken3;
- Random eggCount = new Random(); //Creates a new Random object
- /** Method: MonthlyEggCount constructor
- **
- ** Purpose: When called, will generate
- ** three random integer values and store
- ** them for use by the other methods. */
- public MonthlyEggCount()
- {
- chicken1 = eggCount.nextInt(26);
- chicken2 = eggCount.nextInt(26);
- chicken3 = eggCount.nextInt(26);
- }
- /** Method: getMonthTotal
- **
- ** Purpose: When called, will return the sum of
- ** chicken1 through chicken3. */
- public int getMonthTotal()
- {
- return chicken1 + chicken2 + chicken3;
- }
- /** Method: getChicken1
- **
- ** Purpose: When called, will return the integer value
- ** stored for chicken1. */
- public int getChicken1()
- {
- return chicken1;
- }
- /** Method: getChicken1
- **
- ** Purpose: When called, will return the integer value
- ** stored for chicken2. */
- public int getChicken2()
- {
- return chicken2;
- }
- /** Method: getChicken1
- **
- ** Purpose: When called, will return the integer value
- ** stored for chicken3. */
- public int getChicken3()
- {
- return chicken3;
- }
- /** Method: getGraph
- **
- ** Purpose: When called, will return a bar graph made
- ** from asterisk symbols. */
- public int getGraph()
- {
- //??????????????????????
- }
- }