My output is wrong

Hi! I made a program to analyze a roulette strategy. It uses the strategy with a range of starting amounts (many times for each), and outputs profit to a file. The numbers should be different for every starting amount, and presumably should increase as the amount of starting funds increases until it reaches an upper limit. Unfortunately, m output is not at all like that. What is wrong?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
// Roulette.cpp : This program will accumulate data for graphical analysis of the roulette strategy

using namespace std;
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <iostream>
#include <fstream>
int main(void)
{
	int sum = 0;
	int outcome[500];
	int betCount = 1;
	int startingBet;
	int bet;
	int startingMoney;
	int endingMoney;
	int money;
	int profit = 0;
	int interval;
	int finalTotal[100];
	int result;

	  // First a friendly introduction
  cout << "What are the minimum starting funds? ";
  cin >> startingMoney;
  cout << "What are the maximum starting funds? ";
  cin >> endingMoney;
  cout << "what is the interval of increment?";
  cin >> interval;
  cout << "what is your starting bet? ";
  cin >> startingBet;
  bet = startingBet;
  
  ofstream myfile ("money.txt", ios::out | ios::trunc);
  	
  if (myfile.is_open())  ; 
  else cout << "Unable to open file";
	
  srand (time(NULL));
  
  for(; startingMoney < endingMoney; startingMoney+=interval)
   {  
	for (int i=0; i < 100; i++)
		{
			money = startingMoney;
			/* initialize outcome: */
	

			for (int j=0; j < 500; j++) outcome[j] = rand() % 380;
  
		 // now the betting algorithm
				while (money >= bet)
				 {
				  betCount++;
	  
				  if (outcome[betCount] > 179)
					 {
						 money = money + bet;
						 bet = startingBet;
						 profit = profit + money - startingMoney;
						 money = startingMoney;
					 }
				 else
					 {
						 money = money - bet;
						 bet = bet * 2;
					 }
	  
				 if ((betCount > 100 && outcome[betCount] > 179) || bet > 500) break;
				}
	finalTotal[i] = money + profit - startingMoney;	
	profit = 0;
	betCount = 0;
   
		 }

		for (int k=0; k < 100; k++) sum = sum + finalTotal[k];
		result = sum/100;
	    myfile << result << "\n";
	
   }
   
    myfile.close();
	return 0;
}



Output:

-2
-2
-2
4
4
4
4
4
4
-2
-2
-2
-2
-2
-2
-2
-2
-2
-2
-2
-2
-2
58
58
58
58
58
58
58
58
58
58
58
58
58
Topic archived. No new replies allowed.