word scrambler class
TRANSCRIPT
![Page 1: Word scrambler class](https://reader036.vdocuments.us/reader036/viewer/2022071818/55b03ca61a28ab562d8b4776/html5/thumbnails/1.jpg)
Temi O.
![Page 2: Word scrambler class](https://reader036.vdocuments.us/reader036/viewer/2022071818/55b03ca61a28ab562d8b4776/html5/thumbnails/2.jpg)
*an array is created----wordArr
*Even number of objects
*string objects
* instance variable scrambledWords
![Page 3: Word scrambler class](https://reader036.vdocuments.us/reader036/viewer/2022071818/55b03ca61a28ab562d8b4776/html5/thumbnails/3.jpg)
*makes a string with the 1st half of word1 and the 2nd half of word2
Apple Pear
Ap ar
![Page 4: Word scrambler class](https://reader036.vdocuments.us/reader036/viewer/2022071818/55b03ca61a28ab562d8b4776/html5/thumbnails/4.jpg)
*To get the first half of word1------divide the word length by 2
*Use 0 to the new value as the first half of your new recombined word
*To get the second half of word2---divide the word length by 2
*Use the new value to the end as the second half of the new recombined
*Word1.substring(o,wordlength()/2)+word2.substring(word2.length()/2));
Apple Pear
Ap ar
![Page 5: Word scrambler class](https://reader036.vdocuments.us/reader036/viewer/2022071818/55b03ca61a28ab562d8b4776/html5/thumbnails/5.jpg)
*creates an array list from recombine
*each pair of words creates 2 recombined words
* length of the new array=length of old array
* loop through the array length
*Call recombine(words[i], words[i+1]);
recombine(words[i+1], words[i]);