#Java help

61 messages ยท Page 1 of 1 (latest)

worn shale
#

I have done 1AandB can someone help with C

worldly escarpBOT
#

โŒ› This post has been reserved for your question.

Hey @worn shale! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

digital stirrup
#

what have you gotten so far

worn shale
#

@digital stirrup

digital stirrup
#

right so start by making some structure to hold your output

#

then you need to add to that within a loop of some kind

worn shale
#

I am sorry but where/how

digital stirrup
#

in the method

#

you're given hints in the problem statement itself

worn shale
digital stirrup
#

you need to start at the character given

worn shale
#

๐Ÿ˜–

digital stirrup
#

for (start, end, increment) is the general format
you want each character, so increment can just be ch++

#

try to figure out what start and end are

#

hint: ||the variable doesn't need to be an int. the other primitives also have numerical values.||

worn shale
digital stirrup
#

closer

#

a and z would need to be chars, wrapped in '

worn shale
#

so i changed a to 'a' and same for z

#

now what?

digital stirrup
#

and also , you want to start at the char that was the input

worn shale
#

'a' should be the word 'character' instread

digital stirrup
#

sure

worn shale
#

then?

digital stirrup
#

what do you have now

worn shale
#

needs a return statement

#

@digital stirrup

digital stirrup
#

yeah

#

but right now you're just printing out the character

#

you need to store it so you can return it all together

#

in the loop

#

(also range isn't used, you can remove that)

worn shale
worn shale
digital stirrup
#

no, use the loop you already have

#

you don't need to print it out from this method, you need to get the characters and return it as a string

digital stirrup
worn shale
#

yes

digital stirrup
#

so you don't have to worry about it

worn shale
#

how would i start it

digital stirrup
#

wdym

worn shale
#

I am so confused eventually we return SB

#

but we need to craete a loop to store all the letter to go into sb

#

Could your write a bit of the code out

digital stirrup
worn shale
#

I know

digital stirrup
#

you just need to add i to the StringBuilder

#

do you know how to use it

worn shale
#

Kinda

#

public StringBuilder append(char a)

digital stirrup
#

right

#

ah, you still have an int

worn shale
#

This is where I am now I am really stuck here

#

please @worn shale if you can help

digital stirrup
#

...are you reading my hint

#

and you haven't even changed anything