Faire une calcultrice (Useless)
2 participants
Page 1 sur 1
Faire une calcultrice (Useless)
- Code:
<script>
function calcul ()
{
var x=document.one.txt.value
var y=eval(x)
if (document.one.txt.value)
{
document.one.txt.value=y
}
}
</script>
<script>
function nombre (i)
{
var nb=new Array ("0","1","2","3","4","5","6","7","8","9","10")
var x=document.one.txt.value
document.one.txt.value=""+x+""+nb[i]+""
}
</script>
<script>
function signe (i)
{
var sg=new Array ("/","*","-","+")
var x=document.one.txt.value
document.one.txt.value=""+x+""+sg[i]+""
}
</script>
<script>
function efface ()
{
var x=document.one.txt.value
if (document.one.txt.value)
{
document.one.txt.value=""
}
}
</script>
<script>
function carre ()
{
var x=document.one.txt.value
if (document.one.txt.value)
{
document.one.txt.value=x*x
}
}
</script>
<script>
function inverse ()
{
var x=document.one.txt.value
if (document.one.txt.value)
{
document.one.txt.value=1/x
}
}
</script>
<script>
function cube ()
{
var x=document.one.txt.value
if (document.one.txt.value)
{
document.one.txt.value=x*x*x
}
}
</script>
<form>
<table width="196" height="175" border="0" bgcolor="#CCCCCC">
<tr>
<th height="43" colspan="3" scope="col"><input size="25" /></th>
</tr>
<tr>
<th width="38" height="74" scope="row"><input value="x3" />
<input value="x2" />
<input value="x -1" /></th>
<td width="99"><p align="center">
<input value=" 0 " />
<input value=" 1 " />
<input value=" 2 " /><input value=" 3 " />
<input value=" 4 " />
<input value=" 5 " /><input value=" 6 " />
<input value=" 7 " />
<input value=" 8 " />
<input value=" 9 " />
<input value=" 10 " />
</p> </td>
<td width="45"><p align="center">
<input value=" + " />
<input value=" - " />
<input value=" ÷ " />
<input value=" x " />
</p> </td>
</tr>
<tr>
<th height="26" colspan="3" scope="row"><p align="right">
<input value=" Supprimé " />
<input value=" = " />
</p></th>
</tr>
</table>
Vraiment useless vu qu'il y a la calculatrice Windows xD
Enregistré en .html
Sebastien- Mario
- Messages : 52
Date d'inscription : 05/09/2014
Age : 24
Localisation : France
Re: Faire une calcultrice (Useless)
Je regarderai
chrismi- Admin
- Messages : 149
Date d'inscription : 04/09/2014
Age : 27
Localisation : Je sais plus...attend je vais voir !
Page 1 sur 1
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum
|
|