Problem:
Consider a class Characteristic that will be used in an online dating service to assess how compatible two people are. Its attributes are:
- Description-A String that identifies the characteristic (for instance pets or hair color)
- Rating-An integer between 1 and 10 (inclusive) that indicates a person's desire for this characteristic in another person
And the following methods:
- Write a constructor that sets the description of the characteristic to given String and sets the rating to zero to indicate that it has not yet been determined.
- Write a private method isValid(aRating) that returns true if the given rating is valid, that is, it is between 1 and 10
- Write a method setRating(aRating) that sets the rating to aRating if it is valid
- Write a method setRating() that reads a rating from the keyboard, insisting that the rating supplied by the user is valid
- Implement get, and set methods for all attributes.
Implement this class in Java and write a main() method within it to test it.
Please read all the questions carefully and answer them.