Ошибка в файле com/javarush/task/task05/task0505/Solution.java в строке : 7
Пакет "com.sun.xml.internal.ws.api.model.wsdl" не найден. Проверьте путь
По умолчанию в задаче импортирован этот пакет.
package com.javarush.task.task05.task0505;
/*
Кошачья бойня
*/
import com.sun.xml.internal.ws.api.model.wsdl.WSDLOutput;
import org.w3c.dom.ls.LSOutput;
public class Solution {
public static void main(String[] args) {
Cat cat1 = new Cat("vasya",1,3,3);
Cat cat2 = new Cat("kuzya", 2,6,10);
Cat cat3 = new Cat("marsik",3,5,7);
if (cat1.fight(cat2)) System.out.println(cat1.name + " победил");
else System.out.println(cat2.name + " победил");
if (cat1.fight(cat3)) System.out.println(cat1.name + " победил");
else System.out.println(cat3.name + " победил");
if (cat3.fight(cat2)) System.out.println(cat3.name + " победил") ;
else System.out.println(cat2.name + " победил");//напишите тут ваш код
}
public static class Cat {
protected String name;
protected int age;
protected int weight;
protected 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 ageAdvantage = this.age > anotherCat.age ? 1 : 0;
int weightAdvantage = this.weight > anotherCat.weight ? 1 : 0;
int strengthAdvantage = this.strength > anotherCat.strength ? 1 : 0;
int score = ageAdvantage + weightAdvantage + strengthAdvantage;
return score > 2; // return score > 2 ? true : false;
}
}
}