subject

TASK: Write a static method called repeatString that takes as input a String parameter word followed by an int parameter num. It should return a String that would be the result of repeating word exactly num times. If num is 0 or negative, the method should output an empty string. HINT: Don't print out anything! Your method should return a string, not print it. print the output of your method behind the scenes to check that your method returns the right string; if you add your own print statements then the output won't be correct.

HINT: Make use of String concatenation!

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 24.06.2019 10:00
Which two technologies support the building of single-page applications?
Answers: 2
question
Computers and Technology, 25.06.2019 08:30
Which of the following terms is described as “the art and design of using text”? a. typography b. elements of design c. typos d. graphic design
Answers: 1
question
Computers and Technology, 25.06.2019 15:30
What does a file extension tell you? a. what the file is about b. where the file is located c. what type of file it is d. who created the file
Answers: 1
question
Computers and Technology, 25.06.2019 21:30
What are the functions of system software
Answers: 1
You know the right answer?
TASK: Write a static method called repeatString that takes as input a String parameter word followed...
Questions
question
Mathematics, 06.11.2020 22:00
question
Business, 06.11.2020 22:00
question
Mathematics, 06.11.2020 22:00
question
Mathematics, 06.11.2020 22:00
question
Health, 06.11.2020 22:00
Questions on the website: 13722363