C++ to Pseudo code

Help me please, I don't really get how to write this into pseudo code.
I need to submit this evening

#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <ctime>
using namespace std;
int main() {
srand( time(0));
int counter = 1000;
int winCounter = 0;
int winFirstCounter = 0;
for (int i = 0; i < counter; ++i) {
int prizeDoor = (1 + rand() % 3);
int firstChoice = (1 + rand() % 3);
bool switchDoor = (rand() % 2)==0;
if (!switchDoor && (firstChoice == prizeDoor)) {
++winFirstCounter;
++winCounter;
} else if (switchDoor && (firstChoice != prizeDoor)) {
++winCounter;
}
}
cout << (counter - winCounter) << "\tGames lost" << endl;
cout << winCounter << "\tGames won total" << endl;
cout << winFirstCounter << "\tGames won without change" << endl;
int winWithChange = (winCounter - winFirstCounter);
cout << winWithChange << "\tGames won with change" << endl;
cout << winWithChange*100/winCounter << "\tPercent won after change" << endl;
cout << winFirstCounter*100/winCounter << "\tPercent won without change" << endl;
return 0;
}
"pseudo code" is just a logical description of the code.

Include headers.
seed random number generator
initialize variables
LOOP ONE THOUSAND TIMES
Randomly select prize door ( 1, 2 or 3)
Randomly select first choice door ( 1, 2 or 3 )
Randomly switch choice door (switch / don't switch )
IF ( first choice is price door, AND didn't switch )
increment winFirstCount
increment winCount
ELSE IF ( first choice ISN'T prize door, AND did switch)
increment winCount
END LOOP
Output results


This is the Monty Hall problem. When you've finished, make sure that the number of wins with switching is roughly twice the number of win without switching.
Double Post:

http://www.cplusplus.com/forum/general/190139/

Please, delete the other post (above link).
Topic archived. No new replies allowed.