Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.41 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. }
  20.  
  21. class Team {
  22. int primaryPlayers = 5;
  23. int secondaryPlayers = 8;
  24. String Coach;
  25. String assistantCoach;
  26. String Owner;
  27. String teamName;
  28. String Location; // Move this into Arena class
  29.  
  30. public Team (String teamName, String Coach, String Owner) {
  31. this.teamName = teamName;
  32. this.Coach = Coach;
  33. this.Owner = Owner;
  34.  
  35. }
  36.  
  37. public int getmyprimaryPlayers() {
  38. return primaryPlayers;
  39. }
  40.  
  41. public void setmyprimaryPlayers(int primeCount) {
  42. primaryPlayers = primeCount;
  43. }
  44.  
  45. public int getmysecondaryPlayers() {
  46. return secondaryPlayers;
  47. }
  48.  
  49. public void setmysecondaryPlayers(int secondCount) {
  50. secondaryPlayers = secondCount;
  51. }
  52. }
  53.  
  54. class Analyzer {
  55. public int isLarger(int team1, int team2) {
  56. if (team1 > team2) {
  57. return team1;
  58. } else {
  59. return team2;
  60. }
  61. }
  62. }
  63.  
  64. // Make a class called Arena. Make functionality such that you can put teams into Arena.
  65. class Arena {
  66. Team team;
  67. int upperdeckCap = 10000;
  68. int lowerdeckCap = 8000;
  69. double uppderdeckTicket = 16.25;
  70. double lowerdeckTicket = 42.58;
  71. public Arena (Team team) {
  72. this.team = team;
  73. }
  74.  
  75. public int getuppderdeckCap(){
  76. return upperdeckCap;
  77. }
  78.  
  79. public void setupperdeckCap (int udCap) {
  80. upperdeckCap = udCap;
  81. }
  82.  
  83. public int getlowerdeckCap (){
  84. return lowerdeckCap;
  85. }
  86.  
  87. public void setlowerdeckCap (int ldCap) {
  88. lowerdeckCap = ldCap;
  89. }
  90. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement