package eecs1022.finalc; import java.util.Random; /** * A Social Insurance Number card has a number. */ public class SINCard { private int number; /** * Initializes this SIN card with the given number. * * @param number the number of this card. */ public SINCard(int number) { this.number = number; } /** * Initializes this SIN card with a random number. */ public SINCard() { Random random = new Random(); this.number = Math.abs(random.nextInt()); } /** * Returns a string representation of this card. * This string consists of the String "SIN card " followed * by the number of the card. * * @return a string representation of this card. */ public String toString() { return "SIN card " + this.number; } /** * Tests whether the number of this card is even. * * @return true if the number of this card is even, * false otherwise. */ public boolean isEven() { return this.number % 2 == 0; } }