Write a program in C++ that allows the user to enter the values to assign a card's suit (commonly implemented as an enumeration — Hearts, Clubs, Diamonds, Spades) from the keyboard. You cannot use a menu. Your program must read the user's choice directly into the card suit variable (of an enum type). (Note: You cannot overload operators for built-in types, but enumerations are, technically, user-defined types. Therefore you can overload input/output operators for th

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter5: Making Decisions
Section: Chapter Questions
Problem 5GZ
icon
Related questions
Question

Write a program in C++ that allows the user to enter the values to assign a card's suit (commonly implemented as an enumeration — Hearts, Clubs, Diamonds, Spades) from the keyboard. You cannot use a menu. Your program must read the user's choice directly into the card suit variable (of an enum type). (Note: You cannot overload operators for built-in types, but enumerations are, technically, user-defined types. Therefore you can overload input/output operators for them.)

Welcome to the Card Suit Entering Program!!!
What is the suit of your card?
hearts
You have a heart!
Don't wear it on your sleeve..!
Another card?
y
What is the suit of your card?
S
So, you have a spade!
Dig me a hole out back, won't you?
Another card? Y
What is the suit of your card?
CLUBS
|Ah, a club!
Don't beat me up!!
Another card?
y
What is the suit of your card? diagonal
I'm sorry, I don't recognize that suit...please try again.
What is the suit of your card?
dia
Ooo...diamonds.
Don't cut my monitor with those!
Another card?
n
Thank you for using the CSEP!!
Endeavor to have a stimulating day!
%24
Transcribed Image Text:Welcome to the Card Suit Entering Program!!! What is the suit of your card? hearts You have a heart! Don't wear it on your sleeve..! Another card? y What is the suit of your card? S So, you have a spade! Dig me a hole out back, won't you? Another card? Y What is the suit of your card? CLUBS |Ah, a club! Don't beat me up!! Another card? y What is the suit of your card? diagonal I'm sorry, I don't recognize that suit...please try again. What is the suit of your card? dia Ooo...diamonds. Don't cut my monitor with those! Another card? n Thank you for using the CSEP!! Endeavor to have a stimulating day! %24
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 5 images

Blurred answer
Knowledge Booster
Reference Types in Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,