subject

Hello! I need help with what I should put in my program. cs to test out my code. (my code is below) What method and code do I write to test it out? Thanks!

namespace DES1_Week1_PlayingCardAssignment
{

public enum Ranks {
Ace = 1,
Two,
Three,
Four,
Five,
Six,
Seven,
Eight,
Nine,
Ten,
Jack,
Queen,
King,
NUM_RANKS
}

public enum Suits {
Hearts = 0,
Diamonds,
Spades,
Clubs,
NUM_SUITS
}

class PlayingCard {
private Suits Suit;
private Ranks Rank;

public PlayingCard(Suits NewSuit, Ranks NewRank) {
Suit = NewSuit;
Rank = NewRank;
}

public static int CompareCards(PlayingCard Card1, PlayingCard Card2) {
int diff = Card2.GetValue() - Card1.GetValue();
if (diff > 0) {
return 1;
} else if (diff < 0) {
return -1;
} else {
return 0;
}
}

public Suits GetSuit() {
return Suit;
}

public Ranks GetRank() {
return Rank;
}

public int GetValue() {
if (Rank == Ranks. Ace) {
return 11;
} else if (Rank == Ranks. King || Rank == Ranks. Queen || Rank == Ranks. Jack) {
return 10;
} else {
return (int)Rank;
}
}

public void (int XPosition, int YPosition) {
char symbol;
if (Suit == Suits. Clubs) {
symbol = ClubSymbol;
} else if (Suit == Suits. Diamonds) {
symbol = DiamondSymbol;
} else if (Suit == Suits. Hearts) {
symbol = HeartSymbol;
} else {
symbol = SpadeSymbol;
}
Console. SetCursorPosition(XPosition, YPosition++);
char[] values = new char[]{ 'A', '2', '3', '4', '5', '6', '7', '8', '9', 'J', 'K', 'Q' };
char value = values[((int)Rank) - 1];
for (int y = 0; y < CardHeight; y++) {
for (int x = 0; x < CardWidth; x++) {
if (x == 0 && y == 0) {
Console. Write("╔");
} else if (x == CardWidth - 1 && y == 0) {
Console. WriteLine("╗");
} else if (x == 0 && y == CardHeight - 1) {
Console. Write("╚");
} else if (x == CardWidth - 1 && y == CardHeight - 1) {
Console. WriteLine("╝");
} else if (x == 0) {
Console. Write("║");
} else if (x == CardWidth - 1) {
Console. WriteLine("║");
} else if ((y == 0 || y == CardHeight - 1) && (x > 0 && x < CardWidth)) {
Console. Write("═");
} else if (x == 1 && y == 1 || (x == CardWidth - 2 && y == CardHeight - 2)) {
Console. Write(value);
} else if (x == CardWidth / 2 && y == CardHeight / 2) {
Console. Write(symbol);
} else {
Console. Write(" ");
}
}
Console. SetCursorPosition(XPosition, YPosition++);
}
}

public int GetAltValue() {
if (Rank == Ranks. Ace) {
return 1;
} else if (Rank == Ranks. King || Rank == Ranks. Queen || Rank == Ranks. Jack) {
return 10;
} else {
return (int)Rank;
}
}

private static char HeartSymbol = Encoding. GetEncoding(437).GetChars(new byte[] { 3 })[0];
private static char DiamondSymbol = Encoding. GetEncoding(437).GetChars(new byte[] { 4 })[0];
private static char ClubSymbol = Encoding. GetEncoding(437).GetChars(new byte[] { 5 })[0];
private static char SpadeSymbol = Encoding. GetEncoding(437).GetChars(new byte[] { 6 })[0];
public static int CardWidth = 5;
public static int CardHeight = 3;

}
}

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 08:30
Today is the anniversary of me being on yet, i don't need it anymore! here's a picture of my dog wearing a bowtie! my question is, how do i delete my account?
Answers: 1
question
Computers and Technology, 22.06.2019 17:30
Ou listened to a song on your computer. did you use hardware or software?
Answers: 2
question
Computers and Technology, 22.06.2019 21:40
Develop a function to create a document in the mongodb database “city” in the collection “inspections.” be sure it can handle error conditions gracefully. a. input -> argument to function will be set of key/value pairs in the data type acceptable to the mongodb driver insert api call b. return -> true if successful insert else false (require a screenshot)
Answers: 2
question
Computers and Technology, 23.06.2019 16:50
15: 28read the summary of "an indian's view of indian affairs."15 betterin "an indian's view of indian affairs," it is asserted that conflicts could be reduced if white americansunderstood native americans..pswhich of the following would make this summary more complete? eleo the fact that chief joseph believes the great spirit sees everythinthe fact that chief joseph was born in oregon and is thirty-eight years oldo the fact that chief joseph states that he speaks from the hearthehehethe fact that chief joseph of the nez percé tribe made this claimebell- ==feetle===-felsefe ==submitmark this and retum.=
Answers: 3
You know the right answer?
Hello! I need help with what I should put in my program. cs to test out my code. (my code is below)...
Questions
question
Mathematics, 25.11.2021 14:00
Questions on the website: 13722367