2 Temmuz 2011 Cumartesi, 16:47
2570
Asp'de (active server pages) ikinci dereceden bir bilinmeyenli bir denklemin köklerini bulacağız
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>2. Dereceden 1 Bilinmeyenli Denklemlerde Kök Bulmak</title>
</head>
<body>
<%
islem = Request.QueryString("islem")
If islem = "" Then
%>
<form method="post" action="?islem=hesapla" />
A : <input type="text" name="a" />
<br />
B : <input type="text" name="b" />
<br />
C : <input type="text" name="c" />
<br />
<input type="submit" value="Hesapla" />
</form>
<%
ElseIf islem = "hesapla" Then
a = Request.Form("a")
b = Request.Form("b")
c = Request.Form("c")
If IsNumeric(a) AND IsNumeric(b) AND IsNumeric(c) Then
delta = b*b - 4*a*c
If delta < 0 Then
Response.Write "Gerçel kökü yoktur.<br /><a href=""?islem="">Yeni Hesap</a>"
Else
kokdelta = sqr(delta)
birincikok = (-b - kokdelta)/2*a
ikincikok = (-b + kokdelta)/2*a
Response.Write "X<sub>1</sub> : "&birincikok&""
Response.Write "<br /> X<sub>2</sub> : "&ikincikok&"<br /><a href=""?islem="">Yeni Hesap</a> "
End If
Else
Response.Write "Değişkenlere sayısal değerler giriniz."
Response.Write "<br /><a href=""?islem="">Yeni Hesap</a>""
End If
End If
%>
</body>
</html>