package en.javarush.task.jdk13.task05.task0501;
/*
Cat carnage (1)
*/
public class Solution {
public static void main(String[] args) {
Cat cat1 = new Cat("Musea", 10, 9, 5);
Cat cat2 = new Cat("Zaia", 5, 3, 2);
Cat cat3 = new Cat("Kisea", 4, 1, 6);
}
public static class Cat {
private String name;
private int age;
private int weight;
private int strength;
public boolean fight(Cat cat) {
int countStats=0;
if (this.age > cat.age)
countStats++;
if (this.weight > cat.weight)
countStats++;
if (this.strength > cat.strength)
countStats++;
if (countStats >=2)
return true;
else return false;
}
public Cat (String name, int age, int weight, int strength) {
this.name = name;
this.age = age;
this.weight = weight;
this.strength = strength;
}
}
}
package en.javarush.task.jdk13.task05.task0501;
/*
Cat carnage (1)
*/
public class Solution {
public static void main(String[] args) {
Cat cat1 = new Cat("Musea", 10, 9, 5);
Cat cat2 = new Cat("Zaia", 5, 3, 2);
Cat cat3 = new Cat("Kisea", 4, 1, 6);
}
public static class Cat {
private String name;
private int age;
private int weight;
private int strength;
public boolean fight(Cat cat) {
int countStats=0;
if (this.age > cat.age)
countStats++;
if (this.weight > cat.weight)
countStats++;
if (this.strength > cat.strength)
countStats++;
if (countStats >=2)
return true;
else return false;
}
public Cat (String name, int age, int weight, int strength) {
this.name = name;
this.age = age;
this.weight = weight;
this.strength = strength;
}
}
}