Skip to content

Commit

Permalink
message
Browse files Browse the repository at this point in the history
  • Loading branch information
sashaNeshcheret committed Nov 23, 2017
1 parent 4549260 commit 930b7c0
Show file tree
Hide file tree
Showing 47 changed files with 1,539 additions and 50 deletions.
86 changes: 36 additions & 50 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions src/main/java/MainFirstTask/Beta.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package MainFirstTask;

/**
* Beta (������)
* @version 1.0 3 Oct 2013
* @author Andrei Loyevets
*/
public class Beta extends RootVegetable{

/**
* Default constructor.
*/
public Beta() {
super("Beta", 47);
}

/**
* Constructor with parameters. Creates a Beta of a given weight.
* @param weight the mass of the vegetable that will be created
*/
public Beta(double weight) {
super("Beta", 47, weight);
}
}
14 changes: 14 additions & 0 deletions src/main/java/MainFirstTask/CaloriesComparator.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package MainFirstTask;

/**
* This class implements interface Comparator to compare Vegetables by
* calories per 100g.
* @version 1.0 3 Oct 2013
* @author Andrei Loyevets
*/
public class CaloriesComparator implements java.util.Comparator<Vegetable>{

public int compare(Vegetable v1, Vegetable v2) {
return (int) (v1.getCalories() - v2.getCalories());
}
}
24 changes: 24 additions & 0 deletions src/main/java/MainFirstTask/Carrot.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package MainFirstTask;

/**
* Carrot (�������)
* @version 1.0 3 Oct 2013
* @author Andrei Loyevets
*/
public class Carrot extends RootVegetable{

/**
* Default constructor.
*/
public Carrot() {
super("Carrot", 41);
}

/**
* Constructor with parameters. Creates a Carrot of a given weight.
* @param weight the mass of the vegetable that will be created
*/
public Carrot(double weight) {
super("Carrot", 41, weight);
}
}
Loading

0 comments on commit 930b7c0

Please sign in to comment.