Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Practically every real-world professional program in existence today uses some t

ID: 3664611 • Letter: P

Question

Practically every real-world professional program in existence today uses some type of modular designthis is just the way programs are designed and built. As a result, the primary objective of this lab is for you to understand how modular programs are designed and how data are passed between modules as the program is executing. This may be one of the most important lessons of this course, so it is critical that you focus on the modular design of the program; if you have any questions, post them to the Lab Forum threaded discussion. In this project, we are going to use the Week 4 Hockey Player Statistics program that you created last week as a starting point and make a few minor changes in the program requirements. What you will do is take the existing project and with only slight modifications to the form design you will modularize the design of the code and then add a few new requirements. As you will see when you complete the modular program design you will be able to add the new requirements to the design algorithm much more easily. One very important point is that the logic used in the modules is virtually identical to the logic used in the Week 4 assignment, with the only major difference being that the code has been moved into sub procedures and functions. However, this comes at a price because the communication of the modules becomes more complex; however, the gains in efficiency in creating the original program and then modifying the program when requirements change (as they always will) outweigh the negative effects of communication complexity. Practically every real-world professional program in existence today uses some type of modular designthis is just the way programs are designed and built. As a result, the primary objective of this lab is for you to understand how modular programs are designed and how data are passed between modules as the program is executing. This may be one of the most important lessons of this course, so it is critical that you focus on the modular design of the program; if you have any questions, post them to the Lab Forum threaded discussion. In this project, we are going to use the Week 4 Hockey Player Statistics program that you created last week as a starting point and make a few minor changes in the program requirements. What you will do is take the existing project and with only slight modifications to the form design you will modularize the design of the code and then add a few new requirements. As you will see when you complete the modular program design you will be able to add the new requirements to the design algorithm much more easily. One very important point is that the logic used in the modules is virtually identical to the logic used in the Week 4 assignment, with the only major difference being that the code has been moved into sub procedures and functions. However, this comes at a price because the communication of the modules becomes more complex; however, the gains in efficiency in creating the original program and then modifying the program when requirements change (as they always will) outweigh the negative effects of communication complexity.

Explanation / Answer

public class HockeyPlayer {

private final IntegerProperty playerId;
private final StringProperty playerName;
private final StringProperty playerPosition;
private final StringProperty playerHeight;
private final IntegerProperty playerWeight;
private final StringProperty playerDob;
private final ObservableList<HockeyPlayerStats> playerStats;

public HockeyPlayer(Integer playerId, String playerName, String playerPosition, String playerHeight, Integer playerWeight, String playerDob) {
this.playerId = new SimpleIntegerProperty(playerId);
this.playerName = new SimpleStringProperty(playerName);
this.playerPosition = new SimpleStringProperty(playerPosition);
this.playerHeight = new SimpleStringProperty(playerHeight);
this.playerWeight = new SimpleIntegerProperty(playerWeight);
this.playerDob = new SimpleStringProperty(playerDob);
this.playerStats = FXCollections.observableArrayList();
}

public HockeyPlayer(Integer playerId, String playerName, String playerPosition, String playerHeight, Integer playerWeight, String playerDob, HockeyPlayerStats playerStats) {
this.playerId = new SimpleIntegerProperty(playerId);
this.playerName = new SimpleStringProperty(playerName);
this.playerPosition = new SimpleStringProperty(playerPosition);
this.playerHeight = new SimpleStringProperty(playerHeight);
this.playerWeight = new SimpleIntegerProperty(playerWeight);
this.playerDob = new SimpleStringProperty(playerDob);
this.playerStats = FXCollections.observableArrayList(playerStats);
}

public void addPlayerStats(HockeyPlayerStats pStat) {
playerStats.add(pStat);
}

public HockeyPlayerStats getPlayerStats(String team) {
for (HockeyPlayerStats pStat : playerStats) {
if (pStat.getTeam().equals(team)) {
return pStat;
}
}
return null;
}

public ObservableList<HockeyPlayerStats> getPlayerStats() {
return playerStats;
}

public Integer getPlayerId() {
return playerId.get();
}

public IntegerProperty playerIdProperty() {
return playerId;
}

public String getPlayerName() {
return playerName.get();
}

public StringProperty playerNameProperty() {
return playerName;
}

public String getPlayerPosition() {
return playerPosition.get();
}

public StringProperty playerPositionProperty() {
return playerPosition;
}

public String getPlayerHeight() {
return playerHeight.get();
}

public StringProperty playerHeightroperty() {
return playerHeight;
}

public Integer getPlayerWeight() {
return playerWeight.get();
}

public IntegerProperty playerWeightProperty() {
return playerWeight;
}

public String getDateOfBirth() {
return playerDob.get();
}

public StringProperty dobProperty() {
return playerDob;
}

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote