package com.javarush.task.jdk13.task05.task0501;
/*
Кошачья бойня(1)
*/
public class Solution {
public static class Cat {
//напишите тут ваш код
private String name;
private int age;
private int weight;
private int strength;
public Cat(String name, int age, int weight, int strength) {
this.name = name;
this.age = age;
this.weight = weight;
this.strength = strength;
}
public boolean fight(Cat anotherCat) {
int w = 0;
int l = 0;
if (age > anotherCat.age) {
w++;
} else l++;
if (weight > anotherCat.weight) {
w++;
} else l++;
if (strength > anotherCat.strength) {
w++;
} else l++;
if (w <=l ) {
return false;
} else return true;
}
public static void main(String[] args) {
Cat cat1 = new Cat("Basik", 4, 12, 10);
Cat cat2 = new Cat("Murzik", 5, 15, 12);
Cat cat3 = new Cat("Mashka", 2, 9, 20);
cat2.fight(cat1);
}
}
}