public static void main(String[] args)
{
Scanner scan= new Scanner(System.in); /* creating scanner class */
String companyName;
System.out.println("Enter the company name: ");
companyName = scan.nextLine();
String employeeName;
double appraisalScore;
System.out.println("Enter the 1st employee name: ");
employeeName = scan.nextLine();
System.out.println("Enter the 1st employee appraisal score (within
1-100): ");
appraisalScore = scan.nextDouble();
scan.nextLine(); /* using to avoid enter in
the above lines */
Employee emp1= new Employee(employeeName);
emp1.setAppraisalScore(appraisalScore);
System.out.println("Enter the 2nd employee name: ");
employeeName = scan.nextLine();
System.out.println("Enter the 2nd employee appraisal score (within
1-100): ");
appraisalScore = scan.nextDouble();
scan.nextLine();
Employee emp2= new Employee(employeeName);
emp2.setAppraisalScore(appraisalScore);
System.out.println("Enter the 3rd employee name: ");
employeeName = scan.nextLine();
System.out.println("Enter the 3rd employee appraisal score (within
1-100): ");
appraisalScore = scan.nextDouble();
Employee emp3= new Employee(employeeName);
emp3.setAppraisalScore(appraisalScore);
Employee.calculateAvgAppScore(); /* calling method to
compute the average score */
System.out.println("Company Name: " + companyName);
System.out.println("Num of Employees: " +
Employee.getEmployeesCount());
System.out.println("Average Appraisal Score: " +
Employee.getCompanyAvgAppScore());
emp1.printDetails();
emp2.printDetails();
emp3.printDetails();
scan.close();
}
}
Powered by TCPDF (www.tcpdf.org)
/*----------------------------------------------------------
//AUTHOR: CHAO ZHANG
// FILENAME: Lab8
// SPECIFICATION: Working with more than 1 object with respect to a class
// FOR: CSE 110Lab#3
// TIME SPENT: how long it took you to complete the assignment
//-----------------------------------*/
import java.util.Scanner;
public class Lab8
{