-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Se agregan las prácticas 6 - 14 #19
Open
rod-alvaradoh
wants to merge
1
commit into
master
Choose a base branch
from
ralvhe
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/src/main/java/ralvhe/practices/06-ObjectsClasses_Practice1/build/ | ||
/src/main/java/ralvhe/practices/06-ObjectsClasses_Practice1/nbproject/private/ | ||
/src/main/java/ralvhe/practices/06-ObjectsClasses_Practice2/06-ObjectsClasses_Practice2/build/ | ||
/src/main/java/ralvhe/practices/06-ObjectsClasses_Practice2/06-ObjectsClasses_Practice2/nbproject/private/ | ||
/src/main/java/ralvhe/practices/07-ManipulateFormat_Practice1/build/ | ||
/src/main/java/ralvhe/practices/07-ManipulateFormat_Practice1/nbproject/private/ | ||
/src/main/java/ralvhe/practices/08-Methods_Practice1/build/ | ||
/src/main/java/ralvhe/practices/08-Methods_Practice1/nbproject/private/ | ||
/src/main/java/ralvhe/practices/08-Methods_Practice2/build/ | ||
/src/main/java/ralvhe/practices/08-Methods_Practice2/nbproject/private/ | ||
/src/main/java/ralvhe/practices/08-Methods_Practice3/build/ | ||
/src/main/java/ralvhe/practices/08-Methods_Practice3/nbproject/private/ | ||
/src/main/java/ralvhe/practices/09-EncapConstructors_Practice1/build/ | ||
/src/main/java/ralvhe/practices/09-EncapConstructors_Practice1/nbproject/private/ | ||
/src/main/java/ralvhe/practices/09-EncapConstructors_Practice2/build/ | ||
/src/main/java/ralvhe/practices/09-EncapConstructors_Practice2/nbproject/private/ | ||
/src/main/java/ralvhe/practices/10-Conditions_Practice1/build/ | ||
/src/main/java/ralvhe/practices/10-Conditions_Practice1/nbproject/private/ | ||
/src/main/java/ralvhe/practices/10-Conditions_Practice2/build/ | ||
/src/main/java/ralvhe/practices/10-Conditions_Practice2/nbproject/private/ | ||
/src/main/java/ralvhe/practices/11-ArraysLoopsDates_Practice1/build/ | ||
/src/main/java/ralvhe/practices/11-ArraysLoopsDates_Practice1/nbproject/private/ | ||
/src/main/java/ralvhe/practices/11-ArraysLoopsDates_Practice2/build/ | ||
/src/main/java/ralvhe/practices/11-ArraysLoopsDates_Practice2/nbproject/private/ | ||
/src/main/java/ralvhe/practices/12-UsingInheritance_Practice1/build/ | ||
/src/main/java/ralvhe/practices/12-UsingInheritance_Practice1/nbproject/private/ | ||
/src/main/java/ralvhe/practices/12-UsingInheritance_Practice2/build/ | ||
/src/main/java/ralvhe/practices/12-UsingInheritance_Practice2/nbproject/private/ | ||
/src/main/java/ralvhe/practices/13-UsingInterfaces_Practice1/build/ | ||
/src/main/java/ralvhe/practices/13-UsingInterfaces_Practice1/nbproject/private/ | ||
/src/main/java/ralvhe/practices/13-UsingInterfaces_Practice2/build/ | ||
/src/main/java/ralvhe/practices/13-UsingInterfaces_Practice2/nbproject/private/ | ||
/src/main/java/ralvhe/practices/13-UsingInterfaces_Practice3/build/ | ||
/src/main/java/ralvhe/practices/13-UsingInterfaces_Practice3/nbproject/private/ | ||
/src/main/java/ralvhe/practices/14-Exceptions_Practice1/build/ | ||
/src/main/java/ralvhe/practices/14-Exceptions_Practice1/nbproject/private/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
*.class | ||
*.xml | ||
*.properties | ||
*.mf |
16 changes: 16 additions & 0 deletions
16
src/main/java/ralvhe/practices/06-ObjectsClasses_Practice1/src/soccer/Game.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* | ||
* To change this license header, choose License Headers in Project Properties. | ||
* To change this template file, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
package soccer; | ||
|
||
/** | ||
* | ||
* @author ralhe | ||
*/ | ||
public class Game { | ||
public Team homeTeam; | ||
public Team awayTeam; | ||
public Goal[] goals; | ||
} |
16 changes: 16 additions & 0 deletions
16
src/main/java/ralvhe/practices/06-ObjectsClasses_Practice1/src/soccer/Goal.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* | ||
* To change this license header, choose License Headers in Project Properties. | ||
* To change this template file, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
package soccer; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. la estructura del paquete debería ser algo como lo que sigue: |
||
|
||
/** | ||
* | ||
* @author ralhe | ||
*/ | ||
public class Goal { | ||
public Team theTeam; | ||
public Player thePlayer; | ||
public double theTime; | ||
} |
50 changes: 50 additions & 0 deletions
50
src/main/java/ralvhe/practices/06-ObjectsClasses_Practice1/src/soccer/League.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* To change this license header, choose License Headers in Project Properties. | ||
* To change this template file, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
package soccer; | ||
|
||
/** | ||
* | ||
* @author ralhe | ||
*/ | ||
public class League { | ||
|
||
/** | ||
* @param args the command line arguments | ||
*/ | ||
public static void main(String[] args) { | ||
// TODO code application logic here | ||
Player player1 = new Player(); | ||
player1.playerName = "George Eliot"; | ||
Player player2 = new Player(); | ||
player2.playerName = "Graham Greene"; | ||
Player player3 = new Player(); | ||
player3.playerName = "Geoffrey Chaucer"; | ||
Player[] thePlayers = {player1,player2,player3}; | ||
Team team1 = new Team(); | ||
team1.teamName = "The Greens"; | ||
team1.playerArray = thePlayers; | ||
player1.playerName = "Robert Service"; | ||
|
||
Team team2 = new Team(); | ||
team2.teamName = "The Reds"; | ||
team2.playerArray = new Player[3]; | ||
team2.playerArray[0] = new Player(); | ||
team2.playerArray[0].playerName = "Robert Service"; | ||
team2.playerArray[1] = new Player(); | ||
team2.playerArray[1].playerName = "Robbie Burns"; | ||
team2.playerArray[2] = new Player(); | ||
team2.playerArray[2].playerName = "Rafael Sabatini"; | ||
|
||
for(Player thePlayer:team1.playerArray){ | ||
System.out.println(thePlayer.playerName); | ||
} | ||
|
||
for(Player thePlayer : team2.playerArray){ | ||
System.out.println(thePlayer.playerName); | ||
} | ||
} | ||
|
||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/ralvhe/practices/06-ObjectsClasses_Practice1/src/soccer/Player.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
* To change this license header, choose License Headers in Project Properties. | ||
* To change this template file, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
package soccer; | ||
|
||
/** | ||
* | ||
* @author ralhe | ||
*/ | ||
public class Player { | ||
public String playerName; | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/ralvhe/practices/06-ObjectsClasses_Practice1/src/soccer/Team.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* | ||
* To change this license header, choose License Headers in Project Properties. | ||
* To change this template file, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
package soccer; | ||
|
||
/** | ||
* | ||
* @author ralhe | ||
*/ | ||
public class Team { | ||
public String teamName; | ||
public Player[] playerArray; | ||
} |
19 changes: 19 additions & 0 deletions
19
...he/practices/06-ObjectsClasses_Practice2/06-ObjectsClasses_Practice2/src/soccer/Game.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* To change this license header, choose License Headers in Project Properties. | ||
* To change this template file, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
|
||
package soccer; | ||
|
||
/** | ||
* | ||
* @author Administrator | ||
*/ | ||
public class Game { | ||
|
||
public Team homeTeam; | ||
public Team awayTeam; | ||
public Goal[] goals; | ||
|
||
} |
19 changes: 19 additions & 0 deletions
19
...he/practices/06-ObjectsClasses_Practice2/06-ObjectsClasses_Practice2/src/soccer/Goal.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* To change this license header, choose License Headers in Project Properties. | ||
* To change this template file, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
|
||
package soccer; | ||
|
||
/** | ||
* | ||
* @author Administrator | ||
*/ | ||
public class Goal { | ||
|
||
public Team theTeam; | ||
public Player thePlayer; | ||
public double theTime; | ||
|
||
} |
70 changes: 70 additions & 0 deletions
70
.../practices/06-ObjectsClasses_Practice2/06-ObjectsClasses_Practice2/src/soccer/League.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/* | ||
* To change this license header, choose License Headers in Project Properties. | ||
* To change this template file, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
|
||
package soccer; | ||
|
||
/** | ||
* | ||
* @author Administrator | ||
*/ | ||
public class League { | ||
|
||
/** | ||
* @param args the command line arguments | ||
*/ | ||
public static void main(String[] args) { | ||
|
||
// Create team1 | ||
Player player1 = new Player(); | ||
player1.playerName = "George Eliot"; | ||
Player player2 = new Player(); | ||
player2.playerName = "Graham Greene"; | ||
Player player3 = new Player(); | ||
player3.playerName = "Geoffrey Chaucer"; | ||
Player[] thePlayers = {player1, player2, player3 }; | ||
|
||
Team team1 = new Team(); | ||
team1.teamName = "The Greens"; | ||
team1.playerArray = thePlayers; | ||
|
||
|
||
// Create team2 | ||
Team team2 = new Team(); | ||
team2.teamName = "The Reds"; | ||
team2.playerArray = new Player[3]; | ||
team2.playerArray[0] = new Player(); | ||
team2.playerArray[0].playerName = "Robert Service"; | ||
team2.playerArray[1] = new Player(); | ||
team2.playerArray[1].playerName = "Robbie Burns"; | ||
team2.playerArray[2] = new Player(); | ||
team2.playerArray[2].playerName = "Rafael Sabatini"; | ||
|
||
Game currGame = new Game(); | ||
currGame.awayTeam = team1; | ||
currGame.homeTeam = team2; | ||
|
||
Goal goal1 = new Goal(); | ||
goal1.thePlayer = currGame.homeTeam.playerArray[2]; | ||
goal1.theTeam = currGame.homeTeam; | ||
goal1.theTime = 55; | ||
|
||
Goal[] theGoals = {goal1}; | ||
currGame.goals = theGoals; | ||
|
||
System.out.println("Goal scored after " + currGame.goals[0].theTime + " mins by " + currGame.goals[0].thePlayer.playerName + " of " +currGame.goals[0].theTeam.teamName); | ||
|
||
/* Practice 6-2. Create a Game here */ | ||
|
||
/* Practice 6-2. Create a Goal object here */ | ||
|
||
/* Practice 6-2. Put Goal object in a Goal array and assign Goal array to goals attribute of Game object */ | ||
|
||
/* Practice 6-2. Print out the score of the Game */ | ||
|
||
|
||
|
||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
.../practices/06-ObjectsClasses_Practice2/06-ObjectsClasses_Practice2/src/soccer/Player.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
* To change this license header, choose License Headers in Project Properties. | ||
* To change this template file, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
|
||
package soccer; | ||
|
||
/** | ||
* | ||
* @author Administrator | ||
*/ | ||
public class Player { | ||
|
||
public String playerName; | ||
|
||
} |
18 changes: 18 additions & 0 deletions
18
...he/practices/06-ObjectsClasses_Practice2/06-ObjectsClasses_Practice2/src/soccer/Team.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* To change this license header, choose License Headers in Project Properties. | ||
* To change this template file, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
|
||
package soccer; | ||
|
||
/** | ||
* | ||
* @author Administrator | ||
*/ | ||
public class Team { | ||
|
||
public String teamName; | ||
public Player[] playerArray; | ||
|
||
} |
19 changes: 19 additions & 0 deletions
19
src/main/java/ralvhe/practices/07-ManipulateFormat_Practice1/src/soccer/Game.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* To change this license header, choose License Headers in Project Properties. | ||
* To change this template file, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
|
||
package soccer; | ||
|
||
/** | ||
* | ||
* @author Administrator | ||
*/ | ||
public class Game { | ||
|
||
public Team homeTeam; | ||
public Team awayTeam; | ||
public Goal[] goals; | ||
|
||
} |
19 changes: 19 additions & 0 deletions
19
src/main/java/ralvhe/practices/07-ManipulateFormat_Practice1/src/soccer/Goal.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* To change this license header, choose License Headers in Project Properties. | ||
* To change this template file, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
|
||
package soccer; | ||
|
||
/** | ||
* | ||
* @author Administrator | ||
*/ | ||
public class Goal { | ||
|
||
public Team theTeam; | ||
public Player thePlayer; | ||
public double theTime; | ||
|
||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Este archivo debe de ir en la raiz del proyecto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
checa la siguiente pagina para mas informacion: https://help.github.com/articles/ignoring-files/