Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.51 KB | None | 0 0
  1. public class NBA {
  2. public static void main(String[] args) {
  3. Team EJK = new Team ("raptors", "Evan Kim", "John Lagousakos");
  4. Team John = new Team ("lakers", "John Smith", "Chris Leonard");
  5. John.setmyprimaryPlayers(6);
  6. EJK.setmyprimaryPlayers(10);
  7. //EJK.getmyprimaryPlayers();
  8. //John.getmyprimaryPlayers();
  9. //if (6 > 5);
  10. //System.out.println("John's Roster is bigger than EJK's");
  11.  
  12. int playercount1 = John.getmyprimaryPlayers();
  13. int playercount2 = EJK.getmyprimaryPlayers();
  14.  
  15. Analyzer tool = new Analyzer(); // Instantiated a new Analyzer object and named it 'tool'
  16. int checkLargerTeam = tool.isLarger(playercount1, playercount2); // Called a method from tool and made an int variable 'checkLargerTeam'
  17. System.out.print("placeholder here: " + checkLargerTeam);
  18.  
  19. Arena madisonsquareGarden = new Arena (EJK);
  20. int uppderdeckGarden = EJK.getupperdeckCap();
  21. }
  22. }
  23.  
  24. class Team {
  25. int primaryPlayers = 5;
  26. int secondaryPlayers = 8;
  27. String Coach;
  28. String assistantCoach;
  29. String Owner;
  30. String teamName;
  31. String Location; // Move this into Arena class
  32.  
  33. public Team (String teamName, String Coach, String Owner) {
  34. this.teamName = teamName;
  35. this.Coach = Coach;
  36. this.Owner = Owner;
  37.  
  38. }
  39.  
  40. public int getmyprimaryPlayers() {
  41. return primaryPlayers;
  42. }
  43.  
  44. public void setmyprimaryPlayers(int primeCount) {
  45. primaryPlayers = primeCount;
  46. }
  47.  
  48. public int getmysecondaryPlayers() {
  49. return secondaryPlayers;
  50. }
  51.  
  52. public void setmysecondaryPlayers(int secondCount) {
  53. secondaryPlayers = secondCount;
  54. }
  55. }
  56.  
  57. class Analyzer {
  58. public int isLarger(int team1, int team2) {
  59. if (team1 > team2) {
  60. return team1;
  61. } else {
  62. return team2;
  63. }
  64. }
  65. }
  66.  
  67. // Make a class called Arena. Make functionality such that you can put teams into Arena.
  68. class Arena {
  69. Team team;
  70. int upperdeckCap = 10000;
  71. int lowerdeckCap = 8000;
  72. double uppderdeckTicket = 16.25;
  73. double lowerdeckTicket = 42.58;
  74. public Arena (Team team) {
  75. this.team = team;
  76. }
  77.  
  78. public int getuppderdeckCap(){
  79. return upperdeckCap;
  80. }
  81.  
  82. public void setupperdeckCap (int udCap) {
  83. upperdeckCap = udCap;
  84. }
  85.  
  86. public int getlowerdeckCap (){
  87. return lowerdeckCap;
  88. }
  89.  
  90. public void setlowerdeckCap (int ldCap) {
  91. lowerdeckCap = ldCap;
  92. }
  93. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement