Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need help revising my code to match the example exactly and to prompt the user again for another card index so it will output
I need help revising my code to match the example exactly and to prompt the user again for another card index so it will output a card value another time like in the example. Match the example exactly. Thanks for your help!
Assignment Details & Example:
My Current Output:
My Current Code:
#include#include using namespace std; int main() { string suits[] = { "Hearts", "Diamonds", "Spades", "Clubs" }; string ranks[] = { "2", "3", "4", "5", "6", "7", "8", "9", "10", "Jack", "Queen", "King", "Ace" }; int index; cout > index; cout Assignment Create an array of 52 cards. The 52 cards all contain a value and a suit based on its array position. The value starts with 2, 3, 4, 5,6,7,8, 9, 10, J (Jack), Q (Queen), K (King), A (Ace). Suits will be: Hearts, Diamonds, Spades, and Clubs. Your job is to determine the value and suit of a card in the single-dimensional array without using any other arrays. You must use the order given to you above (2 comes before 3, Hearts comes before Diamonds). The array is keyed first on the value, then the suit. So all heart cards will come first, then diamonds, then spades, and finally, clubs. For this mini-lab, the array itself will not store a relevant value. However, for the lab, it will. Example Enter a card index:0 That's the 2 of Hearts Enter a card index: 1 That's the 3 of Hearts Submission Submit your cpp file. tshahid:tesla5/mlab7 Enter a card index: 0 That's the 2 of Hearts tshahid:tesla5~ - 7:40PM 7:40PM
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started