Не проходит проверку, не понимаю почему.
package com.javarush.task.task05.task0502;
/*
Реализовать метод fight
*/
public class Cat {
public int age;
public int weight;
public int strength;
public Cat() {
}
public boolean fight(Cat anotherCat) {
//напишите тут ваш код
double a = 0.0, w = 0.0, s = 0.0;
if ( this.age > anotherCat.age )
a = 1.0;
if ( this.age == anotherCat.age )
a = 0.5;
if ( this.weight > anotherCat.weight )
w = 1.0;
if ( this.weight == anotherCat.weight )
w = 0.5;
if ( this.strength > anotherCat.strength )
s = 1.0;
if ( this.strength == anotherCat.strength )
s = 0.5;
if (a+w+s == 1.5)
return false;
if (a+w+s > 2.0)
return true;
else return false;
}
public static void main(String[] args) {
}
}