dm6801

171127 - Class 08 - Tester

Nov 29th, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.40 KB | None | 0 0
  1. import Cats.*;
  2. import Company.*;
  3.  
  4.  
  5. public class Tester {
  6.  
  7.     public static void main(String[] args) {
  8.        
  9.         /* Cat Classes tester */
  10.         Cat catObj1 = new Cat();
  11.         System.out.println(catObj1);
  12.        
  13.         StreetCat streetCatObj1 = new StreetCat(catObj1);
  14.         streetCatObj1.setName("copied Cat");
  15.         System.out.println(streetCatObj1);
  16.        
  17.         SiamiCat siamiCatObj1 = new SiamiCat("Siamease", 2.1f, "Grey", "Tuna");
  18.         System.out.println(siamiCatObj1);
  19.        
  20.        
  21.        
  22.        
  23.        
  24.        
  25.         System.out.println();
  26.        
  27.        
  28.         /* Employee class tester */
  29.         Employee employeeObj1 = new Employee("new_employee_a");
  30.         System.out.println(employeeObj1);
  31.        
  32.         Employee employeeObj2 = new Employee("new_employee_b", 1009, 15000);
  33.         System.out.println(employeeObj2);
  34.        
  35.         if (employeeObj2.updateSalary(16123.80f)) {
  36.             System.out.println("Salary updated! for employee "+employeeObj2.getName());
  37.         } else { System.out.println("Salary update failed."); }
  38.         System.out.println(employeeObj2);
  39.        
  40.        
  41.        
  42.        
  43.        
  44.        
  45.        
  46.         System.out.println();
  47.        
  48.        
  49.         /* Programmer class tester  */
  50.         Programmer progObj1 = new Programmer("Programmer_a", 0, 16000, 1.2f);
  51.         System.out.println(progObj1);
  52.        
  53.        
  54.        
  55.        
  56.        
  57.        
  58.        
  59.        
  60.         System.out.println();
  61.        
  62.        
  63.         /* Secretary class tester  */
  64.         Secretary secrObj1 = new Secretary("Secretary_a", 0, 6000);
  65.         secrObj1.setBonusMultiplier(700f);
  66.         System.out.println(secrObj1);
  67.        
  68.        
  69.        
  70.        
  71.    
  72.     }
  73.  
  74. }
Advertisement
Add Comment
Please, Sign In to add comment