Skip to content

code-differently/core-js-algos-hellaLoops02

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Problem 01

Problem Statement

Finish the method named getRow that takes in one parameter:

  1. 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.

Example:

  • getRow(10) should return "**********".

{Try It!}(.guides/getRow//try-it-01.js)

  • getRow(5) should return "*****".

{Try It!}(.guides/getRow/try-it-02.js)

Solution

node .guides/secure/getRowTest.js

Problem 02

Problem Statement

Finish the method named getSmallTriangle that returns a String representation of a small triangle, whose base height and base width is 4 asterisks.

Example:

getSmallTriangle() should return:

*
**
***
****

{Try It!}(.guides/getSmallTriangle/try-it-01.js)

Solution

node .guides/secure/getSmallTriangleTest.js


Problem 03

Problem Statement

Finish the method named getLargeTriangle that returns a String representation of a large triangle, whose base height and base width is 10 asterisks.

Example:

getLargeTriangle() should return:

*
**
***
****
*****
******
*******
********
*********
**********

{Try It!}(.guides/getLargeTriangle/try-it-01.js)

Solution

node .guides/secure/getLargeTriangleTest.js


Problem 04

Problem Statement

Finish the method named getTriangle that takes in one parameter:

  1. 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.

Example:

  • getTriangle(15) should return:
*
**
***
****
*****
******
*******
********
*********
**********
***********
************
*************
**************
***************

{Try It!}(.guides/getTriangle/try-it-01.js)

  • getTriangle(5) should return:
*
**
***
****
*****

{Try It!}(.guides/getTriangle/try-it-02.js)

Solution

node .guides/secure/getTriangleTest.js

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published