Created
April 18, 2017 19:24
-
-
Save aidapsibr/a35336f60b7d9b8d1e397e649f09098d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Human; | |
public class Message | |
{ | |
private Human you; | |
private Human me; | |
/** OKCupid is not imported because | |
it is part of the package file **/ | |
public static void main(String[] args) | |
{ | |
OKCupid cupid = new OKCupid(); | |
you = (Human) cupid.getViewer(); | |
me = Human.getSelf(); | |
//In miles | |
double distance = you.distance(me); | |
if (you.getAge() < 35 | |
&& you.isWillingToReachOut(me) | |
&& (distance <= 4 | |
|| (you.hasACar() | |
&& you.willingToDrive()))) | |
{ | |
you.sendMessage(me); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment