Create a class called card player and deck

Assignment Help C/C++ Programming
Reference no: EM13936761

1. Write a class called "Card" with the following traits: it holds two private variables, a suit and a value (ace is high). It has public functions that randomly generate and modify the suit, value and print out the suit/value to the screen. Write a suitable main function to test that it is working properly.

2. Write a class called "Deck" with the following traits: it holds an array that keeps track of all of the cards in the deck, it has functions like that shuffles the deck (randomly arranges the array with a list of cards), reports how many cards are currently in the deck, allows a card to be "drawn" from the deck (gives the next card in the array and marks it as used; this will return a value that is of type Card). Write a suitable main function to test if this is working properly.

3. Write a class called "Player" with the following traits: it holds an array of five "Cards" (from above), a player name, current points/money. It should have functions that will set and report the player name, set the starting balance of points, add/subtract points as necessary, compare two cards to see if they are the same, "draw" five random cards from the deck and store the draw into the array (making sure that no duplicates exist), print out the hand to the screen, ask the user to discard a specific number of cards (and select them) and replace the discarded cards with new ones. Write a suitable main function to test that it is working properly.

Reference no: EM13936761

Questions Cloud

Annual show in yeppoon for the show holiday : The Yeppoon and District Show Society Inc organizes an annual show in Yeppoon for the Show Holiday. This year it was organized on the 6th and 7th June 2015 and attracted over 10000 people.
What is the order of the genes on the chromosome : Calculate the recombination frequencies of each region. Then draw a chromosome map of the alleles, giving distances between each allele (use the first letter of each word as the allele designation). What is the total distance?
Calculate the eoq for heavy-duty tyres : What is the cost of the prediction error? Calculate the EOQ for heavy-duty tyres, along with the sum of annual relevant ordering costs and carrying costs.
Discuss the value of visual art for individual and society : Discuss the value of visual art for an individual and society. Analyze the essential relationship between any work of art and the various kinds of influences on the artist and audience that shape the interpretation of the art
Create a class called card player and deck : Write a class called "Card" with the following traits: it holds two private variables, a suit and a value (ace is high). It has public functions that randomly generate and modify the suit, value and print out the suit/value to the screen. Write a ..
Introduce a few areas of programming using c : In this project it was required to write a small Notepad program and it will introduce a few areas of programming using C# (which are very important in many programs), including: Windows Forms and the Event Handling model GUI (Graphical User Inter..
Research on woolworths supermarket : Students must research Woolworth's Supermarket. Students are to write an Integrated CRM Strategy Plan in Report Format.
Algorithm that returns the smallest value in the array : Write an algorithm that outputs the smallest and second smallest values in the array.
Describe the artwork in terms of subject : Describe the artwork in terms of subject, medium, composition, and use of color. Classify the work of art, highlighting the style, movement, and any innovation the artist displayed

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write a c function that converts a character to upper case.

Write a C function that converts a character to upper case. The function should have the prototype char to_upper(char ch); The characters given as input to the function are assumed to be in the sets {'a', ..., 'z'} and {'A', ... , 'Z' }. Do not use a..

  Implement the bisection method for solving given equations

Implement the Bisection Method for solving equations. Use the following function: double root(double (*pf)(double x), double a, double b, int n).

  Implement the vector class using inheritance

Is it better to implement the Vector class using inheritance (is-a relationship) or composition (has-a relationship). In other word, which one of the following gives a better implementation?

  Declare an array of integers

Declare an array of 10 integers and initialize its elements to the following values: -10; -8; -6; -4; -2; 0; 2; 4; 6;8;10

  Define a structure to store roll no

Define a structure to store roll no, name and marks of a student. Using the structure of above write a ‘C’ program to create a file “student.dat”. There must be one record for every student in the file. Accept the data from the user.

  Futures of anomaly based instruction detection scheme

Explain the futures of anomaly based instruction detection scheme.

  A file (complex.txt) which has a number of complex numbers

Read in a file (complex.txt) which has a number of complex numbers in the form of a+bi (e.g. 3+5i  2-3i etc).

  Write a program that uses a string array to store a list

The program should allow the user via a menu to add an item to the list, clear the list, and display the list. You may assume that the list will never need to contain more than 10 items.

  Write a program using above data file

Write a program using above data file (must prompt user for file names- input and output) to read in the critical path information and write reports.  Print reports (3 reports) to an output file as below:Print a project completion timetable that list..

  Write pseudocode for a program

Write pseudocode for a program that prompts the user for a month and day and prints out whether it is one of the following four holidays.

  Program that prints out any size triangle based on 2 inputs

My goal is to write a program that prints out any size triangle based on either one or two inputs (would prefer 2; e.g. range[a, e]). Each line of the triangle will be centered and looks like the attached output (equilateral triangle).

  Display the complete fibonacci sequence

Display the complete Fibonacci sequence until you reach a value less or equal than 1,000,000 (one million) - display the division of the number by the previous one for the complete sequence.

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