bulbs java Diploma Project Work

bulbs java Diploma Project Work

<———–bulbs.java———–>

 

import  javax.servlet.*;

import  javax.servlet.http.*;

import  java.util.*;

import  java.io.*;

public class Bulbs extends HttpServlet

{

public void doGet(HttpServletRequest  request, HttpServletResponse  response)throws IOEexception

{

String name=request.getParameter(“name”);

String[] items=request.getParameterValues(“bulbs”);

String payment=request.getParameter(“payment”);

Double cost=0.0;

for(String str:items)

{

cost=cost+Double.parseDouble(str);

}

Double vat=0.135*cost;

Double tc=cost+vat;

response.setContentType(“text/html”);

PrintWriter out=response.getWriter();

out.println(“<html><head><title>test</title></head>”);

out.println(“<body><p>”);

out.println(“your name is:”+name);

out.println(“</br>total cost:”+tc);

out.println(“</br>payment method:”+payment);

out.println(“</p></body>”);

out.println(“</html>);

}

}

258 total views, 1 views today

Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by wp-copyrightpro.com