Quadratic Solver
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 - 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;
}
Developer | Tejas |
Username | tkj516 |
Uploaded | January 14, 2023 |
Rating | 3 |
Size | 2,091 Kb |
Views | 12,144 |
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!
Name | Size |
Handlers and Events | 1,954 Kb |
MIT edx Project | 3,081 Kb |
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!
Name | Username | Size |
VerbalExpressions Converter | Cmalven | 2,607 Kb |
Boom | Mhrjnsa1 | 1,794 Kb |
404 Page | Saransh | 2,666 Kb |
AngularJS Datalist Directive | M-e-conroy | 2,366 Kb |
Page Transitions in Backbone | Mikefowler | 3,691 Kb |
CSS Chat Bubbles | Boylett | 2,094 Kb |
Button Option Group | Honchoman | 1,859 Kb |
Materializecss input form | Jasonchan | 1,443 Kb |
Shopping cart | Andiio | 6,581 Kb |
Simple, flat contact form | Zeaklous | 2,719 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!