Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int countV=0;
- PeopleProject [] cheater= null;
- boolean a= true;
- while (countV<8)
- {
- int num=(int)(1+Math.random()*(30));
- if (array1[num-1].getFlag()== false)
- {
- for (int b=0; b<=array1.length-1 ; b++)
- {
- if (array1[b].getFlag()==true && a)
- {
- if (array1[b].getSocialSecurity()==array1[num-1].getSocialSecurity())
- {
- //System.out.println("This person is a CHEATER! "+array1[b].toString());
- //array1[b]=cheater[b];
- a=false;
- }
- /*else
- {
- System.out.println("There are no CHEATERS...");
- }*/
- }
- }
- if (a==true)
- {
- array[countV].setFlag(true);
- array1[num-1].setFlag(true);
- array1[num-1].setVehicleProject(array[countV]);
- countV++;
- }
- }
- }
- int e=0;
- for (int i=0; i<=array1.length-1 ;i++ )
- {
- if (a== false)
- {
- cheater[e]=array1[i];
- e++;
- }
- }
- for (int i=0;i<cheater.length ;i++ )
- {
- System.out.println("\n"+ "This person is a CHEATER"+cheater[i].getFirstName());
- }
Add Comment
Please, Sign In to add comment