#Encryption algorithm help
1 messages · Page 1 of 1 (latest)
While you are waiting for getting help, here are some tips to improve your experience:
If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.
Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.
Here's what a part of the encryption algorithm is asking for: If a word has n letters, where n is an even number, first move the first n/2 letters to the end of the word. For example, 'before' becomes 'orebef'.
Here is my current output, the element lengths included were not present within the posted code but just used as reference
Life
is
either
a
daring
adventure
or
nothing
at
all
First Element Length: 4
Second Element Length: 2
Third Element Length: 6
Fourth Element Length: 1
Fifth Element Length: 6
Sixth Element Length: 9
Seventh Element Length: 2
Eighth Element Length: 7
Nineth Element Length: 2
Tenth Element Length: 3
No. items in array list: 10
Can you share your code for the algorithm ?
What about the words where n is odd? Do we need to change them in a different way ?
I don't have code for the algorithm since I had trouble getting it started running into the issue with the if statement. Here's the second part of the algorithm, "If a word has n letters, where n is an odd number, move the first (n+1)/2 to the end of the word. For example: 'kitchen' becomes 'henkitc'.
!close