Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Need help with simple Prolog Program The Application Context: When a username pa

ID: 3810777 • Letter: N

Question

Need help with simple Prolog Program

The Application Context: When a username password combination fails, users are asked to answer a set of questions, such as the mother's maiden name, first pet's name etc., and allowed to reset the password in case the user answers a predetermined number of questions successfully. our objective is to enhance this capability. Assume that the kind of questions to be asked come in three categories, personal information (something about the user usage information (Information about the usage) and presence information (like the time of day, weather, temperature). Table 1 lists some potential attributes that can be queried as questions. You may add some more attributes Personal Information Presence Usage Job title Last name Time of Day Season (Summer Winter, etc Home directory Mother's maiden name Last day to login Yesterday's weather? First pet's name Last High School's name Month of last big storm Boss's name Mother's birth place Security clearance Randomly generated riddle Office number A Captcha Number of siblings Each answer is given a "difficulty score" between 0 and 10. For example, a user last name would get a score of 1, the first pet's name would get a score of 3 and the mother's maiden name would get a score of 8

Explanation / Answer

//password checking with previous hints

assignmenta 1 declared, we can assign any other also

#include<stdio.h>o
#include<stdlib.h>
#include<strings.h>
struct per
{
char mother[10];
char school[10];
int sib;
char pet[10];
}per={"radha","mpmc",2,"john"};
struct use
{
char job[15];
char boss[10];
char lst_login[15];
char office[10];  
}use={"software","jagan","10/03/2017","8985745416"};

main()
{
char *p,s[10],ch;
p=malloc(10);//passwprd len is 10 chars  
puts("enter ur pwd");//ur psw
gets(p);
label:
puts("enter ur psw");
gets(s);
if(strstr(s,p))
{
puts("true");return;}
else
while(1)
{
printf(" 1.pet name 2.mothers maidens name 3no. of sibings 4.high school name ");
ch=getchar();
getchar();
switch(ch)  
{
  
case'1':gets(s);   if(strstr(s,per.pet))
goto label;
else {puts("wrong");break;}
case'2':gets(s);   if(strstr(s,per.mother))
goto label;
else {puts("wrong");break;}
case'3':gets(s);   if(strstr(s,(char*)per.sib))
goto label;
else {puts("wrong");break;}
case'4':gets(s);   if(strstr(s,per.school))
goto label;
else {puts("wrong");break;}  
}
}
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote