You worked late into the night on an assignment and didn't realize that you wrote a huge section of your term paper with your ¯ngers on the wrong home keys!
Where you mean to type: \This is an unruly mob." You actually typed: \Ty8s
8s ah 7hr7o6 j9b."
Basically you swapped: 7 for U, 8 for I, 9 for O, 0 for P, U for J, I for K, O for L,
H for N, and J for M. (Those were the only keystrokes that you got wrong-you
caught yourself before you got much further.) You also never touched the shift
key, so it's all lowercase letters that you care about.
Knowing Java as you do, you decide to write a quick program to ¯x your text.
Write a method fixItUp that takes a string as input and returns a string with
the characters put the way that they ought to have been. See the ¯xItUp method
in the StringWorker class in the bookClassesFinal directory.
```
/**
* Method to f i x up bad t y p ing on a s t r i n g
*/
public s tat ic St r ing f ixI tUp ( St r ing badInput )
{
char [ ] charArray = new char [ badInput . l eng th ( ) ] ;
char currChar ;
// loop through the c h a r a c t e r s in the s t r i n g
for ( int i = 0 ; i < badInput . l eng th ( ) ; i++)
{
currChar = badInput . charAt ( i ) ;
i f ( currChar == ' 7 ' )
charArray [ i ] = 'u ' ;
el se i f ( currChar == ' 8 ' )
charArray [ i ] = ' i ' ;
el se i f ( currChar == ' 9 ' )
charArray [ i ] = ' o ' ;
el se i f ( currChar == ' 0 ' )
charArray [ i ] = 'p ' ;
el se i f ( currChar == 'u ' )
charArray [ i ] = ' j ' ;
el se i f ( currChar == ' i ' )
charArray [ i ] = ' k ' ;
el se i f ( currChar == ' o ' )
charArray [ i ] = ' l ' ;
el se i f ( currChar == 'h ' )
charArray [ i ] = 'n ' ;
el se i f ( currChar == ' j ' )
charArray [ i ] = 'm' ;
el se i f ( currChar == ' y ' )
charArray [ i ] = 'h ' ;
el se i f ( currChar == ' 6 ' )
charArray [ i ] = ' y ' ;
el se
charArray [ i ] = currChar ;
}
return new St r ing ( charArray ) ;
}
```
You might also like to view...
The app’s splash screen provides a visual indication that the app is loading. SplashScreen.png is ________.
a) shown on the app’s tile in the Start screen b) displayed with your app’s name when your app is shown in Windows 8 search results c) displayed briefly when your app first loads d) shown in the Windows Store with your app’s description and in any Windows Store search results
You can modify the design of any form by right-clicking the tab at the top of the form and selecting ____ View.
A. Form B. Design C. Layout D. Datasheet
Recordable optical discs can be written to, but the discs cannot be erased and reused.
Answer the following statement true (T) or false (F)
You can use the Charts group on the _____ tab to chart or graph data in your worksheet.
A. REVIEW B. PAGE LAYOUT C. INSERT D. HOME