Duvidas calculadora JSP e Servlets em MVC para web

0 respostas
G

Bom galera

preciso implementar uma calculadora que tenha operções basicas e fatorial e exponencial tambem

e tenha 5 memorias de calculos ...

comecei com interface em um html vejam mas os botoes não consigo adicionar no input (visor da calculadora).... e também não sei como fazer para chamar uma função do tipo soma com o botão "+" por exemplo....
<table style="width: 721px">
</table><center><form action="Soma" method="get" style="width: 261px; height: 88px"><input 
type=text name ="valores" style="width: 103px; height: 24px"size =10><input
type="submit" name="botaoC" value= "C" style="height: 31px;width: 37px"><input
type="submit" name="botaoCE"value= "CE"style="height: 31px;width: 37px"><br><input
type="submit" name="botaoM1" value= "M1" style="height: 31px;width: 37px"><input
type="submit" name="botaoM2" value= "M2" style="height: 31px;width: 37px"><input
type="submit" name= "botaoM3" value= "M3" style="height: 31px;width: 37px"><input
type="submit" name="botaoM4" value= "M4" style="height: 31px;width: 37px"><input
type="submit" name= "botaoM5" value= "M5" style="height: 31px;width: 37px"><br><input
type="submit" name ="botao7" value= "7" style="height: 31px;width: 37px"><input
type="submit" name="botao8" value= "8" style="height: 31px;width: 37px"><input
type="submit" name ="botao9" value= "9" style="height: 31px;width: 37px"><input
type="submit" name ="divisao" value= " / "style="height: 31px;width: 37px"><input
type="submit" name="exponencial" value= "Exp" style="height: 31px;width: 37px"><br><input
type="submit" name="botao4" value= "4" style="height: 31px;width: 37px"><input
type="submit" name="botao5" value= "5" style="height: 31px;width: 37px"><input
type="submit" name ="botao6" value= "6" style="height: 31px;width: 37px"><input
type="submit" name="multiplicacao" value= " * "style="height: 31px;width: 37px"><input
type="submit" name="fatorial" value= "Fat "style="height: 31px;width: 37px"><br><input
type="submit" name="botao1" value= "1" style="height: 31px;width: 37px"><input
type="submit" name="botao2" value= "2" style="height: 31px;width: 37px"><input
type="submit" name="botao3" value= "3" style=" height: 31px;width: 37px"><input
type="submit" name="soma" value= " + " style="height: 31px;width: 37px"><input
 type="submit" name="subtracao" value="   -  " style="height: 31px;width: 37px"><br><input
type="submit" name="botao0" value= "0" style ="height: 31px; width: 37px"><input
type="submit" name="botaoponto" value= "." style ="height: 31px; width: 37px"><input 
type="submit" name="botao00" value="00" style="   height: 31px; width: 37px"/><input 
type="submit" name="resultado" value=" = " style="height: 31px; width: 74px"><br></form>
</center>
</form>

Bom não consigo fazer com que essa calculadora tenha funcionalidade nenhuma........
eu queria que ao usuario apertar o botao 1 ele apareça na telinha por exemplo.... alguma dica ????

e tb queria que o usuario apertasse o sinal de "+" ela chamaria uma função Soma dentro de uma classe calcular por exemplo
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!Obrigado

Criado 14 de julho de 2010
Respostas 0
Participantes 1