/** * FILE: Rejection.java * AUTHOR: Ivan J Leichtling * INERNET: ivan@columbia.edu * * This file defines a a set of ways for a woman to reject a man */ import java.util.*; public class Rejection { static Random rand = null; // redefine to add more sayings private static final int SWITCHSIZE = 4; String s; public Rejection( String woman, String man ) { if( null == rand ) { rand = new Random(); } switch( Math.abs( rand.nextInt() % SWITCHSIZE ) ) { case 0: s = "\"I'm sorry,\" " + woman + " tells " + man + ", \"It wouldn\'t work out for us.\""; break; case 1: s = woman + " laughs at " + man + ", \"I would never accept your proposal!\""; break; case 2: s = "\"I\'m not ready to commit yet,\"" + woman + " tells " + man + "."; break; default: s = "\"I don\'t want your ring, " + man + ",\" " + woman + " tells him."; break; } } public String toString() { return s; } }