Solve two times equation (suitable for teaching site)

Source: Internet
Author: User
Site <title> Solving the solution of the two quadratic equation </title>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">

<body bgcolor= "#FFFFFF" >
<div align= "center" ><font color= "#FF0000" ><b> find out the solution of the two-time equation </b></font><b></b> </div>
<%
If Request.Form ("cal") = "Y" Then
A=trim (Request ("a"))
B=trim (Request ("B"))
C=trim (Request ("C"))
Mynum=b*b-4*a*c
%>
The equation you entered is:<%=a%>x<sup>2</sup>+<%=b%>x+<%=c%>=0<br>
<%
If A=0 then%>
This is not a two-time equation,
<%if b=0 then%>
You have entered a formula such as 0x<sup>2</sup>+0x+<%=c%>=0! <br>
<%if c=0 then%>
There are infinitely many solutions.
<%else%>
<font color=red> condition is not tenable! </font>
<%end if%>
<%else%>
Its solution is: x=<%=-(c/b)%><br>
<%end if%>

<%elseif mynum=0 then%>
It has two equal real roots. x=<%=-b/(2*a)%><br>
<%elseif mynum>0 then%>
It has two unequal real roots. <br>
X1=<%=formatnumber ((-B+SQR (Mynum))/(2*a),,-1)%><br>
X2=<%=formatnumber ((-B-SQR (Mynum))/(2*a),,-1)%><br>
<%else
Realpart=formatnumber (-b/(2*a), 4,-1)
Imagpart=formatnumber (SQR (-mynum)/(2*a), 4,-1)
%>
This equation has two complex roots:<br>
<%=realpart%>+<%=imagpart%>i<br>
<%=realpart%>-<%=imagpart%>i<br>
<%
End If
End If
%>

<form method= "POST" action= "try3.asp" >
Input equation Parameters:
<input type= "text" Name= "a" size= "5" >
x<sup>2</sup>+
<input type= "text" name= "B" size= "5" >
x+
<input type= "text" Name= "C" size= "5" >
=0
<input Type=hidden name=cal value=y>
<input type= "Submit" name= "Submission" value= "submitted" >
</form>
</body>



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.