Create a structure to represent deck of cards, Programming Languages

Assignment Help:

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.

 


Related Discussions:- Create a structure to represent deck of cards

What do you understand by the term postback, Question: (a) What do you...

Question: (a) What do you understand by the term Postback? (b) Describe five benefits of creating virtual directories while developing an ASP.NET application. (c) Exp

Language processors, explain steps of program execution in language process...

explain steps of program execution in language processors

C++, A charitable organization wants to design a special ATM machine to be ...

A charitable organization wants to design a special ATM machine to be used by needy people. The association supplies the needy person with a pin number to be able to use the ATM

Programs for shell scripts, 1. Write a bash shell script which searches thr...

1. Write a bash shell script which searches through your folders for files with the extension *.tex, and then interactively deletes the corresponding *.aux, *.dvi and *.log files (

Design program that presents animation of the solar system, Figure is a rep...

Figure is a representation of the solar system. In a basic model of the same concentric orbits planets rotate around the sun. The closer the Planet in less time Sun completes a ful

Memory hierarchy for linux systems, Memory Hierarchy for Linux Systems ...

Memory Hierarchy for Linux Systems A cache line has one or more valid bit(s), tag entry and list of bytes in a block in one set of a cache, as shown below: If you were

Power of mobile applications, BACKGROUND: This assignment illustrates t...

BACKGROUND: This assignment illustrates the power of mobile applications. OBJECTIVES: 1. Mobile applications DESCRIBED TASK: This is a single part assignment.

Included applications, Hi, Can any of you, tell me how to use Included Ap...

Hi, Can any of you, tell me how to use Included Applications?

Define the if statement - computer programming, Define the The if statement...

Define the The if statement - Computer Programming? The if statement is an influential selection statement and is used to control the flow of execution of statements. One of th

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd