Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Instructions: 1- Create a C# class library project in a blank solution, name it whatever you like. 2- Chess pieces can either be white or

Instructions:

1- Create a C# class library project in a blank solution, name it whatever you like.

2- Chess pieces can either be white or black create an enum named color or colour where Black = 1, and White = 2.

3- Each side (color) in Chess has 16 pieces; 8 pawns, 2 bishops, 2 knights, 2 rooks, 1 queen, and 1 king. Create an enum named pieces where pawn1 =1 . pawn8 = 8, bishop1 = 9, bishop2 =10 and so on.

4- Create a public class called named Piece with two data members (fields); 1- color, 2-type. Make sure you include properties (get, set). a. Within the class Piece override the ToString method to output the color and the type.

5- Create a public class called ChessPieces similar to the Deck class from the demonstration. a. Implement a default constructor that calls a method named Reset. Reset just creates the pieces for each color (side) and places them in a list. i. Unlike the Deck class, you will have two lists, one list for black pieces and one list for white pieces. b. Implement a method named GetPiece that does the exact same thing TakeCard() does in the demonstration.

6- Just like we did in the demonstration, create a new console project within the current solution and name it whatever you like. b. Make sure you add a project reference.

7- The console project will contain a main method that uses the method GetPiece 12 times and outputs what the piece is using the ToString method in the Piece class.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial Accounting in an Economic Context

Authors: Jamie Pratt

8th Edition

9781118139424, 9781118139431, 470635290, 1118139429, 1118139437, 978-0470635292

Students also viewed these Programming questions

Question

Using a graphing utility, graph y = cot -1 x.

Answered: 1 week ago