In: Computer Science
In java program format
Submit your completed UML class diagram and Java file.
Part I: Create a UML diagram for this
assignment
PartII: Create a program that implements a class called Dog that contains instance data that represent the dog's name and age.
class Dog {
private String name;
private int age;
public Dog(String aName, int aAge) {
super();
name = aName;
age = aAge;
}
public String getName() {
return name;
}
public int getAge() {
return age;
}
public void setName(String aName) {
name = aName;
}
public void setAge(int aAge) {
age = aAge;
}
public int getAsHumanAge() {
return age * 7;
}
public String toString() {
return name + " is " + age + " old.";
}
}
public class Kennel {
public static void main(String[] args) {
Dog d = new Dog("Bruno", 1);
System.out.println(d);
System.out.println("in Human age: "+d.getAsHumanAge());
}
}
UML
NOTE : PLEASE COMMENT BELOW IF YOU HAVE CONCERNS.
I AM HERE TO HELP YOUIF YOU LIKE MY ANSWER PLEASE RATE AND HELP ME IT IS VERY IMP FOR ME