Computer Science, asked by sidd1307, 2 months ago

JAVA:
Q). The basic salary of employees is undergoing a revision. Define a class called GradeRevision with the following specifications:Instance variables / data members:String name: to store name of the employeeInt bas to store basic salaryInt expn : to consider the length of service as an experienceDouble inc: to store incrementDouble nbas: to store new basic salary (basic + increment)Member Methods:Grade_Revision (): constructor to initialize all data membersVoid accept(): to input name, basic and experienceVoid increment (): to calculate increment with the following specifications:ExperienceUp to 3 years3 years or more and up to 5 years5 years or more and up to 10 years10 years or moreIncrementRs. 1000 + 10% of basicRs. 3000 + 12 % of basicRs. 5000 + 15 % of basicRs. 8000 + 20 % of basicVoid display(): to print all the details of an employee.Write the main method to create an object of the class and call all the member methods.​

Answers

Answered by iccadarsh
0

Answer:

I don't know

Explanation:

hdkkdbkdhxhoxhcvvvvxgxhhxvxhkxlajhxkxhxixobdocboxbpchxoldpcjvskodvsk

ogyuujjioolhieoeieiudufuufufuuf are receiving rurhtu fry it so I know aapki life me koi n fr b n h aap waise b n h aap waise b aapka kafi hai ki baat aap aaj tak aayega jab Fair copy of the following is a presentation on the to do it so happened that meet your needs and inspiring us always be used to the to do the needful and intelligent friends and family ke samne kh rhe hai dimag kharab h bye ye ye year old e kya hai na tu hi n aa raha hu aur meri sarir upor theke ek baar maine kha isiliye wo bhi apne n kiya hai you are yaar abhi bhi n h na aapko bhi n h ab to mere liye bht jyda drd kr rha

Answered by pritharoychowdhury09
4

Answer:

import java.util.*;

public class Grade_Revision

{

 private String name;

 private int bas;

 private int expn;

 private double inc;

 private double nbas;

 

 public Grade_Revision(String n,int b,int ex,double in,double nb)

 {

  name="";

  bas=0;

  expn=0;

  inc=0.0;

  nbas=0.0;

 }

 //input name, basic and experience

 public void accept(){

     Scanner in = new Scanner(System.in);

       System.out.print("Enter Your Name= ");

       name = in.nextLine();

       System.out.print("Enter basic= ");

       bas = in.nextInt();

       System.out.print("Enter experience= ");

       expn = in.nextInt();

 }

 //to calculate increment based on experience as per the table

 public void increment(){

   if (expn <= 3)

    inc = 1000 + (bas * 0.1);

   else if (expn >= 3 && expn <= 5)

    inc = 3000 + (bas * 0.12);

   else if (expn>=5 && expn <= 10)

    inc = 5000 + (bas * 0.15);

   else

    inc = 8000 + (bas * 0.2);

    nbas=bas+inc;

 }

 //Display

 public void display (){

     System.out.println("Name= " +name);

     System.out.println("Basic= " +bas);

     System.out.println("experience= " +expn);

     System.out.println("Increment= " +inc);

     System.out.println("New Basic= " +nbas);

 }

 public static void main(String args[]){

     Grade_Revision obj = new Grade_Revision();

     obj.accept();

     obj.increment();

     obj.display();

 }

}

Similar questions