|
-
May 12th, 2009, 12:54 PM
#1
Problem with functions
I made this program it works fine.
I just need to separte it into two other functions one called user_input(), and the other one user_output().
Any help will be greatly appreciatted.
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
const int size = 20;
int numPlayers[size];
int quickNum[size];
int length[size];
int main ()
{
cout<<"How many players will be playing?"<<endl;
cin>>numPlayers[size];
for(int a=0; a<numPlayers[size]; a++){
cout<<"What is your name player # "<<a+1<<"?"<<endl;
string name;
cin>>name;
cout<<"Hello "<<name<<" how many quick picks will u be playing today?"<<endl;
cin>>quickNum[size];
for(int b=0; b<quickNum[size]; b++){
cout<<"What should the length of quick pick # "<<b+1<<" be"<<endl;
cin>>length[size];
cout<<"Your numbers are: ";
srand((unsigned)time(0));
int random_integer;
for(int index=0; index<length[size]; index++){
random_integer = (rand()%99)+1;
cout << random_integer<<" ";
}
cout<<endl;
}
}
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|