Program 2 – Number Baseball Game with screenshot – Instant Delivery – Perfect Solution
Game Description:
1. This game is a hidden number finding game called the Number Baseball Game.
2. At the beginning of the game, a computer chooses randomly three numbers among 1 to 9. But this numbers are not shown to a game player. The numbers cannot be duplicated.
Example) 913, 319, 457, 175…. 335 (incorrect), 340 (incorrect)
3. The computer accepts three numbers from the player and shows the result for the input. If a number in player’s input matches a number in computer’s number and is placed in the same order, it is considered 1 strike. If a number in player’s input matches a number in computer’s number but is not placed in the same order, it is considered 1 ball.
Example) a computer’s number: 913, a user’s input: 935 ==> 1 strike and 1 ball
a computer’s number: 913, a user’s input: 915 ==> 2 strikes
a computer’s number: 913, a user’s input: 395 ==> 2 balls
a computer’s number: 913, a user’s input: 865 ==> No strike and no ball.
4. Allow up to five times of trial for each game. If a player gets three strikes within five times, it is a win of the player. If a player doesn’t get three strikes within five times, it is a loss of the player. Show the message for win or loss.
5. After each game, show the total number of games played and wins and the win percentage of the user. After that, ask the player whether to continue. If the player wants to continue, start a new game. Otherwise, terminate the program.
Programming Requirements:
1. Write a Visual Studio 2012 C# Console App that plays the Number Baseball Game.
2. Use at least one static method (except Main method) and one instance method.
3. Include your class (es) in the namespace called “NumBaseBall.”
4. At the beginning of the game, show your name.
5. After creating computer’s number, show them for the grading, but consider them as hidden to the game player.