View the step-by-step solution to:

I Assignmem 1 [C:\Usels\PC\|deaPluJeCtstssignment 1] , \src\A1Q1java [Assignmem 1] , ImelliJ IDEA file Edit \_Iiew avigate gods Analyge Befaclor...

2018-06-01 (4).png2018-06-01 (3).pnghi i need someone to check my code since i dont know where i did wrong , is said Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 38

at A1Q1.seat(A1Q1.java:53)

at A1Q1.main(A1Q1.java:16)

2018-06-01 (3).png

I Assignmem 1 [C:\Usels\PC\|deaPluJeCtstssignment 1] , \src\A1Q1java [Assignmem 1] , ImelliJ IDEA
file Edit \_Iiew flavigate gods Analyge Befaclor guild Rgn Iouls vcg window flelp Assignment I > ; src) c'. A1Q1) Jae mow >aHa EEQ c'A1Q11ava .Boolungsgava x totalSeat= In:eges.psxsernc1beskmg[o1 1 ,-
seating: new String[tutalseat];
notEnauSeat=t=talSeat; 39
35 startsearch:l;
as whi1e(startsearch < beeklngJengehp ( tutalGqup e Integer.parsernt1buuking[3ta1tsearch] i;
Startfiearch++;
if (nutEnDuSeat < eeeslereup. 1 System.uut.println1"can nee seat this greup"); a, 1 else 1
42 if (blockDfEmptytseating, totalGrnupl] ( 45 pastRandam = £indRandam(aeatlng, totalGroup); 44 1 else ( 45 pastRandam = 71; 4e 1 a: while (totalfiroup > o) { 2 passenger : beeklsg[eeesl5ese1; 43 if (pDSOfRandum < o) { so aeatlng[f1‘nd£andam(seatlng, tmlew! 1)] : Passenger;
5, 1 else ( 52 see:mg[peso£aendem1 : passenger; 55 pDEOfRandom++; 54 l 55 1 55 1 5' 1 5: return seeelng; 53 I so 65 public static beeleen blaskofmptycscnngn seetlng, int tecslsxeupu in: pes: o; boolean check: false; while 1pes< aeatlng.length e tutalEqup + l u lcheckll
chECRZDheukEchk(Heating, pss, tutalsxoup);
pus++; I return check; is 1 my @ public seeeie ine (lnessneemstnngn seaung, ine tutalsruup1{ A101 > mainO El Compilation completed successfully m 1 s 664 ms (17 minutes ago) a Type here to Search 15 15:54 CRLF: UTFVS: 1. E Q

2018-06-01 (4).png

Top Answer

Kindly replace below code from line no 49 to line no 54: if(posOfRandom >=... View the full answer

Sign up to view the full answer

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question
Ask a homework question - tutors are online