Reference no: EM13784289
When playing poker and other card games (standard 52 cards, excluding the jokers), it is usual to arrange a hand to reflect its values. Write a program in C that arranges and prints out a random hand of ten cards in sorted order by pips values. Assume that an ace is highest in value, a king is next highest, which is followed by a queen, a jack, and so forth. For cards of the same pips values, use their suits to sort them in the order of Clubs, Diamonds, Hearts, and Spades. Notice that no card shows more than once in a hand.
In order for the hands of cards dealt by the program to be truly random, have the following line at the beginning of your program: (You need #include <time.h> though.)
srand(time(NULL));
The following screen shot contains two sample outputs of the program.
You may use ch7/test_drive.c as your reference to use a "comparator" function and qsort() to sort your cards.
Although it is totally up to you how you design your program, it needs to satisfy the following rules:
- It consists of at least 3 source files (.c files) and at least 3 header files (.h files).
- It uses structures (and optionally unions and enums) to model poker cards.
- It is organized in the following way:
o bin_files/ : a subfolder that holds executable file(s)
o obj_files/ : a subfolder that holds object file(s)
o inc_files/ : a subfolder that holds header file(s)
o src_files/ : a subfolder that holds source file(s)
- It comes with a workable makefile.
Major components of a safety and health plan
: State the major components of a safety and health plan, describe each component, and discuss how you would structure each component of the plan on a construction site that you are in control. Use the Safety and Health Program Evaluation Checklist ..
|
What is the importance of physical or real evidence
: What is the importance of physical or real evidence to the investigation? Explain. What are two methods of demonstrative evidence used to clarify the issues surrounding actions or lack of actions at a crime scene for a judge or jury? Explain
|
Ethical theories utilitarianism
: Prepare an essay (2000 words approx) which uses the ethical theories utilitarianism, duty and rights ethics, and virtue ethics to argue the validity of the following statement:
|
Keys to investing and analyzing the accuracy
: Analyze the exit strategy for your business and explain the trigger for the exit strategy.
|
Write a program in c that arranges and prints out
: When playing poker and other card games (standard 52 cards, excluding the jokers), it is usual to arrange a hand to reflect its values. Write a program in C that arranges and prints out a random hand of ten cards in sorted order by pips values.
|
Analyze it costs by accounting
: Why is it important to be able to analyze IT costs by accounting, asset, service, and technology tower views?
|
Write a paper about world inflation is falling
: Write a paper about WORLD INFLATION IS FALLING.
|
What are contracts and what purpose do they serve
: What are contracts and what purpose do they serve? (Include these in the explanation: Power of attorney, Bill of sales, Employment contracts, Residential agreements, Licensing agreements.
|
History of being a very controversial area
: Sexual Research has a long history of being a very controversial area of scientific study. What are some of the problems sex researchers have encountered - funding, ethics, truthful participants? How are current researchers combating these issues?..
|