Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class NBA_Player {
- String Name;
- int Nummer;
- int Alter;
- String Team;
- int Pts;
- int Reb;
- int Ast;
- void makes_FreeThrow(){
- System.out.println( "LeBron james makes a Free Throw\n");
- Pts++;
- }
- void takes_Rebound(){
- System.out.println("LeBron James takes a Rebound\n");
- Reb++;
- }
- void makes_Layup(){
- System.out.println("LeBron James makes a Layup\n");
- Pts++;
- Pts++;
- }
- void makes_Assist(){
- System.out.println("LeBron James makes an Assist\n");
- Ast++;
- }
- public static void main(String[] args) {
- NBA_Player LeBron = new NBA_Player();
- LeBron.Name="LeBron James";
- LeBron.Nummer=23;
- LeBron.Alter=32;
- LeBron.Team="Cleveland Cavaliers";
- LeBron.Pts=0;
- LeBron.makes_FreeThrow();
- System.out.println("LeBron James has " + LeBron.Pts + " Point(s)\n");
- LeBron.takes_Rebound();
- System.out.println("LeBron James has " + LeBron.Reb + " Rebound(s)\n");
- LeBron.makes_Layup();
- System.out.println("LeBron James has " + LeBron.Pts + " Point(s)\n");
- LeBron.takes_Rebound();
- System.out.println("LeBron James has " + LeBron.Reb + " Rebound(s)\n");
- LeBron.makes_Layup();
- System.out.println("LeBron James has " + LeBron.Pts + " Point(s)\n");
- LeBron.makes_Assist();
- System.out.println("LeBron James has " + LeBron.Ast + " Assist(s)\n");
- }
- }
Add Comment
Please, Sign In to add comment