class HighwayCar extends Car{
    // private int no;
    // //private double cc;
    // private double speed;
    // private double position;
    private double distance;
    //private String carType;
    // private Location enter = new Location(null, 0);
    // private Location exit = new Location(null, 0);
    private Time enterTime = new Time();
    private Time exitTime= new Time();

    public HighwayCar (int no, double cc, double speed, double position, Location enter, Location exit, double distance, Time enterTime, Time exitTime, boolean isOnHighway){
        super(no, speed);
        this.distance = distance;
        this.enterTime = enterTime;
        this.exitTime = exitTime;
    }

    public double getDistance(){return distance;}

    public void setDistance(){
        this.distance = this.getExit().getPosition() - this.getEnter().getPosition();
    }

    public Time getEnterTime() {
        return enterTime;
    }

    public Time getExitTime() {
        return exitTime;
    }

    public void printEnterTime() {
        System.out.printf("%d/%02d/%02d-%02d:%02d ",this.enterTime.getYear(), this.enterTime.getMonth(), this.enterTime.getDay(), this.enterTime.getHour(), this.enterTime.getMinute());
    }

    //@Override
    public void printExitTime() {
        System.out.printf("%d/%02d/%02d-%02d:%02d ",this.exitTime.getYear(), this.exitTime.getMonth(), this.exitTime.getDay(), this.exitTime.getHour(), this.exitTime.getMinute());
    }





    public void setPositionOnebyone(int min) {
        this.distance = this.getExit().getPosition() - this.getEnter().getPosition();
        if (this.distance > 0) {
            this.setPosition(this.getPosition() + (this.getSpeed() / 60 * min));
        }
        else if (this.distance < 0) {
            this.setPosition(this.getPosition() - (this.getSpeed() / 60 * min));
        }
    }

    public void deleteCarAtHighway() {
        this.setNo(0);
        //this.setCc(0);
        this.setSpeed(0);
        this.getEnter().setName("0");
        this.getEnter().setPosition(0);
        this.getExit().setName("0");
        this.getExit().setPosition(0);
        this.enterTime.setYear(0);
        this.enterTime.setMonth(0);
        this.enterTime.setDay(0);
        this.enterTime.setHour(0);
        this.enterTime.setMinute(0);
        this.exitTime.setYear(0);
        this.exitTime.setMonth(0);
        this.exitTime.setDay(0);
        this.exitTime.setHour(0);
        this.exitTime.setMinute(0);
        this.putOnHighway(false);
    }

    public void calculateExitTime() {
        if (this.distance < 0) {this.distance = -this.distance;} 
        int drivingMinute = (int)((this.distance / this.getSpeed()) * 60);
        if (this.getNo() != 0) {
            this.exitTime.setMinute(this.exitTime.getMinute() + drivingMinute);
            while (this.exitTime.getMinute() >= 60) {
                this.exitTime.setMinute(this.exitTime.getMinute() - 60);
                this.exitTime.addOneHour();
            }
            if (this.exitTime.getHour() >= 24) {
                this.exitTime.setHour(this.enterTime.getHour() - 24);
                this.exitTime.addOneDay();
            }
            if (this.exitTime.getDay() > this.exitTime.getDaysInMonth(this.exitTime.getYear(), this.exitTime.getMonth())) {
                this.exitTime.setDay(this.exitTime.getDaysInMonth(this.exitTime.getYear(), this.exitTime.getMonth()));
                this.exitTime.addOneMonth();
            }
            if (this.exitTime.getMonth() > 12) {
                this.exitTime.setMonth(this.exitTime.getMonth() - 12);
                this.exitTime.addOneYear();
            }
        } 
    }

    public void printHighwayCarInfo() {
        System.out.println(this.getNo() + " " + (int)this.getPosition() + "KM");
    }
    
    public void printExitingCarInfo(int baseRate, int distanceRate) {
        System.out.print(this.getNo() + " ");
        printExitTime();
        System.out.println(calculateFee(baseRate, distanceRate) + "원");
    }
    
    public int calculateFee(int baseRate, int distanceRate) {
        double speedRate = this.getSpeed() / 100;
        //double ccRate = this.getCc() / 2000;
        double fee = (baseRate + (this.distance * distanceRate)) * speedRate;//  * ccRate;
        fee -= (fee % 10);
        return (int)fee;
    }
}이 highway class랑 class Car {
    private int no;
    //private double cc;
    private double speed;
    private double position;
    private double distance = 0;
    //private String carType;
    private Location enter = new Location(null, 0);
    private Location exit = new Location(null, 0);
    private boolean OnHighway = false;

    public Car (int no, double speed){
        this.no = no;
        this.speed = speed;
    }

    public int getNo(){return no;}
    public void setNo(int no){this.no = no;}
    public double getSpeed(){return speed;}
    public void setSpeed(double speed){this.speed = speed;}
    public double getPosition(){return position;}
    public void setPosition(double position){this.position = position;}
    public Location getEnter(){return enter;}
    public Location getExit(){return exit;}
    public double getDistance(){return distance;}
    public boolean isOnHighway(){return OnHighway;}
    public void putOnHighway(boolean tf){this.OnHighway = tf;}

    public void setDistance(){
        this.distance = this.getExit().getPosition() - this.getEnter().getPosition();
    }

    public int calculateFee(int baseRate, int distanceRate) {
        double speedRate = this.getSpeed() / 100;
        //double ccRate = this.getCc() / 2000;
        double fee = (baseRate + (this.distance * distanceRate)) * speedRate;//  * ccRate;
        fee -= (fee % 10);
        return (int)fee;
    }

    public void printHighwayCarInfo() {
        System.out.println(this.getNo() + " " + (int)this.getPosition() + "KM");
    }
    
    public void printExitTime(){}

    public void printExitingCarInfo(int baseRate, int distanceRate) {
        System.out.print(this.getNo() + " ");
        printExitTime();
        System.out.println(calculateFee(baseRate, distanceRate) + "원");
    }
} 이 car class할 합쳐줘