Create a class called dateprofile

Assignment Help Programming Languages
Reference no: EM13811011

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

Reference no: EM13811011

Questions Cloud

Explain what magnetically attractable : Explain what magnetically attractable is the same thing as magnetizable
How does product and service design impact the organization : How does Product and Service Design impact the organization? Explain why Strategic Capacity Planning is essential in all businesses both product and service based.
Determine tension in cables and accelerations of block : Determine the tension in the cables and accelerations of block A and B and Calculate the acceleration of the 100-lb cylinder.
What is charismatic leadership : What is charismatic leadership
Create a class called dateprofile : Assignment - Computer Dating, Create a class called DateProfile that has the following private instance members: gender - a char, the gender of the applicant ('M' or 'F')
Define an intrusion of the federal government into state : After reading Information and Intelligence (Including Terrorism) Fusion Centers" and "Fusion Center Success Stories" do you think Fusion Centers perform a valuable role in countering the terrorist threat or do they represent
Examine the persuasive strategies : Examine the persuasive strategies
Describe the role of green sourcing strategies : Describe the role of "green" sourcing strategies in logistics design, and how an organization may be affected by this approach.
Discuss a specific non-state actor that threatens the us : discuss a specific non-state actor that threatens the U.S. today. Which type of non-traditional threat are they. Are they easy to label/categorize

Reviews

Write a Review

Programming Languages Questions & Answers

  Lunix

Compare the total number of links in a 20 node network for:

  Write program that compute the amount person earn

Write a program which computes the amount a person would earn over period of time if his or her salary is one penny the first day, two pennies second day.

  Develop program for concrete class in hierarchy

Develop program which reference objects of each concrete (non-abstract) class in hierarchy. Write down abstract method "display" which determines whether displayed shape is TwoDimensionalShape.

  Write vl program to convert leagues-number of nautical miles

Write a VL program which will convert 20,000 leagues to number of nautical miles. Your program requires no input elements, just elements to compute result and output how many nautical miles is equivalent to 20,000 leagues.

  Prepare program that loads memory value of integer variable

Write a program that loads from memory the value of integer variable SCORE. Next set character variable GRADE to 'A', 'B', 'C', 'D', or 'F' depending on value SCORE.

  Implement to do a matrix-matrix product

Implement and check the time to do a matrix-matrix product of a 1000x500 matrix with a 500x800 matrix of floats sequentially and using 1,2,3,4, and 8 threads on dual and quad core processors.

  Questions on programing problem with the process of analysis

Questions on Programing Problem with the process of analysis and reflection that went on as you developed the project.

  Hubspot: inbound marketing and web 2.0

Hubspot: Inbound Marketing and Web 2.0

  Program to find real solutions

Method, which determines whether value of "b squared" - 4ac is negative. If negative, code then  prints out message "no real solutions" and returns from method.

  What is the difference between the two statements

What is the difference between the following two statements?

  Write a program that computes the monthly gross pay

The owners of the Super Supermarket would like to have a program that computes the monthly gross pay of their employees as well as the employee's net pay.

  Users selection and return to menu

Create a menu that will allow the user to list all wines by name in alphabetic order and count all wines in each type and list all 5 types with their count

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