Login|Contact Us
Question and Answer

Programming

Ask a Programming Question, Get an Answer ASAP!

  • Ask A Question
  • Browse Answers
  • Meet The Experts
  • How JustAnswer Works

Write a program to shuffle a deck of cards (52 cards, no jokers)

 
Raj's Avatar
  • Answered by:Raj
  • Computer Engg.
  • Positive Feedback: 98.8 %
  • Accepted Answers: 856
Verified Expert
in Programming

Recent Feedback

Positive
Excellent work and exactly what I needed..Thanks!
Positive
Thank you Raj exactly what I am looking for can I ask for your help in the...
Positive
Great job!
Positive
Very knowledgeable. Explains everything, if you're struggling with an assignment...
Positive
Thanks
Positive
Thanks
Positive
Raj did the job fast an accurately!
Positive
Raj helped me quickly and taught me alot.
Positive
RAJ is great as always!

Customer Question

Write a program to shuffle a deck of cards (52 cards, no jokers) and print the list of cards in the shuffled deck. Your program should have three functions: 1) shuffle the deck, 2) display the name of a card, and 3) return the point value of a card.

 

Optional Information:
Level: 14; Subject: computer programming in C

Already Tried:
#include <stdio.h>
#include <time.h>
#include <stdlib>



void shuffle(int deck[]);
void displayCard(int card);
int getValue(int card);

void main()
{
     int c;
     printf("This is a card game?????.\n");
     for(c = 0; c < 52; c++)
     {     
          for(c = 0; c <= 12; c++)
          {     
               c = 'diamonds'
          }
     


     return(0);
}

Submitted: 1424 days and 2 hours ago.
Category: Programming
Value: $9
Status: CLOSED
Picture
Expert:  Raj replied 1424 days ago.

can you specifu your problem in more detail??

Picture
Expert:  Raj replied 1423 days and 23 hours ago.

if you will explain your problem with more details then we will be able to help

Customer replied 1423 days and 21 hours ago.

I have to just shuffle the cards, and then have the shuffled cards print their values. The face cards have a value of ten except aces,... all other cards are their numbers. But I have to have shuffle as a seperate function, displaying the name of the card as a function, and the point value of the card as a seperate function. the display is suppossed to turn out like
Ace of Spades is card #XXXXX counts as 11
7 of Hearts is card #XXXXX counts as 7

The card number is XXXXX where it is drawn in a shuffle.

Picture
Expert:  Raj replied 1423 days and 21 hours ago.

when do you need the code??

Customer replied 1423 days and 21 hours ago.

as soon as possible. I am still trying some stuff but I don't think I am doing it right,.. I also have to use an array for the deck and this is really my first time using arrays. I just started programming about a month ago, I am very new.

Picture
Expert:  Raj replied 1423 days and 21 hours ago.

ok what are you usibg ti suffle cards??

Customer replied 1423 days and 21 hours ago.

I was going to try to use
srand(time(NULL));
in the main function,.. I am not sure if I should put in the the shuffle function.

Picture
Expert:  Raj replied 1423 days and 21 hours ago.

ok
i have started working on the code will post it when i am complete.....

Customer replied 1423 days and 21 hours ago.

Thank you very much!!

Picture
Expert:  Raj replied 1423 days and 21 hours ago.

One more question
What compiler are you using to run the c codes??

Customer replied 1423 days and 21 hours ago.

Borland C++ 5.5 for Win32 Copyright (c) 1993, 2000 Borland

Picture
Expert:  Raj replied 1423 days and 21 hours ago.

ok
i will keep posting update from my side and will try to post the code within 6 hrs.

Picture
Expert:  Raj replied 1423 days and 20 hours ago.

UPDATE:

I am done with the shuffle part

Can you explain in little more detail what is to be done in 2nd and 3rd part??

Accepted Answer

Picture
Expert:  Raj replied 1423 days and 18 hours ago.

Ok
I am done with the code......
Download code from the below location using "FREE USER" Option

Click here

Please find the file attached with name "CARDS.cpp" which contains the required code.........

Expert TypeComputer Engg.
Category: Programming
Pos. Feedback: 98.8 %
Accepts: 856
Answered: 6/18/2009

Experience: BE CS, 4+ Experience in Programming and Database (ERP)

Ask this Expert a Question >
 
Tweet

3 Programmers are Online Right Now

Ask Your Question Now
Programming Questions Date Submitted
Help with my final assignment for VB 5/9/2013
I am new to C programming, and this is an assignment problem. 5/9/2013
Another programming question for you the link is as follows 5/8/2013
Programming question help the link is as follows for the question 5/8/2013
i dont know programming i create OKPR508211. 5/8/2013
I need a programmer to help me with a couple of questions I 5/7/2013
Design and write a program (VB) that collects the following 5/7/2013
To RajStatements Assume that quest is an integer variable 5/6/2013
I need help on this Java programming problem. I included the 5/5/2013
a java programming question 5/5/2013
RSS
Next 10 >
Ask A Programmer
Type Your Programming Question Here...
characters left:

Top Programming Experts

See More Programmers

In The News

Nbc
Washington Post
New York Times
Cnn
Learn More

How It Works

  • Ask an Expert
  • Get a Professional Answer
  • Ask Followup Questions
  • 100% Satisfaction Guarantee
Learn More
close
Find Expert answers related to your question.
Sign up using email
We will never post anything without your permission.
Already have an account? Sign in

Ask a Programmer

Get a Professional Answer. 100% Satisfaction Guaranteed.
143 Programmers are Online Now
Type Your Programming Question Here...
characters left:
Disclaimer: Information in questions, answers, and other posts on this site ("Posts") comes from individual users, not JustAnswer; JustAnswer is not responsible for Posts. Posts are for general information, are not intended to substitute for informed professional advice (medical, legal, veterinary, financial, etc.), or to establish a professional-client relationship. The site and services are provided "as is" with no warranty or representations by JustAnswer regarding the qualifications of Experts. To see what credentials have been verified by a third-party service, please click on the "Verified" symbol in some Experts' profiles. JustAnswer is not intended or designed for EMERGENCY questions which should be directed immediately by telephone or in-person to qualified professionals.
Truste
Contact Us | Terms of Service | Privacy & Security | About Us | Our Network
© 2003-2013 JustAnswer LLC
  • Pearl.com
  • JustAnswer UK
  • JustAnswer Germany
  • JustAnswer Spanish
  • JustAnswer Japan