Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

BE SURE TO ANSWER ALL PARTS OF THE QUESTION O Suppose a C++ class is needed to represent a playing card in a computer program.

image text in transcribed

BE SURE TO ANSWER ALL PARTS OF THE QUESTION O Suppose a C++ class is needed to represent a playing card in a computer program. The class should be named Card and it should have two member variables for a pip_value (a positive integer) and suit. For example, for the ace of spades, the pip-value is 1, and suit is "Spades". Write a declaration for this class using the most suitable data types Declare a default constructor and an initializing constructor (with one parameter for each member variable). The constructors should be available outside the class but the variables should not be. (m) Write the prototype for a function named search For Card that determines whether or not an array of Cards contains a particular card. This function is not a member function of the Card class. The three parameters are: an array of Cards, the number of Cards in the array, and the Card to search for. Use the most suitable return type for the function. You DO NOT have have to write the function itself. (11) Show how you would declare a variable in the main function of the Card type using the initializing constructor to give it values for a jack of Hearts (which has a pip_value of 11 and a suit value of "Hearts") Then declare an array named deck to contain 52 Cards Then show how to call the searchForCard function trying to find the jack of hearts using the variable you declared

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Big Data, Mining, And Analytics Components Of Strategic Decision Making

Authors: Stephan Kudyba

1st Edition

1466568704, 9781466568709

More Books

Students also viewed these Databases questions

Question

What is a SWOT analysis and why is it important?

Answered: 1 week ago

Question

Write a Python program to check an input number is prime or not.

Answered: 1 week ago

Question

Write a program to check an input year is leap or not.

Answered: 1 week ago