1. Make a WPF Application using C# in Visual Studio and name it as MTYourFirstnameLastname. 2. Design and implement an app having multiple windows that displays and manages information of players of different sports – Ice Hockey, Basketball, and Baseball. 3. The app maintains generic collections of these players. 4. The app can read, add, update, and delete the data. 5. Use LINQ whenever you need to read or fetch data. 6. The app should come preloaded with 5 pieces of data for each collection. 7. The main window should have three buttons (View Ice Hockey Players, View Basketball Players, View Baseball Players) that displays a new window for that particular sports player. 8. Each new window has a ListBox that gets populated with the player names. 9. On selecting a name from the ListBox, display the data in the TextBoxes. Faculty of Applied Science & Technology Page 2 of 3 10. Add buttons to insert/update/delete data for that particular sports player. • Show a message box with an error message for incorrect inputs. • When inserting a new player, do not ask for Player ID, rather generate a new one. The Player ID must be unique for every player, just like a primary key in database. • When editing an existing player, do not ask the user to edit the Player ID. Keep that textbox readonly. It must be unique for every player and must not be edited. 11. Display the player’s data windows as dialog boxes (by using ShowDialog() method). 12. When displaying player’s data windows, do not close the MainWindow. Gursharan Singh Tatla (Winter 2023) 13. Note: • All windows should not be the default grey colour but instead should be dressed up. • Use whatever layout panels you want to use: Grid, StackPanel, Canvas or any other layout. • Use your own imagination to layout the controls and design the app. • You should have a message box asking the user to confirm if they wish to delete or update the data for all collections. • Format all the message boxes with appropriate caption, buttons, and image. Classes: 1. Create a parent class Player which must be declared as abstract. 2. Then derive three child classes from the Player class: • HockeyPlayer • BasketballPlayer • BaseballPlayer 3. Use enum to represent different types of players. If you ever need to find what type of player it is, do not compare it with string, rather make use of enum. • Do: if (playerType == PlayerType.HockeyPlayer) Where, PlayerType is declared as an enum. • Don’t: if (playerType == "HockeyPlayer") Gursharan Singh Tatla (Winter 2023) 4. The parent class Player has fields which are common to all players, such as: PlayerType, PlayerId, PlayerName, TeamName, GamesPlayed 5. The parent class Player also declares an abstract method Points, which will be overridden in the derived classes. 6. Class HockeyPlayer has fields: Assists, Goals • Override the Points method to calculate the hockey player’s points. Give 1 point for each assist and 2 points for each goal. • Total Points = Assists + (2 x Goals) 7. Class BasketballPlayer has fields: FieldGoals, ThreePointers • Override the Points method to calculate the basketball player’s points. Give 1 point for each field goal (minus any 3-pointers) and 2 points for each 3-pointer. • Total Points = (FieldGoals – ThreePointers) + (2 x ThreePointers) Faculty of Applied Science & Technology Page 3 of 3 8. Class BaseballPlayer has fields: Runs, HomeRuns • Override the Points method to calculate the baseball player’s points. Give 1 point for each run (minus any home runs) and 2 points for each home run. • Total Points = (Runs – HomeRuns) + (2 x HomeRuns)

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter14: Introduction To Swing Components
Section: Chapter Questions
Problem 10PE
icon
Related questions
Question

1. Make a WPF Application using C# in Visual Studio and name it as MTYourFirstnameLastname. 2. Design and implement an app having multiple windows that displays and manages information of players of different sports – Ice Hockey, Basketball, and Baseball. 3. The app maintains generic collections of these players. 4. The app can read, add, update, and delete the data. 5. Use LINQ whenever you need to read or fetch data. 6. The app should come preloaded with 5 pieces of data for each collection. 7. The main window should have three buttons (View Ice Hockey Players, View Basketball Players, View Baseball Players) that displays a new window for that particular sports player. 8. Each new window has a ListBox that gets populated with the player names. 9. On selecting a name from the ListBox, display the data in the TextBoxes. Faculty of Applied Science & Technology Page 2 of 3 10. Add buttons to insert/update/delete data for that particular sports player. • Show a message box with an error message for incorrect inputs. • When inserting a new player, do not ask for Player ID, rather generate a new one. The Player ID must be unique for every player, just like a primary key in database. • When editing an existing player, do not ask the user to edit the Player ID. Keep that textbox readonly. It must be unique for every player and must not be edited. 11. Display the player’s data windows as dialog boxes (by using ShowDialog() method). 12. When displaying player’s data windows, do not close the MainWindow. Gursharan Singh Tatla (Winter 2023) 13. Note: • All windows should not be the default grey colour but instead should be dressed up. • Use whatever layout panels you want to use: Grid, StackPanel, Canvas or any other layout. • Use your own imagination to layout the controls and design the app. • You should have a message box asking the user to confirm if they wish to delete or update the data for all collections. • Format all the message boxes with appropriate caption, buttons, and image. Classes: 1. Create a parent class Player which must be declared as abstract. 2. Then derive three child classes from the Player class: • HockeyPlayer • BasketballPlayer • BaseballPlayer 3. Use enum to represent different types of players. If you ever need to find what type of player it is, do not compare it with string, rather make use of enum. • Do: if (playerType == PlayerType.HockeyPlayer) Where, PlayerType is declared as an enum. • Don’t: if (playerType == "HockeyPlayer") Gursharan Singh Tatla (Winter 2023) 4. The parent class Player has fields which are common to all players, such as: PlayerType, PlayerId, PlayerName, TeamName, GamesPlayed 5. The parent class Player also declares an abstract method Points, which will be overridden in the derived classes. 6. Class HockeyPlayer has fields: Assists, Goals • Override the Points method to calculate the hockey player’s points. Give 1 point for each assist and 2 points for each goal. • Total Points = Assists + (2 x Goals) 7. Class BasketballPlayer has fields: FieldGoals, ThreePointers • Override the Points method to calculate the basketball player’s points. Give 1 point for each field goal (minus any 3-pointers) and 2 points for each 3-pointer. • Total Points = (FieldGoals – ThreePointers) + (2 x ThreePointers) Faculty of Applied Science & Technology Page 3 of 3 8. Class BaseballPlayer has fields: Runs, HomeRuns • Override the Points method to calculate the baseball player’s points. Give 1 point for each run (minus any home runs) and 2 points for each home run. • Total Points = (Runs – HomeRuns) + (2 x HomeRuns)

Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Database connectivity
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT