i need to be able to make matches from the data i input, and also classifying between male and female. matches for person with specific traits (not one in the program) i really tried for the first part and now the rest is mentally disturbing me. and also to generate a report of partners found.
#include<string.h>
#include <iostream>
usingnamespace std;
char username[20];
char storedusername[20];
char password[20];
char storedpassword[20];
int loginresult;
char name[20];
int login()
{
int logins;
cout<<"username";
cin>>username;
cout<<"password";
cin>>password;
if((strcmp(username ,storedusername)==0)&&(strcmp(password,storedpassword)==0))
{
logins=1;
}
else
{
logins=0;
}
return logins;
}
void rregister ()
{
cout<<"enter your name"<<endl;
cin>>name;
cout<<"enter your username:";
cin>>storedusername;
cout<<"enter your password:";
cin>>storedpassword;
}
void match()
{
//*create structures to store information of the people to be matched*/
struct person
{
char name [20];
int age;
char region[20];
int pastr;
int height;
};
//*create an array to hold the structures that have information on people to be matched*/
struct person arrayOfStructures[10];
//*Enter the information of the people to be matched useing for loop*/
for(int i=1;i<=10;i++)
{
cout<<"Enter Information for person number: "<< i <<endl;
cout<<"NAME: ";
cin>> arrayOfStructures[i].name;
cout<<"AGE: ";
cin>> arrayOfStructures[i].age;
cout<<"REGION: ";
cin>> arrayOfStructures[i].region;
cout<<"PAST RELATIONSHIPS: ";
cin>> arrayOfStructures[i].pastr;
cout<<"HEIGHT: ";
cin>> arrayOfStructures[i].height;
}
}
int main()
{
rregister();
cout<<"Registration successfull "<<endl;
cout<<"Enter username and password to login "<<endl;
loginresult=login();
//if(loginresult!=1)
while(loginresult!=1)
{
cout<<"username or password is incorrect signn in again "<<endl;
loginresult=login();
}
cout<<"login success ";
match();
}