import java.util.Random; public class County { String name; int x, y; int Bush, bushcount; int Gore, gorecount; // int change; // - is bush + is gore double gspeed, bspeed; Random r1; County(String name,int Bush, int Gore, int x, int y) { r1 = new Random(); // seed random num generator this.name = name; this.Bush = Bush; this.Gore = Gore; this.x = x; this.y = y; this.bspeed = r1.nextDouble(); // get random == 0 < # < 1 this.gspeed = r1.nextDouble(); } // public void recount() // { // change = 10; // if Jeb Bush is occupying //change -= 50; // Bush -= change; // Gore += change; // CountyUpdate(change); // } // this functions will update the totals & also give a boolean return // value to see if the county is done. public boolean CountyUpdate() { // this introduces an error into the equations, up to // a hundred votes for each candidate could be "lost" if ((Gore < 100) && (Bush < 100)) return true; bushcount += (int)(Bush * bspeed); gorecount += (int)(Gore * gspeed); Bush -= (int)(Bush*bspeed); Gore -= (int)(Gore*gspeed); return false; } }