# Helpful Ideas to get started

Show 80 post(s) from this thread on one page
Page 2 of 2 First 12
• 12-05-2009
kpridd
okay last question and i think i got it why does it say i'm "jumping to case label" whenever i add case 2: into this

Code:

```#include<iostream> #include<ctime> #include<cstdlib> #include<string> using namespace std; int length, index1, index2, input, num, i, tries = 0; string guess; char temp; char SYMBOLS[4] = {'!', '&', '@', '%'}; void Seed() {     srand(time(0)); } int GetRandNum(int max) {  return rand() % max;    } int main() { Seed();   while((input != 1) && (input != 3)) { cout << "Welcome to the game of Logic!" << endl; cout << "What would you like to do?" << endl << endl; cout << "1 - Play the game of Logic" << endl; cout << "2 - Read instructions on how to play Logic" << endl; cout << "3 - Quit" << endl; cin >> input;          switch(input) {       case 1:                     cout << "Enter the number of symbols you would like to guess" << endl;           cin >> length;                             string sequence = "";                         for (i = 0; i < length; ++i)           {                     num = GetRandNum(3);           sequence += SYMBOLS[num];           }           cout << sequence << endl;         do         {                       cout << "Guess the order in which the symbols are in" << endl;         cin >> guess;                               if (guess != sequence)         {         ++tries;         cout << "Try again" << endl;         cout << "Tries: " << tries << endl;         }         else         {         cout << "You got it!" << endl;         }                   }         while (guess != sequence);         system("PAUSE");         break;     case 2:                     cout << "Choose the number of symbols you wish to be in the puzzle" << endl;           cout << "Then determine the order in which the symbols are placed" << endl;           cout << "Press any key to return the main screen" << endl << endl << endl;                      system("PAUSE");           system("CLS");           break; } }  system("PAUSE");   return 0;   }```
• 12-05-2009
kpridd
Code:

```#include<iostream> #include<ctime> #include<cstdlib> #include<string> using namespace std; int length, index1, index2, input, num, i, tries = 0; string guess; char temp; char SYMBOLS[4] = {'!', '&', '@', '%'}; void Seed() {     srand(time(0)); } int GetRandNum(int max) {  return rand() % max;    } int main() { Seed();   while((input != 1) && (input != 3)) { cout << "Welcome to the game of Logic!" << endl; cout << "What would you like to do?" << endl << endl; cout << "1 - Play the game of Logic" << endl; cout << "2 - Read instructions on how to play Logic" << endl; cout << "3 - Quit" << endl; cin >> input;          switch(input) {       case 1:                     cout << "Enter the number of symbols you would like to guess" << endl;           cin >> length;                             string sequence = "";                         for (i = 0; i < length; ++i)           {                     num = GetRandNum(3);           sequence += SYMBOLS[num];           }           cout << sequence << endl;         do         {                       cout << "Guess the order in which the symbols are in" << endl;         cin >> guess;                               if (guess != sequence)         {         ++tries;         cout << "Try again" << endl;         cout << "Tries: " << tries << endl;         }         else         {         cout << "You got it!" << endl;         }                   }         while (guess != sequence);         system("PAUSE");         break;     case 2:                     cout << "Choose the number of symbols you wish to be in the puzzle" << endl;           cout << "Then determine the order in which the symbols are placed" << endl;           cout << "Press any key to return the main screen" << endl << endl << endl;                      system("PAUSE");           system("CLS");           break; } }  system("PAUSE");   return 0;   }```
one last thing.. why does it say that "jump to case" when i put in case 2??
• 12-05-2009