Question: c++ program ( #include #include #include #include #include using std::cin; using std::cout; using std::endl; using std::setw; ) we can just use these things with functions(void,
c++ program
( #include
using std::cin; using std::cout; using std::endl; using std::setw;
)
we can just use these things with functions(void, int ,bool functions) (char array)
we can't use string
const int MAX_STRS=10
MAX_STR_LEN=100
in the int main
char inp_passwd[MAX_STRS][MAX_STR_LEN]; char mandatory[MAX_STRS][MAX_STR_LEN];
out_passwd[MAX_STRS][MAX_STR_LEN];
we will request the user first to enter an number from zero until 10 just after this the user will enter numbers of passwords
mean if the user enter 4 after this he will enter 4 passwords (it will be saved in inp_passwd)
after this to enter one more number and the user after this will put number of lines in mandatory sentence
mean if the user enter 3 he will add three lines in mandatory array in every line one sentence
the program will check every password contain at least on letter or one index was same of the madatory
for example:
3
hi,sajag
loashgsl
saoeyw
2
i211111
lase
the program should first take (hi,sajag) and see if there is at least on index in it found in mandatory[0][i](i here mean all the index in first row)
if there is an index that equal any index in mandatory[0] here i is found in inp_passwd)and in manadatory[0])
he will check after this if there is one index found in mandatory[1] equal same in inp_passwd[0] here (hi,sajag)contain a that found in lase
and after this print out the whole passwrd wich mean (hi,sajag)
the same thing for other passwords ,
the passwords that is true we should save them in the out_passwrd array and after this print out the out_passwrd
one more example:

i start doing it but couldn't complete if you can complete in it it will be very good
//--------------include section--------------
#include
//-------------using section----------------
using std::cin; using std::cout; using std::endl; using std::setw;
//----------------const section-------------
const int MAX_STRS = 10; const int MAX_STR_LEN = 100; void enter_pas(char inp_passwd[][MAX_STR_LEN], char mandatory[][MAX_STR_LEN], int num,int num1); bool first_pas(char inp_passwd[][MAX_STR_LEN], char mandatory[][MAX_STR_LEN], int s);
void check_out(char inp_passwd[][MAX_STR_LEN], char mandatory[][MAX_STR_LEN], int num1);
//---------main section-------------- int main() { char inp_passwd[MAX_STRS][MAX_STR_LEN]; char mandatory[MAX_STRS][MAX_STR_LEN]; char out_passwd[MAX_STRS][MAX_STR_LEN]; int num, num1; cin >> num; cin >> num1; enter_pas(inp_passwd, mandatory, num, num1); check_out(inp_passwd,mandatory,num1); return EXIT_SUCCESS;
} void enter_pas(char inp_passwd[][MAX_STR_LEN], char mandatory[][MAX_STR_LEN] , int num,int num1) { for (int i = 0; i > setw(MAX_STR_LEN)>> inp_passwd[i]; } for (int i = 0; i > setw(MAX_STR_LEN) >> mandatory[i]; } } bool first_pas(char inp_passwd[][MAX_STR_LEN], char mandatory[][MAX_STR_LEN], int s) { int dependes = false; int size_inp = strlen(inp_passwd[0]); int size_of_man = strlen(mandatory[s]); for (int i = 0; i 3 ABCaD2I?! Ekshas Bvd01c! 4 0123456789 abcde ABCDE ?! ABCaD2I?! Byd01C
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
