File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes simple dating program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "simple dating program" Watch "simple dating program" New topic
Author

simple dating program

Brad Cantrell
Greenhorn

Joined: Aug 27, 2005
Posts: 22
This is a dating program Im making that compares profiles of 4 people on a scale of 0.0 to 1.0. The data the people have is their name, sex, desired sex of mate which has to be mutual or they automatially get 0.0, otherwise they are compared with their finance and romance numbers both between 0.0 and 1.0 and then the greater the difference between these averaged numbers the lower the overall score. This program is giving me weird results, and its frying my brain to figure out why, if anyone can help Id appreciate it.


Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42276
    
  64
What does "giving me weird results" mean? What is it doing, and what were you expecting?


Ping & DNS - my free Android networking tools app
Brad Cantrell
Greenhorn

Joined: Aug 27, 2005
Posts: 22
Ulf- This is what I get when I run the program, I just think its strange that each person is only getting a response from one person of the opposite sex when there are two people of the opposite sex that they should get a response from.

John
John fit: 0.0
Mary fit: 0.0
George fit: 0.0
Ellen fit: 0.060000000000000005
Mary
John fit: 0.0
Mary fit: 0.0
George fit: 0.06000000000000001
Ellen fit: 0.0
George
John fit: 0.0
Mary fit: 0.0
George fit: 0.0
Ellen fit: 0.30000000000000004
Ellen
John fit: 0.060000000000000005
Mary fit: 0.0
George fit: 0.0
Ellen fit: 0.0
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42276
    
  64
It may be due to the fact that you're mixing uppercase and lowercase letters for the genders, which you are then comparing using "==". Remember that 'M' != 'm'
Brad Cantrell
Greenhorn

Joined: Aug 27, 2005
Posts: 22
Ah you're right, thanks Ulf.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: simple dating program