Professional Documents
Culture Documents
Examen de Java Scritp Wilian Valera
Examen de Java Scritp Wilian Valera
<head>
<title></title>
<script type="text/javascript">
function preenche(valor)
{
var elemento=document.getElementById("campo1");
var value=elemento.value;
elemento.value=value+valor;
function preenche2(valor)
{
var elemento=document.getElementById("campo2");
var value=elemento.value;
elemento.value=value+valor;
function Lasuma()
{
n1 = parseInt(document.getElementById("campo1").value);
n2 = parseInt(document.getElementById("campo2").value);
document.getElementById("suma").value=n1+n2;
}
function Laresta()
{
n1 = parseInt(document.getElementById("campo1").value);
n2 = parseInt(document.getElementById("campo2").value);
document.getElementById("resta").value=n1-n2;
}
</script>
</head>
<body background=#cccc>
<form >
<input type="text" id="campo1" name="campo1">
<input type="button" id="0" value="0" onclick="preenche(this.value);"/>
<input type="button" id="1" value="1" onclick="preenche(this.value);"/>
<input type="button" id="2" value="2" onclick="preenche(this.value);"/>
<input type="button" id="3" value="3" onclick="preenche(this.value);"/>
<input type="button" id="4" value="4" onclick="preenche(this.value);"/>
<input type="button" id="5" value="5" onclick="preenche(this.value);"/>
<input type="radio" name="1" id="campo1" onclick= />
</form>
<br>
<form>
<input type="text" id="campo2" name="campo2">
<input type="button" id="6" value="6" onclick="preenche2(this.value);"/>
<input type="button" id="7" value="7" onclick="preenche2(this.value);"/>
<input type="button" id="8" value="8" onclick="preenche2(this.value);"/>
<input type="button" id="9" value="9" onclick="preenche2(this.value);"/>
<input type="button" id="0" value="0" onclick="preenche2(this.value);"/>
<input type="radio" name="2" id="campo2" onclick=>
</form>
<br>
<br>Suma
<input type="checkbox" name="suma" onclick="Lasuma()"><input type="text" id="suma"
name="suma">
<br>
<br>Resta
<input type="checkbox" name="resta" onclick="Laresta()"><input type="text"
id="resta" name="resta">
<br>
<br>
<input type="checkbox" name="Par"> N*Par
<br>
<input type="checkbox" name="primo"> N*Primo
<br>
<input type="checkbox" name="resta"> factorial <input type="text" name="factorial">
<br>
<input type="button" value="calcular" onclick="">
</form>
</body>
</html>