Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 10g Database Administrator Implementation And Administration

Authors: Gavin Powell, Carol McCullough Dieter

2nd Edition

1418836656, 9781418836658

More Books

Students also viewed these Databases questions