Advertisement
Guest User

Untitled

a guest
Dec 9th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. public int findBayOfCar(int carNumber) {
  2.  
  3. int number[];
  4. number = new int[cars.length];
  5. int count = 0;
  6.  
  7. for (int i = 0; i<cars.length;i++) {
  8.  
  9. if (isEmpty(i)) {
  10. continue;
  11. }
  12. else {
  13.  
  14. count++;
  15. number[i]=count;
  16. }
  17. if (count == carNumber) {
  18. return i;
  19. }
  20.  
  21. }
  22. return count;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement