Guest User

Untitled

a guest
Jul 19th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. int countV=0;
  2. PeopleProject [] cheater= null;
  3. boolean a= true;
  4. while (countV<8)
  5. {
  6. int num=(int)(1+Math.random()*(30));
  7. if (array1[num-1].getFlag()== false)
  8. {
  9.  
  10. for (int b=0; b<=array1.length-1 ; b++)
  11. {
  12. if (array1[b].getFlag()==true && a)
  13. {
  14. if (array1[b].getSocialSecurity()==array1[num-1].getSocialSecurity())
  15. {
  16. //System.out.println("This person is a CHEATER! "+array1[b].toString());
  17. //array1[b]=cheater[b];
  18. a=false;
  19. }
  20. /*else
  21. {
  22. System.out.println("There are no CHEATERS...");
  23. }*/
  24. }
  25. }
  26. if (a==true)
  27. {
  28. array[countV].setFlag(true);
  29. array1[num-1].setFlag(true);
  30. array1[num-1].setVehicleProject(array[countV]);
  31. countV++;
  32. }
  33. }
  34. }
  35. int e=0;
  36. for (int i=0; i<=array1.length-1 ;i++ )
  37. {
  38. if (a== false)
  39. {
  40. cheater[e]=array1[i];
  41. e++;
  42. }
  43. }
  44. for (int i=0;i<cheater.length ;i++ )
  45. {
  46. System.out.println("\n"+ "This person is a CHEATER"+cheater[i].getFirstName());
  47. }
Add Comment
Please, Sign In to add comment