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
list of 10 operating systems with their hardware specification and also list any 5 software associated with each operating system

Lazytown Constabulary are concerned that young people in the town are unaware of the sorts of crime that they might encounter in their daily lives and are concerned that they may b

Object-oriented programming paradigm Object  Oriented  Programming  is  an  aproach  in  which  a  program  is  viewed  as  a  dynamic  network  of collaborating objects, where

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

Scenario A campsite provides cabins for travellers to stay in overnight. A 'cabin' is a small wooden hut, containing bunk beds, table and chairs, a heater, and a small cookin

I have to create a calorie counter and I am totally lost

the details on the two pictures on the link below : http://rak-up.com/up/files/18637.jpg ">http://rak-up.com/up/files/18636.jpg http://rak-up.com/up/files/18637.jpg

Objective: The purpose of this programming project is to explore page replacement algorithms. This can be accomplished by developing a simple simulator that implements various pag

You must use the keyword ''var'' to create and initialize a variable. The placement of the variable creation in your code is very important. Examples: var first = 21; var secon