Write a class called "deck" with the traits

Assignment Help Computer Engineering
Reference no: EM1331349

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: EM1331349

Questions Cloud

A strong behaviorist approach to learning focuses : A strong behaviorist approach to learning focuses on discrete tasks that are built up until they become a complex behavior.
Resource challenges and independent contractors : Resource Challenges and Independent Contractors - What are the negatives and positives when using independent contractors for projects
If the customer is rational explain how economic decisions : If the customer is rational explain how can use affect their economic decisions
Graph the following function using transformations : A utility company has the following rate schedule for natural gas usage in a city's business district.  Graph the following function using transformations.  Be sure to graph all of the stages on one graph all of the stages on one graph.
Write a class called "deck" with the traits : Write a class called "Card" with the following traits: it holds 2 private variables, a suit and a value (ace is high). It has public functions that randomly generate and build the suit, value and print out the suit/value to the screen. Write a suit..
Issues of a healthcare facility : Check a key related issue that a healthcare facility is currently dealing with. Your boss asks you to research more on issues to construct that will be given to employees of the facility.
What would like to know and how to get the equation : What would like to know and how to get the equation. Your help is greatly appreciated.
Reduce the defection rate : Today, companies are increasingly concerned about customer defection. There are three main steps a company can take to reduce the defection rate.
Company pays in sales person on the commission basis : make a C++ program that uses a "While" statement to input each salesperson's gross sale for last week and calculates and displays that salesperson's earnings. Process one salesperson's figure at a time.

Reviews

Write a Review

Computer Engineering Questions & Answers

  How to make an xml file in visual studio

How to make an xml file in Visual Studio

  Sketch quality is an elusive concept

sketch quality is an elusive concept. Quality depends on specific organizational priorities: a 'good' design may be the most efficient, the cheapest, the most maintainable, the most reliable, etc.

  Plan a java class named mypoint to represent a point

create the class, and also write a test program that creates two points (0, 0) and (10, 30.5) and displays the distance between them.

  What are the roles of the management sponsors

What are the roles of the management sponsors

  Developing a database of measured meteorological data

You are developing a database of measured meteorological data for usage in weather and climate research.

  Generating algorithm to read artibitary number of records

write down a detailed line listing the person's name and age. In addition, compute and output the following values: Number of males less than or equal to 21 yrs old.

  How to identify the communication needs

For each phase, identify the communication needs and briefly describe how you will satisfy them.

  Implementing class diagram

Design a class diagram representing a book described by the following statement. “A book comprises of the number of parts that in turn are composed of the number of chapters.

  Find the percent of total weight that is quota

A teenager has 5 shirts, 7 jeans and some jackets, how many jackets must he have so that if he wore a different set of shirtsand jeans each day, he could continue for 140 days before he will have to repeat a set.

  Communicate to database engine via visual basic

The most internationally standardized language in order to communicate to the database engine is Visual Basic. Describe why would it be useful in order to have Data Sources window open?

  A java application that can hold five doubles in a array

Write down a Java application that can hold five doubles in an array, and display the doubles from first to last, and then display the doubles from last to first. Use the following logic for BubbleSort to sort and display the array in sequence.

  Explain the importance of usability

What website design changes should be made to accommodate older online surfers.

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