package hierarchicalinheritance;
import java.util.Scanner;
public class HierarchicalInheritance
{
    public static void main(String args[])
    {
        Scanner scan = new Scanner (System.in);
        programmer emp = new programmer();
        photographer pho = new photographer();
        painter pain = new painter();
        
        emp.dispaly();
        pho.display();
        pain.display();
    }
}

//super class
class employees
{
    Scanner scan = new Scanner (System.in);
    int salary;
    String name , gender;
    
    void entering ()
    {
        System.out.print("What`s your name ? ");
        name = scan.next();
        System.out.print("What`s your gender ? ");
        gender = scan.next();
    }
}

//sub class one
class programmer extends employees
{
    String specification;
    void dispaly()
    {
        salary = 3000;
        entering();
        System.out.print("What`s your specification ? ");
        specification = scan.next();
        System.out.println("Welcome "+name+" you are specified in "+specification);
        System.out.println("so your salary will be : "+"$ "+salary);
    }
}

//sub class two
class photographer extends employees
{
    int level;
    void display()
    {
    salary = 200;
    entering();
    System.out.print("what is your level form 1 to 10 ? ");
    level = scan.nextInt();
    System.out.println("Welcome "+name+" your level is "+level);
    System.out.println("so your salary will be : "+"$ "+salary*level);
    }
}

//sub class three
class painter extends employees
{
    int age;
    void display()
    {
    salary = 50;
    entering();
    System.out.print("what is your age ? ");
    age = scan.nextInt();
    System.out.println("Welcome "+name+" your born in "+(2018 - age));
    System.out.println("so your salary will be : "+"$ "+salary*age);
    }
}