(I pushed the code button to write the code above. Do I push it again to stop it?)
I could not access the site you noted concerning code, but I think I understand what you are trying to say.
You asked me write on a piece of paper what I wanted to do first. Here it is. If the applicant's gender is male and the partner's gender is female and if the applicant's gender is female and the partner's gender is male then the method prints 1.0. Else the method prints 0.0.
lee shotwell wrote:Reply to Tony Docherty
If you scroll up to the start of my DateProfile post (3 June, 2013 03:48:10) you will see the four objects I created. Two of the applicants are male ( the first char after the name denotes that fact) and two female applicants.
lee shotwell wrote:
DateProfile applicant1 = new DateProfile("Tom James", 'M', 'F', 9, 5);
DateProfile applicant2 = new DateProfile("Jantima Shotwell",'F', 'M', 2, 8);
DateProfile applicant3 = new DateProfile("Michael Loceff", 'F', 'M', 6, 2);
DateProfile applicant4 = newDateProfile("Sumalee Sreenok", 'F', 'M', 7, 7);
I want my determineGenderFit(DateProfile partner) method to match Tom James (a male) with female applicants only for a score of 1.0.
1. Tom James compared to Tom James gives me 1.0. It should be 0.0. I have not tried to fix this problem yet.
lee shotwell wrote:the instructor made those mistakes in the description of the exercise...
lee shotwell wrote:I was taking an online course some time ago and the instructor made those mistakes in the description of the exercise and he did the same in his sample program. I thought that I had better follow his naming conventions or otherwise I might have points deducted. If you scroll down to the bottom of the page where the Sheriff listed some other programs to look at, the first one you see is another DateProfile program. This student did the same thing as I did because he had the same instructor. When I sort out my logic problems in this program I will go through the entire program and make the changes to the mistakes noted by you and the Sheriff. I was being a sheep and not doing what I should have done in the first place.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Ivan Jozsef Balazs wrote:How does this even compile? Or I am missing something (like a dot or whatnot)?
lee shotwell wrote:I only want fits between males and females. Fits between males should be 0.0 and fits between females and females should also be 0.0. Never a number in between.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
lee shotwell wrote:Comments: The applicants' fits with themselves should not be 1.0. They should be 0.0.
Otherwise, this program will work depending upon the numbers I enter for romance and finance.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
I will type it because I have trouble with the paste process.
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!,
lee shotwell wrote:The instructions for this assignment are why I am doing the things you noted. I am to...
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
lee shotwell wrote:Reply to Tony Docherty and Winston Gutkowski
I tried to paste and now I have lost my entire class DateProfile so I will have to create it again.
lee shotwell wrote:Reply to Tony Docherty and Winston Gutkowski
What I need are clear and concise instructions on how to paste into this website. The way I tried to do it were as follows: Ctr a > Ctr v > return to moose website > push code button > Ctr v (to paste).
lee shotwell wrote:I made a post to this site on 30 July, 2013 at 06:51:48. I encluded a paste of my complete program with comments. Did you receive it? I ask because when I looked for my post at the site, I did not see it so I went to Java in General > DateProfile and saw a notation that I had made a post. Hence, there it was. I do not mean to bug you because I know you are very busy. Again, thanks for all he help you have provided me concerning this frustrating program. Give me a post only when you have the time to do it.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
lee shotwell wrote:Winston said that there is not anything in the exercise instructions that prohibit an applicant selecting a same sex partner. Winston is right, however I assumed that was not what the instructor wanted because in his sample output, which I posted to you already, he only showed males selecting females and females selecting males only. Furthermore, the instructor showed that he wanted a 0.0 value when an applicant is compared to him/herself.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
lee shotwell wrote:Reply to Tony Docherty and Winston Gutkowski
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Consider Paul's rocket mass heater. |