#skill rack!!!!!!!!

1 messages ยท Page 1 of 1 (latest)

humble groveBOT
#

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

ionic mist
#

hellloo

dapper jolt
#

int A = String[] parts = sc.nextLine().split(":"); is not valid

#

you can't assign an int to a String[]

#

remember to read the code "int A equals String[]" doesn't make sense right?

ionic mist
#

Bruhh actually this is a practicing webstie my college gave me.. we can only change the blanks

#

i cant modilfy any other

#

thats the problem.. '

#

the 3 boxes..

#

helloo..??

#

here is a clear image

dapper jolt
#

so if the input is 54 : 6

#

what you have to do is read each part using the scanner

#

the scanner will read each segment

#

do you know how to read a number using a scanner?

mild basin
#

What other methods can you use with scanner?

ionic mist
#

yahh i know those.. nut ...here its expection some other different answer

dapper jolt
#

tel me ๐Ÿ™‚

#

how do you read an int

mild basin
ionic mist
#

int number = scanner.nextInt();

dapper jolt
#

exactly!

#

so that's how you will read the numbers A and B

#

but wait we have a : in the middle

#

but thankfully there's a "blank" in your thingy to consume that as well

#

look at the website Surly sent, which method do you think is best to consume the :?

ionic mist
#

i dont know ๐Ÿ™๐Ÿ˜ญ๐Ÿ˜ญ

#

Can u give me the answer

mild basin
#

sTaRts with the letter 'n'

ionic mist
#

nextLine()??

dapper jolt
#

that will read the line, we just want the :

ionic mist
#

I dont know guyss... can u guyss pls say it directly pls

dapper jolt
#

it's on the website!

ionic mist
#

its late aldreadyyy

#

alrr okayyy

dapper jolt
#

hint: look under "all methods"

mild basin
#

actually skip seems a better choice

dapper jolt
ionic mist
#

SO U GUYS CANT ANSWER

#

I dont know lol

#

sorry

dapper jolt
#

@mild basin it won't work because the next char is actually a whitespace

#

and nextInt won't match if it's not got any spaces

dapper jolt
mild basin
#

ah he rage quit

dapper jolt
#

the answer is next

#

ah he did

#

i really wanted him to understand this ๐Ÿ™

mild basin
#

So impatient, so much life to live.

dapper jolt
#

did i do it bad? ๐Ÿ™

mild basin
#

nope

grand iron
#

oof

mild basin
#

maybe explain that the rest of string is "still in the pipe"

dapper jolt
#

well he's gone

mild basin
#

Weird way to force kids to program though

dapper jolt
#

scanner also has a cool useDelimiter method

#

only saw it now when reading the docs, TIL !