80.8k views
3 votes
CODEHS PLEASE HELP ME(check attached pic)

CODEHS PLEASE HELP ME(check attached pic)-example-1
User Gowtham S
by
6.8k points

1 Answer

5 votes

Answer:

JavaScript Notation (If it is not JavaScript, Comment on this problem and I will immediately change it.)

var width = prompt("Input width.")

var length = prompt("Input length.")

if (length === width) {

console.log(length*width , " is your area of the square.")

} else {

console.log(2*length*2*width , " is your perimeter of the rectangle.)

User Bumperbox
by
5.7k points