Guest User

Untitled

a guest
Feb 23rd, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. public class NBA_Player {
  2.  
  3. String Name;
  4. int Nummer;
  5. int Alter;
  6. String Team;
  7.  
  8. int Pts;
  9. int Reb;
  10. int Ast;
  11.  
  12. void makes_FreeThrow(){
  13. System.out.println( "LeBron james makes a Free Throw\n");
  14. Pts++;
  15. }
  16.  
  17. void takes_Rebound(){
  18. System.out.println("LeBron James takes a Rebound\n");
  19. Reb++;
  20. }
  21.  
  22. void makes_Layup(){
  23. System.out.println("LeBron James makes a Layup\n");
  24. Pts++;
  25. Pts++;
  26. }
  27.  
  28. void makes_Assist(){
  29. System.out.println("LeBron James makes an Assist\n");
  30. Ast++;
  31. }
  32.  
  33. public static void main(String[] args) {
  34.  
  35. NBA_Player LeBron = new NBA_Player();
  36.  
  37. LeBron.Name="LeBron James";
  38. LeBron.Nummer=23;
  39. LeBron.Alter=32;
  40. LeBron.Team="Cleveland Cavaliers";
  41.  
  42. LeBron.Pts=0;
  43.  
  44. LeBron.makes_FreeThrow();
  45. System.out.println("LeBron James has " + LeBron.Pts + " Point(s)\n");
  46.  
  47. LeBron.takes_Rebound();
  48. System.out.println("LeBron James has " + LeBron.Reb + " Rebound(s)\n");
  49.  
  50. LeBron.makes_Layup();
  51. System.out.println("LeBron James has " + LeBron.Pts + " Point(s)\n");
  52.  
  53. LeBron.takes_Rebound();
  54. System.out.println("LeBron James has " + LeBron.Reb + " Rebound(s)\n");
  55.  
  56. LeBron.makes_Layup();
  57. System.out.println("LeBron James has " + LeBron.Pts + " Point(s)\n");
  58.  
  59. LeBron.makes_Assist();
  60. System.out.println("LeBron James has " + LeBron.Ast + " Assist(s)\n");
  61.  
  62. }
  63.  
  64.  
  65. }
Add Comment
Please, Sign In to add comment