Cat.java Class File Create a new class called Cat that includes the functionality below The new class has the attributes of: name � type String age � type integer weight � type double breed - type...

























Cat.java Class File


Create a new class called Cat that includes the functionality below


The new class has the attributes of:

name � type String

age � type integer

weight � type double

breed - type String

declawed - type boolean - true for has no claws, false for has claws


Be sure your classes have a reasonable complement of constructor, accessor and mutator methods. Every member variable must have at least one independent accessor and one independent mutator.


Example:

public void set Name(String name) mutator used to set name

public void set Breed(String breed) mutator used to set the breed

public void set(Boolean declawed) used to set claws or not

(You must overload the set method to set de Clawed value)

public String get Name() accessor used to get name

public String get Breed() accessor used to get breed

public boolean get Boolean() access used to get the value of declawed


Ensure you use the �this� reference from within this class when referring to every instance variable or instance method of the current object.



LastNameFirstNameWeek6Prog.java Class File (Driver Program)


Write a driver program that reads in 3 pets of type Cat and prints out the name and age of all cats with claws and over 3 years old.


The following information should be read in:

Name (as String)

Age (as int)

Weight (as double)

Breed (as String)

DeClawed (as boolean)


Ensure you use the accessor methods to check the age and claws.



Upload your page to the Dropbox.


NOTE: Complete your activity and submit it to the Dropbox by clicking on the Dropbox tab at the top of the course frame and choosing the correct Weekly Activity.


If needed, click on the Help button above for more information on Course Tools/Using theDropbox.



Total Possible Points



Example output of your program


Example Run:

Enter the name of Cat 1: Sam

Enter the age of Cat 1: 1

Enter the weight of Cat 1: 5

Enter the breed of Cat 1: fluffy1

Does the cat have claws? True or False?: True


Enter the name of Cat 2: Tom

Enter the age of Cat 2: 4

Enter the weight of Cat 2: 5

Enter the breed of Cat 2: fluffy2

Does the cat have claws? True or False?: True


Enter the name of Cat 3: Bob

Enter the age of Cat 3: 5

Enter the weight of Cat 3: 5

Enter the breed of Cat 3: fluffy3

Does the cat have claws? True or False?: False


The Cats over 3 with claws are:


Name: Tom

Age: 4 Years Old



Please do not use any type of array listing when counting the cats


May 19, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here