Write a program in c that arranges and prints out

Assignment Help C/C++ Programming
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.

Reference no: EM13784289

Questions Cloud

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?..

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write a program to calculate the trajectory flight path of

write a program to calculate the trajectory flight path of a soccer ball when it is kicked by a player inside the field

  What more efficient way to write this function for matrix

What's a more efficient way to write this function for a matrix? This one has to go through all the numbers, but that would take too long. r_num is row and c_num is column

  Testing a program based on varying

Testing a program based on varying input values without knowing what the code looks like is called _____.With _____ testing, you make sure that every instruction in the code is executed at least once.

  Prepare a businesspartner class that contains a company

prepare a businesspartner class that contains a company name first name and a telephone number. prepare a contacts

  Evaluate the circumference of a circle

Write a program that will call a function to calculate the area of a circle, and call another function to calculate the circumference of a circle.

  In this program you will implement a simple reverse polish

in this program you will implement a simple reverse polish notation rpn calculator. rpn is a notation in which

  Create if-then statement with single alternative decision

Create the If-Then statement (or a flowchart with a single alternative decision structure) which assigns 20 to  variable y and allots 40 to variable z if variable x is greater that 100.

  Two dimensional int array to hold the prices of the seats

The Theater class shows a theater with an auditorium containing a fixed number of seats arranged in rows with each seat selling for a exacting price. The instance variables for the theater are:

  Write a program that keeps an employee database

Using C++, Write a program that keeps an employee database in a random-access file. Implement functions for adding and removing employees. You need not keep employees in sorted order.

  Program to implement a user defined function

Write a C++ program that uses user-defined functions to read three integer numbers from the user, compute the summation, difference, and product of these numbers, and print the results on the screen.

  Taskimplement class randomint using randomintcpp and

taskimplement class randomint using randomint.cpp and randomint.h.for the randomint class- the function call operator

  Program to translates letter grade into number grade

In C++ (should be able to compile in Visual Studio 2010): Write a program to translates letter grade into number grade. Letter grades are A,B,C,D and F, possibly followed by a + or -.

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