Question: In Javascript, Define function: printShape(shape, height, character) shape is a String and is either Square, Triangle, Diamond. height is a Number and is the height
In Javascript,
Define function: printShape(shape, height, character) shape is a String and is either "Square", "Triangle", "Diamond". height is a Number and is the height of the shape. Assume the number is odd. character is a String that represents the contents of the shape. Assume this String contains just one character. Use a switch statement to determine which shape was passed in. Use the console.log function to print the desired shape. Example for printShape("Square", 3, "%"); %%% %%% %%% Example for printShape("Triangle", 3, "$"); $ $$ $$$ Example for printShape("Diamond", 5, "*"); * *** ***** *** *
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
