Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

Question:

Part -1:
Complete and fully test the class Characteristic that Exercise explains. Include the given methods:
• getDescription - returns the description of this characteristic
• getRating - returns the rating of this characteristic
• getCompatability(Characteristic otherRating) - returns the compatibility measure of two matching characteristics, or zero if the descriptions do not match
• getCompatibilityMeasure(Characteristic otherRating) - a private method that returns a compatibility measure as a double value using the formula:
• [m = 1 - (r1 - r2)*(r1 - r2)/81]
When both ratings are nonzero; m is zero if either rating is zero.
• isMatch(Characteristic otherRating) - a private boolean method that returns true if the descriptions match
You have to write the given methods and implement these methods in program.

Part 2:
Suppose 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
• Prepare 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
• Prepare a private method isValid(aRating) that returns true if the given rating is valid, that is, 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 be valid
Testing Your Code
Implement a class named Dating Service that instantiates two people, Chris and Pat, and tests their compatibility by using all of the methods you have defined.
PLEASE ensure it compiles and write the full program to receive full credit. Thank you so much for your help.

Java, Programming

  • Category:- Java
  • Reference No.:- M91245965

Have any Question?


Related Questions in Java

Can someone please help me with the following java

can someone please help me with the following java question The input is an N by N matrix of nonnegative integers. Each individual row is a decreasing sequence from left to right. Each individual column is a decreasing s ...

Overviewyou are required to use java se 80 and javafx to

Overview You are required to use Java SE 8.0 and JavaFX to develop a Graphical User Interface (GUI) for the FlexiRent rental property management program created in Assignment 1. This assignment is designed to help you: 1 ...

Question slideshows or carousels are very popular in

Question : Slideshows (or carousels) are very popular in websites. They allow web developers to display news or images on the website in limited space. In this code challenge, you are required to complete the JavaScript ...

Assignment taskwrite a java console application that allows

Assignment task Write a java console application that allows the user to read, validate, store, display, sort and search data such as flight departure city (String), flight number (integer), flight distance (integer), fl ...

Fundamentals of operating systems and java

Fundamentals of Operating Systems and Java Programming Purpose of the assessment (with ULO Mapping) This assignment assesses the following Unit Learning Outcomes; students should be able to demonstrate their achievements ...

In ruby the hash class inherits from enumerable suggesting

In Ruby, the Hash class inherits from Enumerable, suggesting to a programmer that Hashes are collections. In Java, however, the Map classes are not part of the JCF (Java Collections Framework). For each language, provide ...

Simple order processing systemquestion given the classes

Simple Order Processing System Question: Given the classes Ship (with getter and setter), Speedboat, and SpeedboatTest. Answer the following questions: Refine the whole application (all classes) and create Abstract class ...

Can someone help me please with those question1what is the

Can someone help me please with those question 1:what is the best data type for student id datatime,currency,number,decimal 2:which relationshipis preferable? one to one,one to many,many to many 3:if you add table A's pr ...

Assessment database and multithread programmingtasktask 1

Assessment: Database and Multithread Programming Task Task 1: Grade Processing University grading system maintains a database called "GradeProcessing" that contains number of tables to store, retrieve and manipulate stud ...

Solving 2nd degree equationsbull write the following java

Solving 2nd degree equations • Write the following Java methods • boolean real-sols(double a, double b, double c): it returns true if the 2nd degree equation ax2 + bx + c has real solutions • double solution1(double a, d ...

  • 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