Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started