PSOOPL Submission Template
PSOOPL Submission Template
UID: 2024200020
Experiment No. 1
AIM:
Program 1
PROBLEM STATE Define parent class "Employee" that has 3 private attributes
MENT :
String name, String id, int age.
Employee has constructor with 3 arguments that set value of name, id, ag
e. It also has getter and setter methods for all 3 private attributes.
Accept the details of 5 salaried employees and print details of the employe
e with highest salary. Hint: Use array of objects
class Employee {
private String name, id;
private int age;
void displayDetails() {
System.out.println("Name: " + getName());
System.out.println("ID: " + getId());
System.out.println("Age: " + getAge());
System.out.println("Salary: " + getEmpSalary());
}
}
class Tester {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
SalariedEmployee[] employees = new SalariedEmployee[5];
RESULT:
Program 2
The objective of the first test was to find out how much interes
t the applicant takes in his work.
Questions asked
Questions asked
1.What is final method in Java?
Third test aimed at making sure whether the applicant was cap
able of learning through training or not.
Questions asked
The purpose of the fourth test was to find out how much capab
ility a person has to mix-up with other persons, and whether h
e can influence other persons and get influenced by them.
Questions asked
PROGRAM:
import java.util.*;
class Recruitment {
void section_1() {
System.out.println("Section 1.");
System.out.println("-------------------------------------------------------");
System.out.println("Options: ");
ans[0] = scan.nextInt();
System.out.println("-------------------------------------------------------");
System.out.println("1. 1 year");
System.out.println("2. 2 years");
System.out.println("3. 3 years");
System.out.println("4. 5+ years");
ans[1] = scan.nextInt();
System.out.println("-------------------------------------------------------");
void section_2() {
System.out.println("Section 2.");
System.out.println("First Question: ");
System.out.println("Options: ");
ans[2] = scan.nextInt();
System.out.println("-------------------------------------------------------");
System.out.println("1. 23");
System.out.println("2. 21");
System.out.println("3. 22");
System.out.println("4. 24");
ans[3] = scan.nextInt();
System.out.println("-------------------------------------------------------");
void section_3() {
System.out.println("Options: ");
System.out.println("2. Adaptability");
System.out.println("-------------------------------------------------------");
ans[5] = scan.nextInt();
System.out.println("-------------------------------------------------------");
void section_4() {
System.out.println("Options: ");
ans[6] = scan.nextInt();
System.out.println("-------------------------------------------------------");
ans[7] = scan.nextInt();
System.out.println("-------------------------------------------------------");
void takeTest() {
super.section_1();
super.section_2();
super.section_3();
super.section_4();
void genResult() {
int c = 0;
if (ans[i] == scr[i]) {
c++;
} else {
class Tester {
public static void main(String[] args) {
System.out.println("Let's Start!");
System.out.println("-------------------------------------------------------");
test.takeTest();
test.genResult();
}
RESULT:
Program 3
PROBLEM STATE
MENT:
PROGRAM:
RESULT:
Program 4
PROBLEM STATE
MENT:
PROGRAM:
RESULT:
CONCLUSION: