JSFiddle - React, Tailwind, and code Playground

by Ryan Kleinhans

JavaScript

var wood
var drawers
var length
var width
var surface
var total

wood = prompt("(M)ahogany, (O)ak, or (P)ine")
width = parseFloat(prompt("What is the width"))
length = parseFloat(prompt("What is the length"))
drawers = parseFloat(prompt("How many drawers do you want?"))
total = 200
surface = length * width

if (surface > 750)
{
total = total + 50
}

if (wood == "M")
{
total = total + 150
}

else if (wood == "O")
{
total = total + 125
}

else (wood == "P")
{
total = total
}

total = total + (drawers * 30)

alert ("Length: " + length + "\nWidth: " + width + "\nWood: " + wood + "\nDrawers: " + drawers + "\nPrice: " + total)