Write a Java program containing two classes: Dog and a driver class Kennel. A dog consists of the following information: • An integer age. • A string name. If the given name contains non-alphabetic...


Java


Write a Java program containing two classes: Dog and a driver class Kennel.<br>A dog consists of the following information:<br>• An integer age.<br>• A string name. If the given name contains non-alphabetic characters, initialize to Wolfy.<br>• A string bark representing the vocalization the dog makes when they 'speak'.<br>• A boolean representing hair length; true indicates short hair.<br>• A float weight representing the dog's weight (in pounds).<br>• An enumeration representing the type of tail (LONG, SHORT, NONE).<br>A dog consists of the following methods.<br>• A default constructor.<br>• A constructor that takes a name as argument.<br>• A method private boolean validName (String) that returns true / false whether<br>the given name contains non-alphabetic characters.<br>• humanAge that computes and returns the age of the dog in

Extracted text: Write a Java program containing two classes: Dog and a driver class Kennel. A dog consists of the following information: • An integer age. • A string name. If the given name contains non-alphabetic characters, initialize to Wolfy. • A string bark representing the vocalization the dog makes when they 'speak'. • A boolean representing hair length; true indicates short hair. • A float weight representing the dog's weight (in pounds). • An enumeration representing the type of tail (LONG, SHORT, NONE). A dog consists of the following methods. • A default constructor. • A constructor that takes a name as argument. • A method private boolean validName (String) that returns true / false whether the given name contains non-alphabetic characters. • humanAge that computes and returns the age of the dog in "human years." • speak returns the dog's bark. Each constructor should initialize all attributes to reasonable initial values. The main method in the Kennel class should create several dogs with each constructor and output their instance data using toString.

Jun 07, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here