Guest User

Untitled

a guest
Jun 19th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. 3. public class Bridge {
  2. 4. public enum Suits {
  3. 5. CLUBS(20), DIAMONDS(20), HEARTS(30), SPADES(30),
  4. 6. NOTRUMP(40) { public int getValue(int bid) {
  5. return ((bid-1)*30)+40; } };
  6. 7. Suits(int points) { this.points = points; }
  7. 8. private int points;
  8. 9. public int getValue(int bid) { return points * bid; }
  9. 10. }
  10. 11. public static void main(String[] args) {
  11. 12. System.out.println(Suits.NOTRUMP.getBidValue(3));
  12. 13. System.out.println(Suits.SPADES + " " + Suits.SPADES.points);
  13. 14. System.out.println(Suits.values());
  14. 15. }
  15. 16. }
  16.  
  17. System.out.println(Suits.NOTRUMP.getBidValue(3));
Add Comment
Please, Sign In to add comment