I have just started with java script, but already, I have ran into some noob related issues. I am trying to make a simple program to solve for X in a quadratic equation. I have three prompts which ask for the variables of a, b, and c, and then it is supposed to use the quadratic formula to solve for X. However, whenever I try to run it, it will give me the prompts and then not do anything. Here is my script.
var A = prompt("what is variable a?")
var B = prompt("what is variable b?")
var C = prompt("what is variable c?")
var BA = math.pow(B,2)
var Answer1 = (4*A*C-1+BA)
var Answer2 = (2*A)
var Answer3 = (Answer1/Answer2)
Right now, it is just solving for the discriminant, and I was going to continue, but i got this error and was stuck. Could anyone tell me what I'm doing wrong? I'm just using notepad.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)