import java.io.*;
import java.util.Scanner;
public class Employees {
Scanner scan=new Scanner(System.in);
String Fname; int EmpID; int DOB; double Allowance; double Salary;
public void getDetails(){
System.out.println("Enter the first name");
Fname=scan.next();
System.out.println("Enter the ID number");
EmpID=scan.nextInt();
System.out.println("Enter the date of birth");
DOB=scan.nextInt();
System.out.println("Enter the salary");
Salary=scan.nextDouble();
Allowance=0.6*Salary;
}
public void printReport(){
System.out.println(Fname+"\t"+EmpID+"\t"+calGross()+"\t"+calPayee()+"\t"+calNetIncome());
}
public double calGross(){
return Salary + Allowance;
}
public double calPayee(){
double x=Salary+Allowance;
if(x>50000)
return 0.4*(Salary-50000)+7000;
else
if(x>40000)
return 0.3*(Salary-40000)+4000;
else
if(x>30000)
return 0.25*(Salary-30000)+1500;
else
if(x>20000)
return 0.15*(Salary-50000);
else
return 0;
}
public double calNetIncome(){
return calGross()-calPayee();
}
public static void main(String []args)throws IOException{
Employees E[]=new Employees[2];//or []E
int i;
double totnetincome=0,totpayee=0;
for(i=0;i<E.length;i++){
E[i]=new Employees();
E[i].getDetails();
totnetincome+=E[i].calNetIncome();
totpayee+=E[i].calPayee();
}
System.out.println("Name\t EMpID No\tGross \tPayee \tNetincome");
for(i=0;i<E.length;i++){
E[i].printReport();
}
System.out.println("Total netIncome "+totnetincome+"Total payee
"+totpayee);
}//end of main
}//end of class
import java.util.Scanner;
public class Employees {
Scanner scan=new Scanner(System.in);
String Fname; int EmpID; int DOB; double Allowance; double Salary;
public void getDetails(){
System.out.println("Enter the first name");
Fname=scan.next();
System.out.println("Enter the ID number");
EmpID=scan.nextInt();
System.out.println("Enter the date of birth");
DOB=scan.nextInt();
System.out.println("Enter the salary");
Salary=scan.nextDouble();
Allowance=0.6*Salary;
}
public void printReport(){
System.out.println(Fname+"\t"+EmpID+"\t"+calGross()+"\t"+calPayee()+"\t"+calNetIncome());
}
public double calGross(){
return Salary + Allowance;
}
public double calPayee(){
double x=Salary+Allowance;
if(x>50000)
return 0.4*(Salary-50000)+7000;
else
if(x>40000)
return 0.3*(Salary-40000)+4000;
else
if(x>30000)
return 0.25*(Salary-30000)+1500;
else
if(x>20000)
return 0.15*(Salary-50000);
else
return 0;
}
public double calNetIncome(){
return calGross()-calPayee();
}
public static void main(String []args)throws IOException{
Employees E[]=new Employees[2];//or []E
int i;
double totnetincome=0,totpayee=0;
for(i=0;i<E.length;i++){
E[i]=new Employees();
E[i].getDetails();
totnetincome+=E[i].calNetIncome();
totpayee+=E[i].calPayee();
}
System.out.println("Name\t EMpID No\tGross \tPayee \tNetincome");
for(i=0;i<E.length;i++){
E[i].printReport();
}
System.out.println("Total netIncome "+totnetincome+"Total payee
"+totpayee);
}//end of main
}//end of class
Can we change the program with the current (and changing) salary payment norms of the company? Isn't the program lacking any factor which is used to calculate the salary?
ReplyDeleteThanks in advance!
Jimmie Menon
Payroll Providers Guelph
Hi, hoping i understood your question, you could add setXYZ() and getXYZ() methods in the class to take care of changing variables. You could also set default values to be used when such values are not set. This is just a simple class and you are free to add any other factors matching your solution.
DeleteReally Nice Information,Thank You Very Much For Sharing.
ReplyDeleteWeb Development Company
Java is very good blog,it's highly professional course.Thanks for sharing
ReplyDeletejava online course
Great content thanks for sharing this informative blog which provided me technical information keep posting.
ReplyDeleteBest Devops Training in pune
Devops Training in Bangalore
Microsoft azure training in Bangalore
Power bi training in Chennai
Thanks for sharing this pretty post, it was good and helpful. Share more like this.
ReplyDeletePython course in Chennai
Best Python Training in Chennai
ccna Training in Chennai
ccna course in Chennai
Data Analytics Courses in Chennai
Big Data Analytics Courses in Chennai
Python Training in Anna Nagar
Python Training in T Nagar
I have been continuously reading all your blogs. You have shared a worthy information.
ReplyDeleteEnglish Speaking Classes in Mulund
English Speaking Classes in Mulund West
English Speaking Course in Mulund
English Speaking Course in Mulund East
Spoken English Classes in Anna Nagar
Spoken English Classes in Chennai
Spoken English Class in Chennai
Spoken English in Chennai
This comment has been removed by the author.
ReplyDeletegta 5 apk
ReplyDeleteYour article is amazing.just love it. you might be interested in :chameleon run apk
ReplyDeleteWow it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot. it is really explainable very well and i got more information from your blog.
ReplyDeleteCyber Security Training Course in Chennai | Certification | Cyber Security Online Training Course | Ethical Hacking Training Course in Chennai | Certification | Ethical Hacking Online Training Course |
CCNA Training Course in Chennai | Certification | CCNA Online Training Course | RPA Robotic Process Automation Training Course in Chennai | Certification | RPA Training Course Chennai | SEO Training in Chennai | Certification | SEO Online Training Course
Nice and good post. It is very useful for me to learn and understand easily. Thanks for sharing your valuable information.
ReplyDeletePhp Web Development Company Bangalore | Magento Website Designer In India | Internet Marketing Company in Bangalore | E-Commerce Websites Designing Company In Bangalore
Nice and good post. It is very useful for me to learn and understand easily. Thanks for sharing your valuable information.
ReplyDeleteDigital Marketing Training in Chennai
Digital Marketing Course in Chennai
Wonderful post and more informative!keep sharing Like this!
ReplyDeleteSalesforce Training in Hyderabad
Salesforce Training in Pune
Extraordinary Blog. Provides necessary information.
ReplyDeletegerman institute in Chennai
german coaching center in Chennai
Very nice post. Thank you for sharing this valuable information with us.
ReplyDeleteThirukkural pdf download
Sai Satcharitra in malayalam pdf
Sai Satcharitra in marathi pdf
Sai Satcharitra in kannada pdf
Sai Satcharitra in bengali pdf
Sai Satcharitra in gujarati pdf
ountain Duck Keygen is a nifty OS X app that can make managing cloud storage accounts and FTP, SFTP, or WebDAV servers a lot easier, as it.Mountain Duck Encryption
ReplyDeleteGreat post thanks for sharing
ReplyDeleteSai Satcharitra Pdf
Sai Satcharitra Telugu Pdf
Sai Satcharitra Tamil Pdf