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

asked by Hala
  1. 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.

    posted by MathMate

Respond to this Question

First Name

Your Answer

Similar Questions

  1. 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%

    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
  3. 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
  4. 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
  5. 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
  6. 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
  7. Java Computer Science

    Say I write an application that prompts the user to enter an integer. If the user enters a double or string or anything, anything not an integer an error will appear. I'm having trouble writing code to combat this problem so I can
  8. 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
  9. Visual Basic

    how to use formula b=p (1+r)^n, to calculate annual interests for a savings account in visual basic project This is my code so far>>>>>>>>>>>>>> Option Explicit On Option Strict On Option
  10. structure programming

    the gross salary of five employees in maendeleo books enterprise is based on basic salary and additional benefits as follows: a).employees who have worked for the company for more than 10 years receive an additional pay of 10%to

More Similar Questions