Question: Code Java please Page 4 1) Write a method called repeatIt() that returns a String. It will take a String argument inStr and an int
Page 4 1) Write a method called repeatIt() that returns a String. It will take a String argument inStr and an int argument, n. The method will return a String with each odd character in inStr repeated n times. Use at least 2 test cases including "foobar". (15 pts) My solution is around 15 lines Use these 3 test cases system.out.println (repeatIt("Foobar",3)) System.out printin(repeatIt("happy day",5)) System.out.print.in(repeatIt("I love icecream!", 2)) Sample Output: Output for foobar and n 3: Poooobaaaar Output for "happy day and n5ppppppyyyyy ddddddayyyyy I love icecream and n 2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
