Hi all I ran into a problem with my program, Its a golfing program that calls from a sub program. That part of it works but I have to add a moving target and when it gets within 10 feet it should tell me BULLSEYE, and then move again(choose another random number from 0 to 1000). Count the number of times they hit the ball, and the number of times the ball hits the target. Thanks
double elevationAngleE,horizontalDistance,initialVelocityV;
char another;
int target,random;
cout<<"Welcome to Jay's Driving Range."<<endl<<endl;
do{
cout<<"What type of club would you like to use";
cout<<"(3)-iron, (5)-iron, (7)-iron, or (9)-iron?"<<endl;
cin>>type;
cout<<"What is the % of force of the swing (0 to 100%)";
cout<<" example: 50% will be type in as 0.5"<<endl;
cin>>force;
while(force<0||force>1)
{
cout<<endl<<"Please re-enter Force";
cout<<" needs to be greater than 0 and less than 1.";
cout<<"(example: 50% will be type in as 0.5)"<<endl;
cin>>force;
}
cout<<"To make it a more interesting, we added a moving target";
cout<<" please pick a random number from 0 to 1000 feet."<<endl<<endl;
cin>>random;
srand(time(NULL));
cout<<"Do you want to try a different club?";
cin>>another;
while(another !='y'&& another!='n')
{cout<<endl<<"Please enter 'y' or 'n'"<<endl<<endl;
cin>>another;}
}
while (another=='y');
}