free geoip

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Multidimensional Array vs If-Statements and Functions? in c++
VU Help • House Banner VU Help Virtual University Students - Assignments, Solved Papers, GDB & Exam Help Student Help Forum • Collaborative • Free Support
#1
Multidimensional Array vs If-Statements and Functions? in c++

Code:
int main() { cout << "The Bishop\n\n"; cout << "Press 'x' to begin.\n\n"; bool door1Loop = false; cin >> start; if(start == 'x') { wakingUp(); cin >> answer; if(answer == 'a') // { investigateDarkOnes(); cin >> answer; if(answer == 'a') { doSomething(); } if(answer == 'b') { thinking(); cin >> answer; if(answer == 'a') doSomething(); } } else if(answer == 'b') { doSomething(); } else if(answer == 'c') { panicAttack(); cin >> answer; if(answer == 'a') { sobbingMess(); } if(answer == 'b') { doSomething(); } } system("pause"); } } void doSomething() { bool beast1Loop = false; investigateDoor1(); cin >> answer; if(answer == 'a') { thinking(); cin >> answer; if(answer == 'a') { beast1(); cin >> answer; if(answer == 'a') { beast1Smack(); cin >> answer; if(answer == 'a') { meetArchdemon(); } else if(answer == 'b') { fallToYourDeath(); system("exit"); } } else if(answer == 'b') { beast1Negotiate(); } else if(answer == 'c') { beast1Bolt(); } } } if(answer == 'b') { panicAttack(); cin >> answer; if(answer == 'a') { sobbingMess(); } if(answer == 'b') { doSomething(); } } if(answer == 'c') { beast1(); cin >> answer; if(answer == 'a') { beast1Smack(); cin >> answer; if(answer == 'a') { meetArchdemon(); } if(answer == 'b') { fallToYourDeath(); system("exit"); } } else if(answer == 'b') { beast1Negotiate(); } else if(answer == 'c') { beast1Bolt(); } } }

0300-9520262
Get solution in 24 hour
|cpmputer & internetConfusedmileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  how often do we require to use inline functions and macros. their importance in c++ Vuhelper 0 8,495 05-31-2012, 01:49 AM
Last Post: Vuhelper
  array project code c++ 2011 Vuhelper 0 1,306 12-10-2011, 06:32 PM
Last Post: Vuhelper
  Is void used only with functions? If yes than why? Vuhelper 0 2,526 11-05-2011, 05:10 PM
Last Post: Vuhelper
  get length of a dynamic array in c++ 2011 Vuhelper 0 899 07-20-2011, 10:50 PM
Last Post: Vuhelper
  C++ stringstream array to int in c++ 2011 Vuhelper 0 2,502 07-19-2011, 06:35 PM
Last Post: Vuhelper
  adding rows and columns of a multi array in c++ 2011 Vuhelper 0 1,092 07-12-2011, 11:03 PM
Last Post: Vuhelper
  Passing 2d array by reference June 2011 Vuhelper 0 945 06-19-2011, 06:11 PM
Last Post: Vuhelper
  Passing into function array of matrix in c++ 2011 Vuhelper 0 2,547 06-15-2011, 06:24 PM
Last Post: Vuhelper
  Pass string value into function as an array in c++ Vuhelper 0 981 06-11-2011, 06:42 PM
Last Post: Vuhelper
  initialization of array in c++ Vuhelper 0 3,096 06-04-2011, 08:05 PM
Last Post: Vuhelper

Forum Jump:


Users browsing this thread: 1 Guest(s)
VU Help • House Banner VU Help Virtual University Students - Assignments, Solved Papers, GDB & Exam Help Student Help Forum • Collaborative • Free Support