Write the function repeatString
that takes a String and an integer, and returns a String built by repeating the given String given number of times.
For example, one should be able to call
print(repeatString("*", 10));
and get
**********
as the output.
You can add to Strings together by:
String a = "Hello, ";
String b = "Alina";
print(a + b); // It'll print out "Hello, Alina"
Use the printString
function you wrote along with a for
loop to print out this 6x6 triangle:
*
**
***
****
*****
******
Use the printString
function you wrote along with a for
loop to print out this triangle:
*******
*****
***
*

part1