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
• rating—an integer between 1 and 10 that indicates a person’s desire for this characteristic in another person
a. Write a constructor that sets the description of the characteristic to a given string and sets the rating to zero to indicate that it has not yet been determined.
b. Write a private method isValid(aRating) that returns true if the given rating is valid, that is, is between 1 and 10.
c. Write a method setRating(aRating) that sets the rating to aRating if it is
valid.
d. Write a method setRating that reads a rating from the keyboard, insisting that the rating supplied by the user be valid.
See the code in Characteristic.java.
You might also like to view...
When would a search by a private individual be considered unconstitutional?
a. Any time the results of that search are introduced as evidence in court. b. Any time the individual broke any other laws in gaining access to conduct the search. c. Any time the individual doing the search did so without the knowledge of the person subject to the search. d. Whenever a government official approached the person doing the search and asked for their help in collecting evidence.
When the layers are locked, the mask layer object is not visible,
A. mask B. masked C. both a. and b. D. neither a. nor b.
________ was recently acquired by and closely linked to Twitter
A) Flickr B) Picasa Web Albums C) Instagram D) Photobucket
It is possible to word ________ in such a way as to make sure that the organization is covered in the eventuality that an emergency within an emergency should present itself
Fill in the blank(s) with correct word