0% found this document useful (0 votes)
7 views3 pages

Java Exp 1

The document contains a Java program that defines an 'employee' class with methods to retrieve the first name, last name, and salary of employees. It includes a main method that prompts the user to input details for two employees and displays their names and salaries. Additionally, it calculates and displays the salaries after a 10% increase for both employees.

Uploaded by

tp60120
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views3 pages

Java Exp 1

The document contains a Java program that defines an 'employee' class with methods to retrieve the first name, last name, and salary of employees. It includes a main method that prompts the user to input details for two employees and displays their names and salaries. Additionally, it calculates and displays the salaries after a 10% increase for both employees.

Uploaded by

tp60120
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Name – Tejas Tanaji Patil

Roll No – 3081

import [Link].*;

class employee {

public static String get_Firstname(String name) {

return name;

public static String get_Last_name(String surname) {

return surname;

public static double get_Salary(double salary) {

return salary;

class employee_test {

public static void main(String args[]) {

employee e1 = new employee();

employee e2 = new employee();

Scanner sc = new Scanner([Link]);

[Link]("Enter The First Employee Name :");

String name1 = [Link]();

e1.get_Firstname(name1);

[Link]("Enter The First Employee lastname :");

String surname1 = [Link]();

e1.get_Last_name(surname1);

[Link]("Enter The Salary Of First Employee :");

double salary1 = [Link]();

e1.get_Salary(salary1);
[Link]("Enter The second Employee Name :");

String name2 = [Link]();

e2.get_Firstname(name2);

[Link]("Enter The second Employee lastname ");

String surname2 = [Link]();

e2.get_Last_name(surname2);

[Link]("Enter The Salary Of Second Employee :");

double salary2 = [Link]();

e2.get_Salary(salary2);

[Link](" Name :" + e1.get_Firstname(name1) + " " + e1.get_Last_name(surname1) +


" & Salary Is : "

+ e1.get_Salary(salary1));

[Link](" Name :" + e2.get_Firstname(name2) + " " + e2.get_Last_name(surname2) +


" & Salary Is : "

+ e2.get_Salary(salary2));

[Link]();

[Link]("After incresing salary by 10%");

[Link](e1.get_Firstname(name1) + " " + e1.get_Last_name(surname1) + " "

+ e1.get_Salary(salary1) * 12 * 1.10 + "\n");

[Link](e2.get_Firstname(name2) + " " + e2.get_Last_name(surname2) + " "

+ e2.get_Salary(salary2) * 12 * 1.10 + "\n");

}
OUTPUT

You might also like