what do you wish to calculate:
area perimeter
enter values ______ submit<----button
the page allows the user calculate area or perimeter of a parallelogram. First user will select an option, then enters necessary parameters separated by comma. write a JavaScript function called shapeFormulas(0 to calculate and display area or perimeter in an alert.
the function should display an error if user does not follow the required input format.
Area : base x height
perimeter : 2 x (side1+side2)
example one
user select area
input:5,10
output: the area is : 50
example two
user select perimeter
input:5,10
output:the perimeter is:30
example three
user select Area
input: 2 3
output: Invalid parameters
Comments
Leave a comment