Quadratic Solver

Developer
Size
2,091 Kb
Views
12,144

How do I make an quadratic solver?

What is a quadratic solver? How do you make a quadratic solver? This script and codes were developed by Tejas on 14 January 2023, Saturday.

Quadratic Solver Previews

Quadratic Solver - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Quadratic Solver</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <!DOCTYPE html>
<html> <head> <title>Quadratic Equation Solver</title> <meta charset="utf-8"/> </head> <body onload="init();"> <h2> Quadratic Equation Root Solver</h2> <section id="coeffInput">	<label for="a">a: </label> value: <input type=number id="a" value=0 step=0.1 > <p></p> <label for="b">b: </label> value: <input type=number id="b" value=0 step=0.1 > <p></p> <label for="c">c: </label> value: <input type=number id="c" value=0 step=0.1 > <p></p> <button onclick="solve()"> Solve ax^2+bx+c=0</button> </section> <section> <label> Root 1: </label> <div id="answer1"> </div> <label> Root 2: </label> <div id="answer2"> </div> </section> </body>
</html> <script src="js/index.js"></script>
</body>
</html>

Quadratic Solver - Script Codes CSS Codes

h2{ margin: 2%
}
section{ border: 4px solid blue; border-radius: 7px; width: 300px; margin: 1%; padding: 20px; float: left; height: 120px; width: 270px; box-shadow: 5px 10px 19px
}
button{ color: black; width: 260px; border: 2px solid blue; border-radius: 5px;
}
#answer1{ width: 300px; background-color: pink;
}

Quadratic Solver - Script Codes JS Codes

var answer1,answer2;
function init() { console.log("page loaded and DOM is ready"); var answer1=document.querySelector('#answer1'); var answer2=document.querySelector('#answer2');
}
function solve(){ var a=document.querySelector('#a'); var b=document.querySelector('#b'); var c=document.querySelector('#c'); var answer1=document.querySelector('#answer1'); var answer2=document.querySelector('#answer2'); var root1=((-1*b.value)+Math.sqrt(b.value*b.value-4*a.value*c.value))/(2*a.value); var root2=((-1*b.value)-Math.sqrt(b.value*b.value-4*a.value*c.value))/(2*a.value); answer1.innerHTML=root1; answer2.innerHTML=root2;
}
Quadratic Solver - Script Codes
Quadratic Solver - Script Codes
Home Page Home
Developer Tejas
Username tkj516
Uploaded January 14, 2023
Rating 3
Size 2,091 Kb
Views 12,144
Do you need developer help for Quadratic Solver?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Tejas (tkj516) Script Codes
Name
Handlers and Events
MIT edx Project
Create amazing blog posts with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!