Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

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:

  1. 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.
  2. Write a private method isValid(aRating) that returns true if the given rating is valid, that is, it is between 1 and 10
  3. Write a method setRating(aRating) that sets the rating to aRating if it is valid
  4. Write a method setRating() that reads a rating from the keyboard, insisting that the rating supplied by the user is valid
  5. 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.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M91174975

Have any Question?


Related Questions in Computer Engineering

Scenario you have been asked to develop a company policy on

Scenario: You have been asked to develop a company policy on what should be done in the event of a data breach, such as unauthorized access to your company's customer database. What sort of process would you use to devel ...

1 what is the purpose of exclusive gates such as the xor

1. What is the purpose of exclusive gates such as the XOR and XNOR? 2. What function do these gates perform?

The researchers stated that there were no significant

The researchers stated that there were no significant differences in the baseline characteristics of the intervention and control groups. Are these groups heterogeneous or homogeneous at the beginning of the study? Why i ...

Question you work for a medium-sized it firm and your boss

Question: You work for a medium-sized IT firm and your boss mentions that recently a number of employees have received calls from individuals who didn't identify themselves and asked a lot of questions about the company ...

Question review ram flash memory magnetic and optical

Question : Review RAM, Flash Memory, Magnetic and Optical storage technologies concerning their placement in the usage hierarchy of contemporary computer systems. Include size, speed and cost considerations at each level ...

What are some topics that must be covered in a business

What are some topics that must be covered in a business case presented to management?

A cell phone company offers 15 different voice packages and

A cell phone company offers 15 different voice packages and 15 different data packages. Of those, 6 packages include both voice and data. How many ways are there to choose either voice or data, but not both?

Suppose we want to build a b tree that has space for 200000

Suppose we want to build a B+ tree that has space for 200,000 data entries in its leaf pages. Each data entry is made up of a key and its corresponding data value. Let us assume the following specifications. Each page (l ...

Question project assignment is to have you do more research

Question: Project assignment is to have you do more research on the physical security topic. In theory, everything may look straight forward, however, in real life it might not be like that. In this project you will need ...

Whats your answer about the equilibrium change from an

What's your answer about the equilibrium change from an event which decreases both demand and supply? You don't need to provide graph here. Just describe the curve shifts and how the equilibrium price and equilibrium qua ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As