Question: Write a program that prompts the user using JavaScript prompt() e for the width and height of a rectangle and then displays the area, and

 Write a program that prompts the user using JavaScript prompt() e

Write a program that prompts the user using JavaScript prompt() e for the width and height of a rectangle and then displays the area, and the perimeter. Below is an example of using prompt(): let name = prompt("Enter your name:"); The prompt() function returns a string value, even if you enter a number, so you will need to convert the string input value using parseFloat() e. You will use the and getPerimeter() functions from letter-2.js. Create a new function getArea(width, height) that returns the rectangle area. Create a new function displayOutput(width, height) that displays the required output using console.log(). Output specification: width = 3 height = 4 area = 12 perimeter = 14

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!