# Lottery chances [closed]

I want to make a program that would allow the user to enter any number of numbers within any range sepcified by the user and have it print the chances of those numbers winning (both in any order AND the exact order in which the user entered them.

I just need ya'll to tell me if I've accomplished that and how I could improve my code.

P.S. a lot of it is in pseudo-code, so any translation into the actual syntax would really help.

``````#include <iostream>
using namespace std;

int main(){
int numList[], rangeStart, rangeEnd, numbNumbs;
cout<<"enter the number of numbers you will be entering"<<endl;
cin>>numNumbs;
cout<<"enter the numbers"<<endl;
cin>>numList;
cout<<"enter the beginning of the number range"<<endl;
cin>>rangeStart;
cout<< "enter the last number in the range"<<endl;
cin>>rangeEnd;
}

function Range{
int Range = rangeEnd - rangeStart;
return Range;
}

function rangeCheck{
int i = 0;
for (numbList[i] < numNumbs; i++){
numbList[i] = x;
if (!(rangeStart < x < rangeEnd))
cout<<"Sorry, your numbers did not match the correct criteria"<<endl;
}
else return 0;
}

function anyMatch{
int anyChance = 0;
anyChance = ((1/Range)/numNumbs);
cout<< "your chances of getting all of you numbers picked in any order are"<< anyChance<< "% percent"<<endl;
}

function straightMatch{
int straightChance = 0;
straightChance = (((1/Range)/numNumbs)/numNumbs);
cout<< "your chances of getting all of you numbers picked in the same order are"<< straightChance<< "% percent"<<endl;
}
``````
-
A couple comments about why this question may not be getting traction.. First, the formatting is a bit rough. I edited your post, but since my rep here is low my edit needs to be reviewed. Getting rid of spurious blank lines and lining up the tabs actually helps a lot when it comes to getting responses. See this –  John Dibling Jun 8 '12 at 4:41
Second, its very hard to advise you when you use psudo-code. Your psudo-code is your own, personal language -- nobody except you really understands it. And nobody can compile it, which is a big deal. Programmers work mostly in two places: text editors, and debuggers. Posting psudocode takes one of our main tools away, making it more difficult to help you. If you post a complete, compilable program and ask specific questions, I bet you get more help. –  John Dibling Jun 8 '12 at 4:43
@JohnDibling I think the problem is that this question isn't a proper question for codereview. Without actual, final code, there's nothing to review other than formula and whatnot. –  Corbin Jun 8 '12 at 7:33
@Joshua, this site is a bit different from a conventional forum. For one thing, we prefer to cut to the chase and not waste time on things not related to the problem. As a consequence, I’ve cleared up your question a bit (in addition to John’s formatting improvements) but removing the introduction. –  Konrad Rudolph Jun 8 '12 at 9:36