сравнение вроде есть , один кот выигрывает , что еще надо
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 pussy = 0, dick = 0;
if (this.weight > anotherCat.weight && this.weight != anotherCat.weight) {
pussy++;
} else {
dick++;
}
if (this.age > anotherCat.age && this.age != anotherCat.age) {
pussy++;
} else {
dick++;
}
if (this.strength > anotherCat.strength && this.strength != anotherCat.strength) {
pussy++;
} else {
dick++;
}
if (pussy == dick) {
return false;
} else if (pussy > dick) {
return true;
}else {
return true;
}
}
public static void main(String[] args) {
}
}