Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%--
- Document : controleHotel
- Created on : 06/09/2016, 21:17:41
- Author : aluno
- --%>
- <%
- String qtd = request.getParameter("qtdDias");
- int quant = 0;
- double conta = 0;
- try{
- quant = Integer.parseInt(qtd);
- for(int i = 1; i <=quant; i++){
- conta = conta + (double)100/i;
- }
- } catch(NumberFormatException erro){
- quant = 0;
- conta = 0;
- }
- session.setAttribute("conta", conta);
- response.sendRedirect("mostradorHotel.jsp");
- %>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement