Finish the method named getRow
that takes in one parameter:
width
: an integer that specifies the width.
The function should return a String
representation of a row of asterisks whose length is equal to the width
specified.
getRow(10)
should return"**********"
.
{Try It!}(.guides/getRow//try-it-01.js)
getRow(5)
should return"*****"
.
node .guides/secure/getRowTest.js
Finish the method named getSmallTriangle
that returns a String
representation of a small triangle, whose base height and base width is 4 asterisks.
getSmallTriangle()
should return:
*
**
***
****
{Try It!}(.guides/getSmallTriangle/try-it-01.js)
node .guides/secure/getSmallTriangleTest.js
Finish the method named getLargeTriangle
that returns a String
representation of a large triangle, whose base height and base width is 10 asterisks.
getLargeTriangle()
should return:
*
**
***
****
*****
******
*******
********
*********
**********
{Try It!}(.guides/getLargeTriangle/try-it-01.js)
node .guides/secure/getLargeTriangleTest.js
Finish the method named getTriangle
that takes in one parameter:
n
: an integer that specifies the number of rows.
The function should return a String
representation of a triangle whose base height and width is equal to n
.
getTriangle(15)
should return:
*
**
***
****
*****
******
*******
********
*********
**********
***********
************
*************
**************
***************
{Try It!}(.guides/getTriangle/try-it-01.js)
getTriangle(5)
should return:
*
**
***
****
*****
{Try It!}(.guides/getTriangle/try-it-02.js)