Question 4
Abc Ltd. Company announces an increment in the basic salary of their employees based on
the seniority of age as per the following:
Increment
Age
up to 45 years
10% of basic
above 45 and below 56 years 15% of basic
56 years and above
20% of basic
Write a program in Java with the following details:
Class name
: Increment
Data members:
int ecode
to store the employee code
int age
: to store age of the employee
double basic
to store basic pay of the employee
double increment to calculate and store the incremented amount.
Member methods:
void calculate()
to calculate the increment as per the criteria given above
oid accept (int e, double b, int a) : to input employee code, basic salary and age
and to update the basic
void display
to display the value of data members.
Write a main method to create an object of the class and call the above member methods.
Answers
Latest Update on 7th Pay Commission!
1. In a move that will benefit over 1.1 crore central government employees and pensioners, the Centre has hiked the Dearness Allowance by 3 per cent to 12 per cent. The previous DA hike was in August last year when the government had increased it to 9 per cent from 7 per cent.
2. Since the hike comes into effect retrospectively from January 1, the employees will also get arrear for the month of January. Now, the central government employees and pensioner will get Dearness Allowances at the rate of 12 per cent.
3. In a decision that will benefit thousands of academicians, Bihar CM Nitish Kumar has announced to give 7th pay commission salaries to madrassa teachers of the state.
4. The Ministry of Railways has also decided to constitute a Committee for the inclusion of fresh categories within the ambit of Risk and Hardship Allowance. The main function of the committee will be ‘To holistically examine the inclusion of fresh categories within the ambit of Risk and Hardship Allowance introduced by 7th CPC’.
5. To bring the uniformity in the retirement age, the ministry will be increasing the retirement age for the constable to commandant (senior superintendent of police) to 60 years from the present 57 years.
Once the recommendations of the 7th Pa
Answer:
import java.util.Scanner;
class IncrementCalculation
{
public static void main (String[] args)
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter the salary");
int sal=sc.nextInt();
System.out.println("Enter the Performance appraisal rating");
float rat=sc.nextFloat();
if(sal<=0 || rat<1 || rat>6)
{
System.out.println("Invalid Input");
}
else
{
if(rat>=1 && rat<=3)
{
int inc=sal+(sal*10/100);
System.out.println(inc);
}
else if(rat>3 && rat<=4)
{
int inc=sal+(sal*25/100);
System.out.println(inc);
}
else if(rat>4 && rat<=5)
{
int inc=sal+(sal*30/100);
System.out.println(inc);
}
}
}
}
Explanation: