Calculadora_Juros_Simples_Compostos.io-956bee763ee997b72ebb04d560240445164c12c7/ATV05/src/java/Servlets/JurosSimplesServelt.java
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        response.setContentType("text/html;charset=UTF-8");
        try (PrintWriter out = response.getWriter()) {
            /* TODO output your page here. You may use following sample code. */
            
            String Cap = request.getParameter("value1");
           int c = Integer.parseInt(Cap);
           
           String Jr = request.getParameter("porcent1");
           float j = Integer.parseInt(Jr);
           
            String Dt = request.getParameter("date1");
           int D = Integer.parseInt(Dt);
            
            out.println("<!DOCTYPE html>");
            out.println("<html>");
            out.println("<head>");
            out.println("<title> Juros Simples</title>");
            out.println(" <h2>Lorena Vitória Moraes de Carvalho RA: 1290482023021 </h2>\n" + "<br>");
            
            out.println("</head>");
            out.println("<body>");
            
            DecimalFormat deci = new DecimalFormat("0.00");
            
            double Pc = j / 100; 
            
            double Vg = (c * Pc) * D;
           
            double Vf = Vg + c;
           
            out.println("Capital Inicial: R$");
            out.println(deci.format(c));
            
            out.println("<br>");
            
            out.println("Juros: ");
            out.println(deci.format(j));
            out.println("%");
            
            out.println("<br>");
            
            out.println("Meses: ");
            out.println(D);
            
            out.println("<br><br>");
             
            out.println("Valor Ganho: R$");
            out.println(deci.format(Vg));
            
            out.println("<br>");
            
            out.println("Valor  futuro: R$");
            out.println(deci.format(Vf));
          
            out.println("</body>");
            out.println("</html> </br></br>");
            out.println("<a href='index.html'>Voltar</a>");
        }
        
    }
/**
     * Processes requests for both HTTP <code>GET</code> and <code>POST</code>
     * methods.
     *
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
Processes requests for both HTTP GET and POST
methods.

@param request servlet request
@param response servlet response
@throws ServletException if a servlet-specific error occurs
@throws IOException if an I/O error occurs
Processes requests for both HTTP GET and POST methods . @param request servlet request @param response servlet response @throws ServletException if a servlet - specific error occurs @throws IOException if an I / O error occurs
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        response.setContentType("text/html;charset=UTF-8");
        try (PrintWriter out = response.getWriter()) {
            /* TODO output your page here. You may use following sample code. */
            String Cap = request.getParameter("value1");
           int c = Integer.parseInt(Cap);
           String Jr = request.getParameter("porcent1");
           float j = Integer.parseInt(Jr);
            String Dt = request.getParameter("date1");
           int D = Integer.parseInt(Dt);
            out.println("<!DOCTYPE html>");
            out.println("<html>");
            out.println("<head>");
            out.println("<title> Juros Simples</title>");
            out.println(" <h2>Lorena Vitória Moraes de Carvalho RA: 1290482023021 </h2>\n" + "<br>");
            out.println("</head>");
            out.println("<body>");
            DecimalFormat deci = new DecimalFormat("0.00");
            double Pc = j / 100; 
            double Vg = (c * Pc) * D;
            double Vf = Vg + c;
            out.println("Capital Inicial: R$");
            out.println(deci.format(c));
            out.println("<br>");
            out.println("Juros: ");
            out.println(deci.format(j));
            out.println("%");
            out.println("<br>");
            out.println("Meses: ");
            out.println(D);
            out.println("<br><br>");
            out.println("Valor Ganho: R$");
            out.println(deci.format(Vg));
            out.println("<br>");
            out.println("Valor  futuro: R$");
            out.println(deci.format(Vf));
            out.println("</body>");
            out.println("</html> </br></br>");
            out.println("<a href='index.html'>Voltar</a>");
        }
    }
protected void processRequest ( HttpServletRequest request , HttpServletResponse response ) throws ServletException , IOException { response . setContentType ( "text/html;charset=UTF-8" ) ; try ( PrintWriter out = response . getWriter ( ) ) { /* TODO output your page here. You may use following sample code. */ String Cap = request . getParameter ( "value1" ) ; int c = Integer . parseInt ( Cap ) ; String Jr = request . getParameter ( "porcent1" ) ; float j = Integer . parseInt ( Jr ) ; String Dt = request . getParameter ( "date1" ) ; int D = Integer . parseInt ( Dt ) ; out . println ( "<!DOCTYPE html>" ) ; out . println ( "<html>" ) ; out . println ( "<head>" ) ; out . println ( "<title> Juros Simples</title>" ) ; out . println ( " <h2>Lorena Vitória Moraes de Carvalho RA: 1290482023021 </h2>\n"  <br>") ; out . println ( "</head>" ) ; out . println ( "<body>" ) ; DecimalFormat deci = new DecimalFormat ( "0.00" ) ; double Pc = j / 100 ; double Vg = ( c * Pc ) * D ; double Vf = Vg + c ; out . println ( "Capital Inicial: R$" ) ; out . println ( deci . format ( c ) ) ; out . println ( "<br>" ) ; out . println ( "Juros: " ) ; out . println ( deci . format ( j ) ) ; out . println ( "%" ) ; out . println ( "<br>" ) ; out . println ( "Meses: " ) ; out . println ( D ) ; out . println ( "<br><br>" ) ; out . println ( "Valor Ganho: R$" ) ; out . println ( deci . format ( Vg ) ) ; out . println ( "<br>" ) ; out . println ( "Valor  futuro: R$" ) ; out . println ( deci . format ( Vf ) ) ; out . println ( "</body>" ) ; out . println ( "</html> </br></br>" ) ; out . println ( "<a href='index.html'>Voltar</a>" ) ; } }
Processes requests for both HTTP <code>GET</code> and <code>POST</code>
 methods.
Processes requests for both HTTP <code > GET< / code > and <code > POST< / code > methods .