The Very Evil Deck of Cards

Hello! I have been tasked with in my opinion a hard programming task. It is well, Challenging to me.(I just started C++ :P)

The main goal is to print out a "Deck of Cards". The way I have started is by creating an array through a 'for loop' and it prints out the numbers. But I am having trouble with a 'for loop' creating another array, And printing them out.

Any help would be appreciated!

~Thanks,
Jim

P.S I just need a little help, I don't want to spoil the challenge!

*(Code so far)*

// ArraysAreEvil.cpp : Defines the entry point for the console application.
//

// Things needed to import
#include "stdafx.h"
#include <iostream>
#include <string>
#include <sstream>
#include <exception>

using namespace std;


int main()
{
	// This is for the "Input" things
	string input = "";
	int pause = 0;

	// TITLE :D
	cout << "                     -----------------                     \n";
	cout << "                      ARRAYS ARE EVIL                      \n";
	cout << "                     -----------------                     \n";

	cout << "###############################################################################\n";

	cout << "\n";
	cout << "\n";
	cout << "\n";
	cout << "\n";

	// Printing out the options
	cout << "Type 'Continue' to run the program.\n";
	cout << "Type 'Exit' to close the application.\n";

	// Gets the Input
	cin >> input;

	// Continue "Input"
	if(input == "Continue"){
		cout << "\n";
		cout << "\n";
		cout << "\n";
		cout << "\n";
		cout << "\n";
		cout << "\n";
		cout << "\n";
		cout << "\n";
		cout << "\n";
		cout << "\n";
		cout << "\n";
		cout << "\n";
		cout << "\n";
		cout << "\n";
		cout << "\n";
		cout << "\n";
		cout << "\n";
		cout << "\n";
		cout << "\n";
		cout << "\n";
		cout << "\n";
		cout << "\n";
		cout << "\n";
		cout << "\n";

		// Intilizing arrays
		int card_one[13];
		int card_one[13];

		cout << "Type of card  - Number Value" << endl;

		int card_one[13] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};
		int cardType = 0;

		for(int Counter = 0; Counter < 13; Counter++){
				
				cardType += card_one[Counter];
		}
	}

	// Exit "Input"
	if(input == "Exit"){
		cout << "\n";
		cout << "\n";
		cout << "\n";
		cout << "\n";
		cout << "\n";
		cout << "\n";
		cout << "\n";
		cout << "\n";
		cout << "\n";
		cout << "\n";
		cout << "\n";
		cout << "\n";
		cout << "\n";
		cout << "\n";
		cout << "Are you sure you want to exit?";
		cout << "\n";
		cout << "\n";
			if(input == "Yes"){
				exit;

	}
	}

	cin >> pause;
	
	return 0;
}
1.- Use code tags instead of output.

2.-You can have as many \n as you want enclosed in "", and text anywhere mixed with them, like:
cout << "\n\n\nHello,\nhow are you?\n\n:)\n";.

3.-I see you initialized the exactly same array twice: int card_one[13];.

4.-You should scan character input (char variables) and check simple things like Y for yes and N for no, or numbers to select an option.

Last edited on
xD Thank you very much!
Topic archived. No new replies allowed.