@@ -0,0 +1,1865 @@
+package ru.revdaalex.lsp.chapterI.food;%0A%0Aimport java.util.Calendar;%0Aimport java.util.GregorianCalendar;%0A%0A/**%0A * Food class.%0A * Created by revdaalex on 27.06.2016.%0A */%0Apublic class Food %7B%0A    /**%0A     * Variable name.%0A     */%0A    private String name;%0A    /**%0A     * Variable createDate.%0A     */%0A    private GregorianCalendar createDate;%0A    /**%0A     * Variable expaireDate.%0A     */%0A    private GregorianCalendar expaireDate;%0A    /**%0A     * Variable price.%0A     */%0A    private double price;%0A    /**%0A     * Variable disscount.%0A     */%0A    private int disscount;%0A%0A    /**%0A     * Food class constructor.%0A     * @param name%0A     * @param expaireDate%0A     * @param createDate%0A     * @param price%0A     */%0A    public Food(String name, GregorianCalendar expaireDate, GregorianCalendar createDate, double price) %7B%0A        this.name = name;%0A        this.expaireDate = expaireDate;%0A        this.createDate = createDate;%0A        this.price = price;%0A    %7D%0A%0A    /**%0A     * Setter disscount.%0A     * @param disscount%0A     */%0A    public void setDisscount(int disscount) %7B%0A        this.disscount = disscount;%0A    %7D%0A%0A    /**%0A     * Calculation expiry date in percents.%0A     * @return long expiry date in percents.%0A     */%0A    public long getExpiryDateInPercents()%7B%0A        GregorianCalendar expaireDate = this.expaireDate;%0A        GregorianCalendar createDate = this.createDate;%0A        GregorianCalendar calendar = new GregorianCalendar();%0A        int y = calendar.get(Calendar.YEAR);%0A        int m = 1+calendar.get(Calendar.MONTH);%0A        int d = calendar.get(Calendar.DATE);%0A        GregorianCalendar currentTime = new GregorianCalendar(y, m, d);%0A        long left = currentTime.getTimeInMillis() - createDate.getTimeInMillis();%0A        long total = expaireDate.getTimeInMillis() - createDate.getTimeInMillis();%0A        long test = (left * 100 / total);%0A        return test;%0A    %7D%0A%7D

add Food.java