Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JSP-Servlet jsp code for employee payroll
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


pradeep
jsp code for employee payroll
1 Answer(s)      4 years and 9 months ago
Posted in : JSP-Servlet


jsp code for employee payroll. i need to generate the payslip with tax calucation and deductions,allwoance .how to calculate the employee tax using the jsp code

Advertisement
View Answers

April 13, 2010 at 1:13 PM


Hi Friend,

Try the following code:

1)employee.jsp:

<html>
<form name="form" method="post" action="payroll.jsp">
<table>
<tr><td>Employee Name:</td><td><input type="text" name="name">
<tr><td>Number of Hours worked in a Week:</td><td><input type="text" name="hours">
<tr><td>Hourly Rate:</td><td><input type="text" name="rate">
<tr><td>Enter federal tax withholding rate:</td><td><input type="text" name="federal"></td></tr>
<tr><td>Enter state tax withholding rate:</td><td><input type="text" name="state"></td></tr>
<tr><td><input type="submit" value="Submit">
</table>
</form>
</html>

2)payroll.jsp:

<%
String name=request.getParameter("name");
int hours=Integer.parseInt(request.getParameter("hours"));
double rate=Double.parseDouble(request.getParameter("rate"));
double federal=Double.parseDouble(request.getParameter("federal"));
double state=Double.parseDouble(request.getParameter("state"));
double grossPay= rate * hours;
double tax1=federal/100;
double federalTax= tax1 * grossPay;
double tax2=state/100;
double stateTax=tax2 * grossPay;
double deduction= federalTax + stateTax;
double netPay = (grossPay) - deduction;
%>
<html>
<table>
<tr><td>Employee Name:</td><td><input type="text" name="name" value="<%=name%>" disabled="disabled">
<tr><td>Number of Hours Worked:</td><td><input type="text" name="hours" value="<%=hours%>" disabled="disabled">
<tr><td>Hourly Rate:</td><td><input type="text" name="rate" value="<%=rate%>" disabled="disabled">
<tr><td>Enter federal tax withholding rate:</td><td><input type="text" name="federal" value="<%=federal%>" disabled="disabled"></td></tr>
<tr><td>Enter state tax withholding rate:</td><td><input type="text" name="state" value="<%=state%>" disabled="disabled"></td></tr>
<tr><td>Gross Pay:</td><td><input type="text" value="<%=grossPay%>" ></td></tr>
<tr><td>Total Deduction:</td><td><input type="text" value="<%=deduction%>" ></td></tr>
<tr><td>Net Pay (After Deductions):</td><td><input type="text" value="<%=netPay%>"></td></tr>
</table>
</html>

Hope that it will be helpful for you.
Thanks
Thanks


Related Tutorials/Questions & Answers:
jsp code for employee payroll - JSP-Servlet
jsp code for employee payroll  jsp code for employee payroll. i need... to calculate the employee tax using the jsp code  Hi Friend, Try the following code: 1)employee.jsp: Employee Name: Number of Hours worked
jsp code for employee attendance tracking system
jsp code for employee attendance tracking system  i need jsp code for employee attendance tracking system...it should contain date,login time,logout time,difference time in hour in separate fields..plz show the flow of detail
Advertisements
Employee Details - JSP-Servlet
Employee Details  Respected Sir/Madam, Thanks for your... else please provide me with some complete code as soon as possible bcoz i am... for specified operation. You can't write the code, which is written
how to calculate the employee tax - JSP-Servlet
how to calculate the employee tax  How to calculate the employee tax.Can u please send to me calculation tables
displaying employee records and their images problem - JSP-Servlet
displaying employee records and their images problem  hi, Thanks for your reply to my question. The code you sent to me yesterday was not working. it doesn't display any record and image. Please, help me out urgent
Payroll and Leave management system in java web application
Payroll and Leave management system in java web application  Hi Can any one help me with leave management and payroll management system sample source code. I need to develop as a web application(not any technology specification
retrive the employee details with image from mysql database using jsp servlet
retrive the employee details with image from mysql database using jsp servlet  im doing the web project to retrive the employee profile which i stored in the database using jsp servlet then want to show the result in the next jsp
web based java application for Leava and Payroll management system
web based java application for Leava and Payroll management system  Hello Team Good Morning, Can any one please help me with the source code for web based java application for Leava and Payroll management system. Thank you
HOW TO STORE MULTIPLE EMPLOYEE DETAILS TO XML FILE USING JSP?
HOW TO STORE MULTIPLE EMPLOYEE DETAILS TO XML FILE USING JSP?  HELLO SIR, CAN ANYONE HELP ME OUT HOW TO STORE MULTIPLE EMPLOYEE DETAILS TO XML FILES,IF I ENTER 4 EMPLOYEE DETAILS(NAME,ID,SALARY,EMAIL) ALL THE DETAILS OF 4
how to auto generate number in jsp with the database connection mysql for employee number?
how to auto generate number in jsp with the database connection mysql for employee number?  how to auto generate number in jsp with the database connection mysql for employee number?   <%@page import="java.sql.
how to auto generate number in jsp with the database connection mysql for employee number?
how to auto generate number in jsp with the database connection mysql for employee number?  how to auto generate number in jsp with the database connection mysql for employee number?   <%@page import="java.sql.
jsp code
jsp code  what are the jsp code for view page in online journal
employee records
employee records  Pl give one script like i will creat one table name... will enter New record and another form like emp_code query and update or delete and one report like details of employee thanks
employee records
employee records  Pl give one script like i will creat one table name... will enter New record and another form like emp_code query and update or delete and one report like details of employee thanks
employee records
employee records  Pl give one script like i will creat one table name... will enter New record and another form like emp_code query and update or delete and one report like details of employee thanks
Adding an employee
Adding an employee  coding for adding an employee
Add Employee
Add Employee  coding for adding an employee
application for an Employee
application for an Employee  hi , could any one help for coding in JSP-servlets.. the prob desc is : 1.INPUT:in the 1st page it should accept input...: in this page it should modify employee data and persist in DB 3.DISPLAY
JSP CODE
JSP CODE  what is the code for downloading images from database using JSP?   Please visit the following link: http://www.roseindia.net/jsp/downloadimage.shtml
jsp code
jsp code  hi i am Ruchi can anybody plz tell me the jsp code... visit the following links: http://www.roseindia.net/jsp/user-search.shtml http://www.roseindia.net/servlets/search.shtml www.roseindia.net/jsp/searchbook.shtml
Employee Salaries
Employee Salaries  Define a class Employee with the following properties. Every Employee has a name and a salary. The constructor creates an Employee... the salary of the Employee to zero. The method getinfo() will return the current
jsp code
jsp code  i want health management system project code using jsp.its urgent
EMPLOYEE - SQL
EMPLOYEE  CALCULATE EMPLOYEE SALARY  Hi friend, Please give the full details of Problem. Thanks
Employee form
Employee form  In employee form emp Id id after any data iserted is incremented for oher data insertion. insert, delete, update buttons when we cleak the select buttoun then the created table data iserted automaticaly
JSP CODE
JSP CODE  Please help me as soon as possible.Its Urgent. I am working on my college ALUMNI PORTAL. I want to have a ADD FRIEND option in a user's profile. Please send me code
employee progarm
employee progarm  Hai, I have developed a code for an employee program by using jtext fields and buttons,it has no errors but while we..." java.lang.NoClassDefFoundError: Emp/java".Why it is saying like this?The code which i developed
jsp code
jsp code  i want to jsp code which are working as,i have three drop down menu 1st menu for class second menu for subject and third menu as chapter... according to selectde menu,,,,please send me such type code,,,,plz help me
Employee Salaries
Employee Salaries  Define a class Employee with the following properties. Every Employee has a name and a salary. The constructor creates an Employee... the salary of the Employee to zero. The method getinfo() will return the current
Employee Salaries
Employee Salaries  Define a class Employee with the following properties. Every Employee has a name and a salary. The constructor creates an Employee... the salary of the Employee to zero. The method getinfo() will return the current
Employee Salaries
Employee Salaries  Define a class Employee with the following properties. Every Employee has a name and a salary. The constructor creates an Employee... the salary of the Employee to zero. The method getinfo() will return the current
Employee Salaries
Employee Salaries  Define a class Employee with the following properties. Every Employee has a name and a salary. The constructor creates an Employee... the salary of the Employee to zero. The method getinfo() will return the current
 

 

 

DMCA.com