Hi guys, I am trying to write a program that will ask for users name, birthdate and pet and from those info I need to use a random number generator to select 6 char from the name and animal and 2 numbers from the birthdate. This is my code to far.
#include <iostream>
#include <math.h>
#include <cstdlib>
#include <ctime>
using namespace std;
// **************************
//
// Purpose of this program is to
// ask the user there name,favorite animal
// and birthday and generate a password
// base off of that
// **************************
int main () {
const int MAX = 100;
char name[MAX];
char birth[MAX];
char pet[MAX];
int password;
srand(time(0));
password = rand() % 7;
cout <<"Please enter your name :";
cin>>name;
cout <<"Please enter your birthday :";
cin>>birth;
cout <<"Please enter your favorite pet/animal :";
cin>>pet;
cout <<" password: ", password << '\n';
return 0;
}