c++ coding assignment!

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: May 2007
Posts: 1
Reputation: lilmiss is an unknown quantity at this point 
Solved Threads: 0
lilmiss lilmiss is offline Offline
Newbie Poster

c++ coding assignment!

 
0
  #1
May 31st, 2007
Create a class called DateProfile that has the following private instance members:
  • gender - a char, the gender of the applicant.('M' or 'F').
  • search_gender - a char, the gender ('M' or 'F') of desired partner (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 (F, 7, 4, "Hugh Heffner") then the applicant's name is "Hugh Heffner", 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 (at a minimum):
  • Accessors and Mutators for each field (instance member). For example: char GetGender() and bool 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 methods DetermineGenderFit( ... ), 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 mutual consent 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.
You should instantiate a total of 4 DateProfile objects, applicant1, ... applicant4, either manually from literal values in your program or by getting information from the user. Then for each of the four applicants, display the fits with the others. Do this by showing the name of the applicant, then the names and fit values of all applicants relative to this one applicant (repeat the applicant in his/her own list to see if result is correct - it will be either a 1 or a 0 depending on the search_gender they requested, but never a number between (why?)). Repeat this list for all four applicants:
http://etudes-ng.fhda.edu/access/con...a_Ass7_pic.jpg








Make sure all mutators, constructors and other methods that affect private data adequately test for illegal values and, if possible, return a boolean that reports the results of this test..
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 647
Reputation: jaepi is an unknown quantity at this point 
Solved Threads: 4
jaepi's Avatar
jaepi jaepi is offline Offline
Practically a Master Poster

Re: c++ coding assignment!

 
0
  #2
May 31st, 2007
is this your assignment?
Retreat!!!
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 5,850
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 751
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: c++ coding assignment!

 
0
  #3
May 31st, 2007
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 212
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: c++ coding assignment!

 
0
  #4
May 31st, 2007
Seems like a pretty well predigested assignment, you shouldn't have any trouble implementing that.
Even if you're braindead and can't think much for yourself you should find it pretty easy to do by just following the instructions to the letter, no independent thinking required.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC