Create a structure to represent deck of cards, Programming Languages

We want to create a structure that will represent a deck of cards (not necessarily full). Each card has a character (between '2' to '9' and 'T', 'J', 'Q', 'K', 'A') and a suit (diamonds, hearts, clubs, spades):

a) Choose a representation for each card and also for the deck of cards (it can be empty or non-empty)

b) Define an add_card predicate that takes a card and a deck and adds the card if it is not already there (i.e. no duplicates) creating a new deck of cards. If the card is not of a valid suit or number this predicate will simply do nothing.

c) Define a sort_deck predicate that sorts a deck of cards putting diamonds first, hearts second, clubs third, and spades at the end (each suit in ascending order itself).

d) Include a testcase in your program that creates a deck of at least 5 cards and sorts it.

 

Posted Date: 3/28/2013 3:55:44 AM | Location : United States







Related Discussions:- Create a structure to represent deck of cards, Assignment Help, Ask Question on Create a structure to represent deck of cards, Get Answer, Expert's Help, Create a structure to represent deck of cards Discussions

Write discussion on Create a structure to represent deck of cards
Your posts are moderated
Related Questions
these 8 numbers (15, 20, 25, 30, 35, 40, 45, and 50) with using conditional jump

1.  Develop a Web page via href attribute of anchor tag and the attribute: vlink, alink, etc. 2.  Develop a Web page, in which when the user clicks on the link it will go to the

I am getting error at business layer object in code behind page.

1- If the order of a (mod P) is 3, prove that the order of a+1 is 6. 2- Explain why the "simplifiled knapsack" code is not secure.

Although the Document object's write()and writeln() methods are part of the DOM, they cannot be used to change content after a Web page has been rendered. You can write code that e

The following are required for this lesson: Complete the Project "Adding New Payments," which is the Karate Payments that includes the Adding New Payments, Deleting Payments,

i attached the assignment document only i need your help with following three parts: accessible areas, accessible cul-de-sacs that are all connected, entry-exit path with no in

Improved Application Deployment Data source implementation is perhaps the key to any Asp.net program implementation, and, if the database implementation is easily done, there is an

LALR Parser: Rule Table - Contains definitions of production rules within the grammar. Attributes: Count - Number of production rules in the table Child items:

What is .NET TECHNOLOGY? .NET technological innovation was presented by Enthusiasm, to get the industry from the SUN's Coffee. Few in the past, Enthusiasm had only VC++ and VB