Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please solve the assignment in C# as soon as possible. Instructions: 1. Make a Console Application in Visual Studio and name it as A1YourFirstnameLastname. 2.
Please solve the assignment in C# as soon as possible.
Instructions: 1. Make a Console Application in Visual Studio and name it as A1YourFirstnameLastname. 2. Implement a sports player stats management system which is capable of doing the following: - Add, edit, and delete player stats. - View and search player stats. 3. The application must be menu-based app: 1 - Add Player 2 - Edit Player 3 - Delete Player 4 - View Players 5 - Search Player 6 - Exit 4. When selecting Add, Edit or Delete Player option from the above menu, display a sub-menu which asks which sports player is being added, edited, or deleted. 5. For example, If user selects 1 - Add Player, then display the following sub-menu: 1 - Add Hockey Player 2 - Add Basketball Player 3 - Add Baseball Player 4 - Back to Main Menu 6. The menu should run continuously until the user quits the application. - Validate the inputs. Any invalid input should not crash the app. - Display user-friendly messages wherever necessary. - Always display the player stats in a tabular form. - Always display column headers when displaying player stats. 7. NOTE: At no point should the application save any information to disk. All information is stored and managed in memory using a generic collection. The use of collections and the object-oriented design of the solution are an important part of the evaluation of your submission. 8. Add Player: - When adding a new player, ask the user for all the required info and then save it to the collection. - Then display a success message and print all the players from that sport in a tabular form to verify that the new player is added. - NOTE: When adding 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. 9. Edit Player: - When editing a player info, first display a list of all players from the selected sport. - Then ask the user for the Player ID of the player that user wants to edit and fetch that player from the collection. - And ask the user for all the required info and then display a success message. - Print all the players from that sport in a tabular form to verify that the player is edited. - NOTE: Do not ask the user to edit the Player ID. It must be unique for every player and must not be edited. 10. Delete Player: - When deleting a player info, first display a list of all players from the selected sport. - Then ask the user for the Player ID of the player that user wants to delete and fetch that player from the collection. - And remove the player from the collection and then display a success message. - Print all the players from that sport in a tabular form to verify that the player is deleted. 11. View Players: - Display all the players in a tabular form. - Display column headers. - Categorize the players based on their sports. - Check the output video to get an idea. 12. Search Player: - Ask the user to enter the player's name and display all the players that match the search keyword. - Partial match must fetch the results. - Match should be case-insensitive, meaning if user enters lowercase "kyle" and the player's name is "Kyle" (with uppercase K), it must fetch the player. 13. The players belong to three different sports: Ice-Hockey, Basketball, and Baseball. 14. Create a parent class Player which must be declared as abstract. 15. Then derive three child classes from the Player class: - HockeyPlayer - Basketballplayer - Baseballplayer 16. 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 == Player Type. HockeyPlayer) Where, PLayer Type is declared as an enum. - Don't: if(playerType=="HockeyPlayer") 17. The parent dass Player has fields which are common to all players, such as: PlayerType, PlayerId, PlayerName, TeamName, GamesPlayed 18. The parent class Player also declares an abstract method Points, which will be overridden in the derived classes. 19. 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 Goals ) 20. Class Basketba11Player has fields: FieldGoals, ThreePointers - Override the Points method to calculate the basketball player's points. Glve 1 point for each field goal (minus any 3-pointers) and 2 points for each 3-pointer. - Total Points = (FieldGoals ThreePointers) + (2 x ThreePointers) 21. Class Basebal1Player 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 HomeRuns ) 22. Use your Java and object-oriented programming knowledge to create this hierarchy. - NOTE. L. Use CH properties to get/set these fields. Do not use getter/setter methods like you would do in Java. Ii. Classes must be declared in their separate files, not in Program.cs file. - You will get higher grades if: L. Proper use of inheritance. ii. User-Interface is user-friendly. ii. App menu runs smoothly without crashing- - Otherwise, there will be grade deductions. 23. In the Program.cs file, create and maintain a generic collection of all players. - The generic collection must be of type parent class Player and it must store objects of derived classes. - Populate this collection with some sample data when the program runsStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started