Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals Design And Implementation

Authors: KROENKE DAVID M.

1st Edition

8120322258, 978-8120322257

More Books

Students also viewed these Databases questions

Question

3. Describe the communicative power of group affiliations

Answered: 1 week ago