140,531 views
30 votes
30 votes
CODEHS PLEASE HELP ME(check attached pic)

CODEHS PLEASE HELP ME(check attached pic)-example-1
User David Spenard
by
3.1k points

1 Answer

20 votes
20 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 Montiniz
by
3.1k points