package ru.revdaalex.engineer;

import ru.revdaalex.calculator.Calculator;
import ru.revdaalex.calculator.InteractCalc;
import ru.revdaalex.calculator.interfaces.IO;

/**
 * Created by revdaalex on 26.06.2016.
 */
public class EngineerCalc extends InteractCalc {
    /**
     * Main constructor.
     *
     * @param calculator calculator.
     * @param io         io.
     */
    public EngineerCalc(Calculator calculator, IO io) {
        super(calculator, io);
    }

    @Override
    public void start() {
        super.start();
    }
}

@@ -164,16 +164,39 @@
 O;%0A%0A/**%0A
+ * EngineerCalc class.%0A
  * Creat
@@ -298,262 +298,2465 @@
   * 
-Main constructor.%0A     *%0A     * @param calculator calculator.%0A     * @param io         io.%0A     */%0A    public EngineerCalc(Calculator calculator, IO io) %7B%0A        super(calculator, io);%0A    %7D%0A%0A    @Override%0A    public void start() %7B%0A        super.start()
+Variable engineerMenu.%0A     */%0A    EngineerMenu engineerMenu;%0A    /**%0A     * Variable user choice.%0A     */%0A    private int uc;%0A    /**%0A     * Variable rad.%0A     */%0A    private double rad;%0A    /**%0A     * Variable degree.%0A     */%0A    private double degree;%0A    /**%0A     * Main constructor.%0A     *%0A     * @param calculator calculator.%0A     * @param io         io.%0A     */%0A    public EngineerCalc(Calculator calculator, IO io) %7B%0A        super(calculator, io);%0A        this.engineerMenu = new EngineerMenu(io);%0A    %7D%0A%0A    /**%0A     * Override start method.%0A     */%0A    @Override%0A    public void start() %7B%0A        boolean notExit = true;%0A        while(notExit) %7B%0A            engineerMenu.startEngineerMenu();%0A            this.uc = menuValidator.validEngineerMenu();%0A            switch (uc)%7B%0A                case 1: super.start();break;%0A                case 2: engineerOperator();break;%0A                case 3: notExit = false;break;%0A            %7D%0A        %7D%0A    %7D%0A%0A    /**%0A     * Method engineer calculator.%0A     */%0A    private void engineerOperator()%7B%0A        boolean notExit = true;%0A        while (notExit)%7B%0A            engineerMenu.showEngineerOperator();%0A            this.uc = menuValidator.validEngineerOperation();%0A            switch (uc) %7B%0A                case 1:%0A                    degree = validator.getDouble(%22%D0%92%D0%B2%D0%B5%D0%B4%D0%B8%D1%82%D0%B5 %D0%B3%D1%80%D0%B0%D0%B4%D1%83%D1%81%D1%8B %D1%83%D0%B3%D0%BB%D0%B0%22);%0A                    rad = degreeInRad(degree, Math.PI);%0A                    calculator.sinus(rad);%0A                    this.io.println(String.format(%22%25s %25s%22, result, calculator.getResult()));break;%0A%0A                case 2:%0A                    degree = validator.getDouble(%22%D0%92%D0%B2%D0%B5%D0%B4%D0%B8%D1%82%D0%B5 %D0%B3%D1%80%D0%B0%D0%B4%D1%83%D1%81%D1%8B %D1%83%D0%B3%D0%BB%D0%B0%22);%0A                    rad = degreeInRad(degree, Math.PI);%0A                    calculator.cosine(rad);%0A                    this.io.println(String.format(%22%25s %25s%22, result, calculator.getResult()));%0A                    break;%0A%0A                case 3:%0A                    degree = validator.getDouble(%22%D0%92%D0%B2%D0%B5%D0%B4%D0%B8%D1%82%D0%B5 %D0%B3%D1%80%D0%B0%D0%B4%D1%83%D1%81%D1%8B %D1%83%D0%B3%D0%BB%D0%B0%22);%0A                    rad = degreeInRad(degree, Math.PI);%0A                    calculator.tangent(rad);%0A                    this.io.println(String.format(%22%25s %25s%22, result, calculator.getResult()));break;%0A%0A                case 4: notExit = false;break;%0A            %7D%0A        %7D%0A    %7D%0A%0A    /**%0A     * Method degree in radian.%0A     * @param degree degree.%0A     * @param pi pi.%0A     * @return%0A     */%0A    private double degreeInRad(double degree, double pi) %7B%0A        rad = (degree * pi) / 180;%0A        return rad
 ;%0A  

update EngineerCalc.java