Share on Google+Share on Google+
1 Answer(s)      5 years and 4 months ago
Posted in : Java Beginners
  1. Assume 30 days in a month.

  2. Tax Rate for contractors is 10%

  3. For Salaried employees:

a. DA - 75% of Basic salary.

b. HRA - 20% of Basic Salary

c. Medical - 1250 per month.

d. HRA and Medical is Tax Exempt.

e. Tax Rates are (which are to be applied marginally to each bracket):

The candidate should write Java code, so as to: 1. Compute Gross Monthly Salary for all employees

  1. Calculate Tax

  2. Calculate Net Monthly Salary

  3. Store back this data in the correct place

View Answers

June 15, 2012 at 5:48 PM

The given code calculates the employees gross monthly salary, tax, net monthly salary.

import java.util.*;
import java.text.*;

class CalculateSalary 
    public static void main(String[] args){
        Scanner input=new Scanner(;
        System.out.print("Enter Basic: ");
        double basic=input.nextDouble();
        System.out.print("Enter Tax(%): ");
        double tax=input.nextDouble();

        double tda=basic*.75;
        double thra=basic*.20;
        int medical=1250;
        double grosssalary=tda+thra+basic+medical;
        System.out.println("Gross Salary: "+grosssalary);
        double taxpaid=tax/100;
        double t=taxpaid * grosssalary;
        System.out.println("Tax to be paid is: "+t);
        double netsalary=grosssalary-t;
        System.out.println("Net Salary: "+netsalary);
        DecimalFormat df=new DecimalFormat("##.##");


Related Tutorials/Questions & Answers:
project  i need a project in java backend sql
PROJECT  i want online polling system project codding
project  suggest a network security project based on core java with explanation
project  sir i want a java major project in railway reservation plz help me and give a project source code with entire validation thank you
project  does hostel management system project contain any dynamic web pages
project  sir i want module and source code on my project hospital management system
PROJECT  i want help on making project on mobile banking application..... the application should have SAVING ACCOUNT,CURRENT ACCOUNT,TRANSACTION ETC......... IN APPLICATION
project  i have to do my final year project project topic:Weekly Automatic College Timetable Generation System BRIEF EXPLANATION ABOUT PROJECT This project takes various inputs from the user such as Teacher List, Course List
project  sir i want to a project on railway reservation,sir plz give me the source code   plz give me the source code of railway reservation
project   hi , we r working on one project related to our results. we using java and for back end sqlserver 2005. In dis we are trying to retrieve result from some site and store it in our data base so that we can perform
Project  Hi, Am starting a new project to draw a 2d graph using java swing and opengl,where in the input for X-axis and Y-axis co=ordinates should be accepted from user... As am very new to this am seeking help so pls help
project  For my project their is 2 users, one is users and administers.i want code for giving authentication to these users by using one, means same login form and database table back end is mysgl....and am using wamp sever
project..  Write a program to find the result of N students by accepting 5-subject marks from a Mark class and calculate the total and average mark. Display the result of all students in ascending order of rank from Result class
Project  <% String project no=request.getParameter("project no"); String qry="select stud name,project name,project type,project...(receipt dt,'dd/mm/yyyy') from proj master "; qry+=" where project
Project  How to show Questions randomly so that no two student get the same questions in online examination system project in Java Server Pages  
project...   enter 10 integers, store it using array then display them from highest to lowest. 2.enter 10 integers, store it using array then display them from lowest to highest number to words conversion create a java program
project  I'm designing a netbeans java program/project. I have to design a program that captures the persons name and mark #.then find the average mark of the whole class.after that need to count and display who had the highest
=(String) vdata.get(1); String project_name=(String) vdata.get(2); String project


Advertisement null