Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Programming Language Expert

Assignment - Computer Dating

Class DateProfile

Create a class called DateProfile that has the following private instance members:

gender - a char, the gender of the applicant ('M' or 'F').

searchGender - a char, the gender of desired partner ('M' or 'F'). This is not the gender of the applicant, but of the applicant's requested partner.

romance - an int from 1 to 10, indicating the importance of romance to the applicant.

finance - an int from 1 to 10, indicating the importance of finance to the applicant.

name - a String indicating the full name of the applicant.

Each object in the DateProfile class represents an applicant's profile. If the object is ('M', 'F', 7, 4, "Hugh Hefner") then the applicant's name is "Hugh Hefner", he's looking for a date who is Female, with romance being somewhat important (7) and finance being less important (4).

You should supply all of the following member functions of class DateProfile (at a minimum):

Accessors and Mutators for each field (instance member). For example: char getGender() and boolean setGender(char gdr).

Constructors that take no parameters (default) and all 5 parameters.

double fitValue(DateProfile partner), which returns a number from 0.0 (very bad fit) to 1.0 (perfect fit). The public instance method compares the calling object (this) to the object passed as a parameter. This method should call three private methodsdetermineGenderFit( ... ), determineRomanceFit( ... ) and determineFinanceFit( ... ), that will be used to return intermediate results for each of the three factors. It should multiply the three intermediate numbers together to get and return the final FitValue.

double determineGenderFit(DateProfile partner) returns either a 0 or 1 depending on the gender compatibility of the calling object and the passed parameter object. You have to compare gender compatibility completely: i.e., there must be mutualconsent on this one!

double determineRomanceFit(DateProfile partner) returns a number from 0.0 to 1.0 depending on the romance compatibility of the calling object and the passed parameter object. The romance numbers should be highest (1.0) if the two values are equal (both 3, both 5, both 7) and lowest (perhaps a small non-zero value like .1) if their difference is 9.

double determineFinanceFit(DateProfile partner) returns a number from 0.0 to 1.0 depending on the finance compatibility of the calling object and the passed parameter object. The finance numbers should be highest (1.0) if the two values are equal (both 3, both 5, both 7) and lowest (perhaps a small non-zero value like .1) if their difference is 9.

DateProfile should be a class distinct from (and not contained within) your main class (which we call Foothill). However, you can and should defined it as a non-public class so it can reside in the same file, Foothill.java.

The Client Driver

From your main() inside Foothill, you will instantiate a total of four DateProfile objects, applicant1, ... applicant4 manually from literal values in your program, i.e., do not involve the user with run-time input. Then for each of the four applicants, display the fitswith the others - including themselves. Do this by showing the name of the applicant, then the names and fit values of all applicants relative to this one applicant. Repeat this list for all four applicants producing 16 comparison figures grouped into four groups of four each. (You will be comparing each applicant to his/herself in each of these four groups. This will serve to check whether the result is correct - it must be either a 1 or a 0 depending on the searchGender they requested, but never a number between (can you see why?)).

Programming Language, Programming

  • Category:- Programming Language
  • Reference No.:- M91380964
  • Price:- $40

Guranteed 36 Hours Delivery, In Price:- $40

Have any Question?


Related Questions in Programming Language

Background informationthis assignment tests your

Background Information This assignment tests your understanding of and ability to apply the programming concepts we have covered throughout the unit. The concepts covered in the second half of the unit build upon the fun ...

Overviewthis tasks provides you an opportunity to get

Overview This tasks provides you an opportunity to get feedback on your Learning Summary Report. The Learning Summary Report outlines how the work you have completed demonstrates that you have met all of the unit's learn ...

Php amp session managment assignment -this assignment looks

PHP & SESSION MANAGMENT ASSIGNMENT - This assignment looks at using PHP for creating cookies and session management. Class Exercise - Web Project: Member Registration/Login This exercise will cover adding data connectivi ...

Task working with arraysoverviewin this task you will

Task: Working with Arrays Overview In this task you will create a simple program which will create and work with an array of strings. This array will then be populated with values, printed out to the console, and then, w ...

Task - hand execution of arraysoverviewin this task you

Task - Hand Execution of Arrays Overview In this task you will demonstrate how arrays work by hand executing a number of small code snippets. Instructions Watch the Hand Execution with Arrays video, this shows how to ste ...

Question - create a microsoft word macro using vba visual

Question - Create a Microsoft Word macro using VBA (Visual Basic for Applications). Name the macro "highlight." The macro should highlight every third line of text in a document. (Imagine creating highlighting that will ...

Assignment - proposal literature review research method1

Assignment - Proposal, Literature Review, Research Method 1. Abstract - Summary of the knowledge gap: problems of the existing research - Aim of the research, summary of what this project is to achieve - Summary of the a ...

Task arrays and structsoverviewin this task you will

Task: Arrays and Structs Overview In this task you will continue to work on the knight database to help Camelot keep track of all of their knights. We can now add a kingdom struct to help work with and manage all of the ...

Assignment - haskell program for regular expression

Assignment - Haskell Program for Regular Expression Matching Your assignment is to modify the slowgrep.hs Haskell program presented in class and the online notes, according to the instructions below. You may carry out th ...

Assignment - horse race meetingthe assignment will assess

Assignment - Horse Race Meeting The Assignment will assess competencies for ICTPRG524 Develop high level object-oriented class specifications. Summary The assignment is to design the classes that are necessary for the ad ...

  • 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