но, я все условия перечислил, все возможные исходы тоже
почему нет?
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) {
//напишите тут ваш код
int score1 = 0;
int score2 = 0;
if (this.strength > anotherCat.strength)
score1++;
else if (this.strength < anotherCat.strength)
score2++;
else if (this.strenght == anotherCat.strenght)
score1++; score2++;
else if (this.age > anotherCat.age)
score1++;
else if (this.age < anotherCat.age)
score2++;
else if (this.age == anotherCat.age)
score1++; sccore2++;
else if (this.weight > anotherCat.weight)
score1++;
else if (this.weight < anotherCat.weight)
score2++;
else if (this.weight == anotherCat.weight)
score1++; score2++;
if (score1 > score2)
return true;
else if (score1 < score2)
return false;
if (score1 == score2)
return true;
if (score2 == score2)
return false;
}
public static void main(String[] args) {
}
}