science

posted by .

Write a java program using classes and object to read the em[loyee code (Integer), Imployee name (string), Basic salary )double), Category (Character)then calculate the bonus(double)and the total salary(double)eligible for each employ. The output should have the employee code, employee name, basic salary, grade bonus and the total salary. The program must use switch-case construct for calculations. Test your program for 5 employees.

If the employee belong to
Grade A bonus=20% basic
Grade B bonus=15% basic
Grade C bonus=10% basic
Grade D bonus=7% basic
Grade E bonus=5% basic


Sample Output:
Employee code :1234
Employee Name :aaaa
Basic Salary :1000 $
Grade :A/B/C/D/E
Bonus :1111$
Total Salary : Basic salary + Bonus

  • science -

    suggested approach:
    create a class for each Employee, with class properties as
    integer code
    string name
    double salary
    char category
    double bonus
    double totalSalary

    with class methods called
    double calculateBonus()
    void printEmployee()

    Use switch-case to calculate bonus.
    Add bonus and salary to get totalSalary. Bonus is usually a percentage (see table given) of salary.

Respond to this Question

First Name
School Subject
Your Answer

Similar Questions

  1. Computer Programming

    I must write a program using Java that calculates the amount a person would earn over a period of time if his or her salary is one penny the first day, two pennies the second day, and continues to double each day. The program should …
  2. computers

    I have just started a basic class in programming and I am totally lost. Can someone help me out?
  3. computer science

    I need to see if someone can help me with a c# programming problem Create a class called employees that includes three pieces of information as either instance variables or automatic properties - a first name(type string), a last name …
  4. programming

    b. Write a well-commented C++ program that reads data from the input file employee.txt. Each input line consists of last name, first name, base salary, total sales, and number of years of service. Store the output in the file employees_payCheck.txt. …
  5. Java

    write a java program to read a record name, age, and salary. Calculate the tax amount on the salary field display the new record.
  6. BUSINESS IT

    firstly write a program to accept the number of telephone calls made by a customer and the print out the rate in cents. secondly define a structure employee with name, category , salary, tax as a member. read the name category and …
  7. programming

    write a program that creates a list of employees objects of size n entered from user using list interface and a list class implementation and display all employees in list and print employee name with minimum salary and remove employee …
  8. computer programming

    Write a C++ pogram for the following Employee Name and 12 months’ salary. Salary starts with $5000 per month and increments every month by 10% of previous month salary. At the end of the year, the employee is paid a 5% bonus on top …
  9. computer,science, java

    Inorder to motivate the employees, the company has decided to announce the different types of bonus depends up on the employee’s Grade. If the employee belong to Grade A bonus=20% basic Grade B bonus=15% basic Grade C bonus=10% basic …
  10. Programming

    Widget company runs a small factory that makes several types of nuts and bolts. They employ (a)1 (b)2 (c)3. Each factory worker can work a maximum of (a)40 hours normal working hours per week. All hours over 40 are paid as over-time …

More Similar Questions