Question Details

Answered: - ITK 275 - Java as a 2nd Language Chapter 8 Programming


Please see the attached. Kindly give me your best as usual. Thanks


ITK 275 ? Java as a 2nd Language

 

Chapter 8 Programming Assignment

 


 

All of the java classes should be placed in a package named

 

edu.iltu.itk275.assignment8.ulid. The classes should be submitted as an attachment to

 

this assignment. They may be submitted individually or placed into a single archive

 

(.zip) file.

 


 

Part I:

 

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

 

Its methods are:

 

? 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.

 

? A private method isValidRating(aRating) that returns true if the given rating is valid,

 

that is, between 1 and 10.

 

? A setRating(aRating) method that sets the rating to aRating if it is valid

 

? A setRating() method that reads a rating from the keyboard, insisting that the rating

 

supplied by the user be valid.

 

? A getDescription method that returns the description of this characteristic

 

? A getRating method that returns the rating of this characteristic.

 

? A getCompatability(Characteristic otherRating) method that returns the compatibility

 

measure of two matching characteristics or zero if the descriptions do not match

 

? A private isMatch(Characteristic otherRating) method returns true of the descriptions

 

match

 

? A private getCompatibilityMeasure(Characteristic other Rating) method that returns a

 

compatibility measure as a double value using the formula below when both ratings are

 

non zero. If either rating is zero, then m will be zero:

 


 

m = 1 - ( (( r1 - r2) (r1 - r2)) / 81)

 

Part II:

 

Create an interface MessageEncoder that has a single abstract method

 

encode(plainText) where plainText is the message to be encoded. The method will

 

return the encoded message. Both the plain text and encoded messages are represented as

 

String.

 

Create a class SubstitutionCipher that implements the interface MessageEncoder as

 

described earlier. The constructor should have one parameter called shift. Define the

 


 

ITK 275 ? Java as a 2nd Language

 

Chapter 8 Programming Assignment

 

method encode so that each letter is shifted by the value in shift. For example, if shift is

 

3, ?a? will be replaced by ?d?, ?b? will be replaced by ?e?, ?c? will be replaced by ?f?, and so

 

on. To implement this, define a private method that shifts a single character.

 

Create a class ShuffleCipher that implements the interface MessageEncoder as

 

described earlier. The constructor should have one parameter call n. Define the method

 

encode so that the message is shuffled n times. To perform one shuffle, split the message

 

in half and then take characters from each half alternately: for example, if the message is

 

abcdefghi, the halves are ?abcde? and ?fghi?. The shuffled message is ?afbgchdie?. To

 

implement this, define a private method that performs a single shuffle.

 


 

 


Solution details:
STATUS
Answered
QUALITY
Approved
ANSWER RATING

This question was answered on: Oct 07, 2020

PRICE: $15

Solution~0002233088.zip (25.37 KB)

Buy this answer for only: $15

This attachment is locked

We have a ready expert answer for this paper which you can use for in-depth understanding, research editing or paraphrasing. You can buy it or order for a fresh, original and plagiarism-free copy (Deadline assured. Flexible pricing. TurnItIn Report provided)

Pay using PayPal (No PayPal account Required) or your credit card . All your purchases are securely protected by .
SiteLock

About this Question

STATUS

Answered

QUALITY

Approved

DATE ANSWERED

Oct 07, 2020

EXPERT

Tutor

ANSWER RATING

GET INSTANT HELP/h4>

We have top-notch tutors who can do your essay/homework for you at a reasonable cost and then you can simply use that essay as a template to build your own arguments.

You can also use these solutions:

  • As a reference for in-depth understanding of the subject.
  • As a source of ideas / reasoning for your own research (if properly referenced)
  • For editing and paraphrasing (check your institution's definition of plagiarism and recommended paraphrase).
This we believe is a better way of understanding a problem and makes use of the efficiency of time of the student.

NEW ASSIGNMENT HELP?

Order New Solution. Quick Turnaround

Click on the button below in order to Order for a New, Original and High-Quality Essay Solutions. New orders are original solutions and precise to your writing instruction requirements. Place a New Order using the button below.

WE GUARANTEE, THAT YOUR PAPER WILL BE WRITTEN FROM SCRATCH AND WITHIN YOUR SET DEADLINE.

Order Now