I am learning C++ in school and I thought I could make my own program demonstrating object oriented programming.
I am trying to do a simple coin flip simulation that in the end should result to roughly .50 as I want to find the probability of it landing on a head.
I have two files, the main.cpp file and my Coin.h file.
numberOfHeads for some reason is equaling numberOfTosses. I am really close to finishing once I figure this out.
But a new problem occurred and it is probably just as simple lol.
1 2
cout << "Number of Heads is: "<< numberOfHeads << " Number of Tosses is: " << numberOfTosses << endl;
cout << "The probability of a head is: " << numberOfHeads / numberOfTosses << endl;
The output is showing 0, when it should be calculating 507/1000 for example.