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

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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