Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
7 views
1 page
PGM 3
Uploaded by
sailahari118
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
Download
Save
Save pgm 3 For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
0 ratings
0% found this document useful (0 votes)
7 views
1 page
PGM 3
Uploaded by
sailahari118
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save pgm 3 For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
Download
Save pgm 3 For Later
You are on page 1
/ 1
Search
Fullscreen
package src;
public class Employee {
private String firstName;
private String lastName;
private double monthlySalary;
public Employee(String fname,String lname,double msalary)
{
firstName =fname;
lastName =lname;
monthlySalary =msalary;
}
public void setFirstName (String fname)
{
firstName =fname;
}
public String getFirstName()
{
return firstName;
}
public void setlastName (String lname)
{
lastName= lname;
}
public String getLastName()
{
return lastName;
}
public double getMonthlySalary()
{
return monthlySalary;
}
public double getraiseSalary()
{
double raise = monthlySalary *0.1;
double raiseSalary = (monthlySalary + raise);
return raiseSalary;
}
public static void main(String[] args)
{
Employee emp1 = new Employee ("John","Smith",5000.00 );
Employee emp2 = new Employee ("Jane","Doe",8000.00 );
System.out.printf("Yearly salary of %s %s:%.2f\n",
emp1.getFirstName(),emp1.getLastName(),emp1.getMonthlySalary());
System.out.printf("Yearly Salary of %s %s:%.2f\n",
emp2.getFirstName(),emp2.getLastName(),emp2.getMonthlySalary());
System.out.println();
System.out.println("****Giving 10% raise for each employee****");
System.out.printf("Yearly salary of %s %s:%.2f\
n",emp1.getFirstName(),emp1.getLastName(),emp1.getraiseSalary());
System.out.printf("yearly salary of %s %s:%.2f\
n",emp2.getFirstName(),emp2.getLastName(),emp2.getraiseSalary());
}
}
You might also like
Java Project Report On Employee Management System
PDF
100% (1)
Java Project Report On Employee Management System
16 pages
LAB2
PDF
No ratings yet
LAB2
12 pages
Pro192 HW w3 SE17B04
PDF
No ratings yet
Pro192 HW w3 SE17B04
12 pages
Oop 3 Fa20-Be-012
PDF
No ratings yet
Oop 3 Fa20-Be-012
19 pages
Prova Av2
PDF
No ratings yet
Prova Av2
11 pages
Lab 7
PDF
No ratings yet
Lab 7
29 pages
Chapter-Seven: Object-Oriented Implementation
PDF
No ratings yet
Chapter-Seven: Object-Oriented Implementation
23 pages
Java Project Code
PDF
No ratings yet
Java Project Code
9 pages
Traineeemployees - Java: Public Class Extends Private Int Private Int Public Int Return
PDF
No ratings yet
Traineeemployees - Java: Public Class Extends Private Int Private Int Public Int Return
4 pages
04 Task Performance 1prelim Exam - ARG
PDF
No ratings yet
04 Task Performance 1prelim Exam - ARG
4 pages
Employee Salary Code - PDF
PDF
No ratings yet
Employee Salary Code - PDF
3 pages
Lab Polymorphism
PDF
No ratings yet
Lab Polymorphism
6 pages
Assignment# 2
PDF
No ratings yet
Assignment# 2
5 pages
Assignment - 3
PDF
No ratings yet
Assignment - 3
5 pages
Person
PDF
No ratings yet
Person
3 pages
Implementation of Java Program To Demonstrate Method Overloading and Constructor Overloading
PDF
No ratings yet
Implementation of Java Program To Demonstrate Method Overloading and Constructor Overloading
8 pages
Anurag Tiwari Mca.10029.24 Assignment 9
PDF
No ratings yet
Anurag Tiwari Mca.10029.24 Assignment 9
7 pages
Implementation of Java Program To Pass Arguments To A Method and Return Value
PDF
No ratings yet
Implementation of Java Program To Pass Arguments To A Method and Return Value
8 pages
Employee
PDF
No ratings yet
Employee
3 pages
Code For Employee Class in Java
PDF
No ratings yet
Code For Employee Class in Java
2 pages
Java
PDF
No ratings yet
Java
5 pages
Exp (4) - 2
PDF
No ratings yet
Exp (4) - 2
9 pages
Implementation of Java Program To Demonstrate File Handling and Object Serialization
PDF
No ratings yet
Implementation of Java Program To Demonstrate File Handling and Object Serialization
8 pages
Solution Lab Mini Project Java
PDF
No ratings yet
Solution Lab Mini Project Java
2 pages
PR 4
PDF
No ratings yet
PR 4
4 pages
Aoop Skill Week-5
PDF
No ratings yet
Aoop Skill Week-5
13 pages
2.2 Employee
PDF
No ratings yet
2.2 Employee
1 page
Day 1 Intro
PDF
No ratings yet
Day 1 Intro
15 pages
Kise OOP
PDF
No ratings yet
Kise OOP
7 pages
Lab 3
PDF
No ratings yet
Lab 3
4 pages
Example: Now Suppose We Extend Employee Class As Follows
PDF
No ratings yet
Example: Now Suppose We Extend Employee Class As Follows
2 pages
3 Inheritance Program
PDF
No ratings yet
3 Inheritance Program
5 pages
Homework #1: Please Refer To The Code in The Appendix (Pages 2 - 6) To Answer The Following Questions
PDF
No ratings yet
Homework #1: Please Refer To The Code in The Appendix (Pages 2 - 6) To Answer The Following Questions
5 pages
Ict 3309
PDF
No ratings yet
Ict 3309
12 pages
MC160402261 CS411
PDF
No ratings yet
MC160402261 CS411
2 pages
JAVA Worksheet 1
PDF
No ratings yet
JAVA Worksheet 1
4 pages
HarshJAVA Worksheet 1
PDF
No ratings yet
HarshJAVA Worksheet 1
4 pages
Q005 Sales Commission - Program in Java
PDF
No ratings yet
Q005 Sales Commission - Program in Java
5 pages
Abdullah Ayub (002) Oose Lab #2: Eclipse
PDF
No ratings yet
Abdullah Ayub (002) Oose Lab #2: Eclipse
6 pages
Ass 3 Prac 2
PDF
No ratings yet
Ass 3 Prac 2
4 pages
JAVA Worksheet 1.1.2
PDF
No ratings yet
JAVA Worksheet 1.1.2
4 pages
Employees: Employee
PDF
No ratings yet
Employees: Employee
6 pages
Class Employee
PDF
No ratings yet
Class Employee
2 pages
Id Firstname Lastname Salary Id Firstname Lastname Salary
PDF
No ratings yet
Id Firstname Lastname Salary Id Firstname Lastname Salary
1 page
Exp 3
PDF
No ratings yet
Exp 3
1 page
Lab P3
PDF
No ratings yet
Lab P3
1 page
Employee Oop Example
PDF
No ratings yet
Employee Oop Example
5 pages
Java
PDF
No ratings yet
Java
1 page
Emplyee Demo 1
PDF
No ratings yet
Emplyee Demo 1
1 page
Programmed Assessment
PDF
No ratings yet
Programmed Assessment
6 pages
DCIT 201 Assignment
PDF
No ratings yet
DCIT 201 Assignment
18 pages
Exercise 1
PDF
No ratings yet
Exercise 1
3 pages
Program On This Keyword
PDF
No ratings yet
Program On This Keyword
2 pages
Assignment Oop3
PDF
No ratings yet
Assignment Oop3
3 pages
Ass Java
PDF
No ratings yet
Ass Java
6 pages
Package Model
PDF
No ratings yet
Package Model
1 page
Java 2
PDF
No ratings yet
Java 2
4 pages
Skill Week 5
PDF
No ratings yet
Skill Week 5
9 pages
Employee Java
PDF
No ratings yet
Employee Java
1 page
Amazing Java: Learn Java Quickly
From Everand
Amazing Java: Learn Java Quickly
Andrei Besedin
No ratings yet