Skip to content

Instantly share code, notes, and snippets.

@aidapsibr
Created April 18, 2017 19:24
Show Gist options
  • Save aidapsibr/a35336f60b7d9b8d1e397e649f09098d to your computer and use it in GitHub Desktop.
Save aidapsibr/a35336f60b7d9b8d1e397e649f09098d to your computer and use it in GitHub Desktop.
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