I am unsure how to form a program to do this. I understand how to generate rando
ID: 641895 • Letter: I
Question
I am unsure how to form a program to do this. I understand how to generate random numbers. I also know that the array will have 0-51 numbers and to find the suite of each, 51 will be divided by 4 and the remainder values will be assigned to a certian suite. Can someone please help me get started? I also don't know how to form an array in a function to do what is needed, and then use it in the main function.
"Assuming the user wants to play, your program is to create a deck of 52 playing cards using one of the two
schemes detailed above. The deck is to be shuffled randomly (see section below on generating random
numbers), and then two hands of 5 cards are to be dealt to the two players (the user and the computer),
alternating card dealing between the two. As each card is dealt, display each player
Explanation / Answer
//Code in C++.............
//main.cpp
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include <iostream>
#include "CheggAnswer.cpp"
int main()
{
cout<<"**********************HELLO!! WELCOME!!********************* ";
char ch = 'y';
while(ch == 'y' || ch == 'Y')
{
Game game;
cout<<" Want to Play a Game with me???";
cout<<" 1.Press 'Y' to Start";
cout<<" 2.Press 'N' to Exit";
cout<<" Enter choice : ";
cin>>ch;
if(ch == 'n' || ch == 'N')
{
cout<<" **************THANKS FOR PLAYING*************************** ";
cout<<" You WIN : "<<game.getPlayerWins()<<" GAMES ";
return 0;
}
else
{
cout<<" ************************************************************ ";
game.start();
}
}
return 0;
}
Object Oriented programming with c++ and easy to understand code....
Feel free to ask any doubts
:)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.