Complete and fully test the class characteristic

Assignment Help JAVA Programming
Reference no: EM13706548

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.

Reference no: EM13706548

Questions Cloud

What is the cardinality of an entity : What is the cardinality of an entity - Why is it useful to consider the cardinality when designing a database?
Database design and end-user requirements : How pervasive are conflicts between database design and end-user requirements? Should the two go hand-in-hands?
Process of designing an er diagram : Does the process of designing an ER diagram ever require more than one iteration? Why or why not?
When would a weak relationship be more suitable : When would a weak relationship be more suitable than a strong relationship? Give concrete examples?
Complete and fully test the class characteristic : Complete and fully test the class Characteristic that Exercise explains. Suppose a class Characteristic that will be used in an online dating service to assess how compatible two people are.
Show numbers between those two numbers in ascending order : Ask the user to type two numbers from range 20-60. Keep on asking until he types in the range of 20-60. Show the numbers between those two numbers in ascending order.
How many numbers they want to have from that number : Modify the previous program to ask the user a number to start and how many numbers they want to have from that number.
Number of space characters in a string : Write a loop that counts the number of space characters in a string - You need to implement a program to find the number of spaces.
Convert the unsigned decimal to the indicated base : Convert the unsigned decimal to the indicated base: 34.50 to octal 37.150 to hexadecimal 73.5 to binary

Reviews

Write a Review

JAVA Programming Questions & Answers

  Make a program that show the sales amount

You have to make a program that show the sales amount. Be sure to include comments. Comments should be included in the program to explain your calculations and program.

  Write a program that converts date formats

Write a program that prompts the user to input an integer between 0 and 35. If the number is less than or equal to 9, the program should output the number; otherwise, it should output A for 10, B for 11, C for 12,..., Z for 35. (Hint: use the case..

  Part-11 exceptions and exception handlinggt create a java

part-11 exceptions and exception handlinggt create a java class called samearraysexception that extends the exception

  Write a method called range that returns the range of value

Write a method called 'range' that returns the range of values in an array of integers. The range is defined as 1 more than the difference between the maximum and minimum values in the array. For example, if an array called list contains the value..

  The williamsburg women''s club

The Williamsburg Women's Club offers scholarships to local high school students who meet any of several criteria. Write an application that prompts the user for a student's numeric high school grade point average (for example, 3.2), the student's num..

  Define a class called counter

Define a class called Counter. An object of this class is used to count things, so it records a count that is a non negative whole number. Include methods to set the counter to 0, to increase the count by

  Will the direction and magnitude be integers or doubles

Define a Physics_vector class which consists of a struct containing the direction and magnitude, and also define a function

  Write a program using an array that will store

Using java programing : Write a program using an array that will store input data. Prompt the user for and read 6 numbers between 70 and 90. Verify the numbers should be greater than 70 and less than 90. If the number is less than

  Java application which creates bank records

Write down a java application which creates 10000 bank records and the allow user ti enter a balance and customer account info. using a an account number.

  You are to implement an intrusion detection system in java

you are to implement an intrusion detection system in java. we are assuming all activities are associated with the same

  Specify, design, and implement a class

Specify, design, and implement a class that can be used in a program that simulates a combination lock. The lock has a circular knob with the numbers 0 through 39 marked on the edge, and it has a three-number combination, which we will call x,y,z.

  Write program that uses a class named rectangle

Write program that uses a class named Rectangle. The class has floating point attributes length and width. it has member functions that calculate the perimeter and area of the rectangle. It also has set and get functions for both length and width.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd