Create a program for decision structure , C/C++ Programming

Assignment Help:

Create the following program or propose one of your own. The program must include at least one of each of the following.

  • Decision structure
  • Repetitive structure
  • function
  • array
  • Class and it must be used

Create a class for a deck of cards. Decide what attributes and methods you will need.

HINT: Think about the characteristics of a deck of cards and what you can do with it. Also, see if there are any built-in or library functions that will help.

Write a program using the class. The program needs to provide a menu to the user with the following options:

1. Reset the deck

2. Shuffle the deck

3. Cut the deck

4. Cut to a card.

5. Cut against the computer

6. Exit

Each of these options must work.

  1. To clarify the menu options, reset the deck would put the deck back to default state.      
  2. Shuffle the deck should do as described; shuffle the cards to a random order.                          
  3. Cut the deck would be flipping the deck so that the bottom half is on top.                              
  4. Cutting to a card is when you cut the deck at a random point and draw the card at that point.
  5. Cutting against somebody is when two people cut to a card and the one with the highest card is the winner.                                                                                                        
  6. When cutting against the computer you should allow the user some input to pick their card such as entering a number in a certain range. You can select the computer's randomly.

Related Discussions:- Create a program for decision structure

Padovan string, A Padovan string P(n) for a natural number n is defined as:...

A Padovan string P(n) for a natural number n is defined as: P(0) = ‘X’ P(1) = ‘Y’ P(2) = ‘Z’ P(n) = P(n-2) + P(n-3), n>2 where + denotes string concatenation. For a string of t

Sp, Write a program to find the area under the curve y = f(x) between x = a...

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

Thermodynamics, want to solve the thermodynamics problems on c language

want to solve the thermodynamics problems on c language

Source code, processing two jobs through 2 machine

processing two jobs through 2 machine

Minimumshelf, Write a program that finds the minimum total number of shelve...

Write a program that finds the minimum total number of shelves, including the initial one required for this loading process.

Example of function - c program, Here is a short program. It prints out the...

Here is a short program. It prints out the value of a variable "x". Ernie and Bert disagree about what will be printed: Ernie says, the value gets changed in "changeX" so it will p

Write the program of function templates, Consider the following example: ...

Consider the following example: int max(int x, int y)                  {                                 return ( x > y) ? x : y ;                  }   float max

C, Write a program to find the area under the curve y = f(x) between x = a ...

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

Write Your Message!

Captcha
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