#find max value in array

1 messages · Page 1 of 1 (latest)

hasty cragBOT
#

<@&987246883653156906> please have a look, thanks.

#

find max value in array

#

Changed the title to find max value in array.

night marsh
#

well, how do u call methods?

#

what are the two arguments the method wants from u?

#

could u elaborate what gives u trouble with that step please

#

whats unclear

#

like, go into details please. thanks

lime pike
night marsh
#

and can u answer my questions please

#

well, how do u call methods?
what are the two arguments the method wants from u?

#

im trying to figure out where ur stuck exactly

#

if u dont give me anything i have to assume this is ur very first java program, first day, and we have to start with hello world

#

ur saying u dont know how to call a method?

#

that confuses me bc apparently u have been calling methods before already

#

those print statements for example

#

they are all method calls

#

or that scanner nextInt() etc

#

thats all you calling methods

#

so whats unclear in calling that search method now

lime pike
#

What to actually put it to get it to call and search for whatever number the user puts

night marsh
#

maybe make an attempt and then we can take it from there if u cant explain urself yet?

night marsh
#

step by step

#

lets first call the search method

#

no arguments provided yet

#

do u know how to do that?

#

just calling a method

lime pike
night marsh
#

well, great. so appartently u do know everything already

#

(or did AI write this?)

#

u might want to adjust that second print a bit

#

since the text doesnt really line up with what it does

#

(it doesnt print the position but the number u searched for)

#

but other than that, that code looks absolutely correct

#

well, the array is missing, i guess

#

but other than that

lime pike
#

Yea array messed up

night marsh
#

so. put the actual array there and ur golden

lime pike
night marsh
#

thats the array

#

see, it wants an array from u. an int[]:

#

not an int

#

but an int[]

#

so numbers

lime pike
#

Yesss it works

#

Thanks

night marsh
#

👌