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

Code Java please  Code Java please Page 4 1) Write a method called repeatIt()

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!