HOW CAN I ADD THE FIRST NAME. LAST NAME AND EMAIL ADDRESS TO THE SEARCH LIST? OR CAN YOU USE SWITCH STATEMENT ? THE PROBLEM HERE IS THAT I WANT TO INCLUDE THE FIRST NAME LAST NAMR OR EMAIL ADDRESS TO SEARCH THE PERSON I WANT TO SEARCH void search_person() { long int phone_1920213; printf("\n\nEnter Phone number of the person you want to search : "); scanf("%ld",&phone_1920213); FILE *fp; fp = fopen("phonebook_1920213", "rb"); if (fp == NULL) { printf("No results! The number you have searched is not of on the list. Plase try again !\n"); //print to continue using the program //press any key to continue. printf("\nKINDLY PRESS ANY KEY TO CONTINUE USING THE PROGRAM!\n"); return; } else { } int flag = 0; phonebook_1920213 p; while (fread(&p, sizeof(p), 1, fp) == 1) { if(p.contactnum_1920213==phone_1920213) printf("FIRST NAME\t\t\t\t SURNAME\t\t printf(" { _\n"); int i; int len1 = 40 - strlen (p.fname_1920213); int len2= 20 strlen(p.lastname_1920213); int len3= 15: printf("%s",p.fname_1920213); } for(i=0;i0;i

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
Don't try to use the AI platform or copy anything. If I see plagiarism I'll give you multiple downvotes this is for sure..
HOW CAN I ADD THE FIRST NAME. LAST NAME AND EMAIL ADDRESS TO THE SEARCH LIST? OR CAN YOU USE SWITCH STATEMENT
? THE PROBLEM HERE IS THAT I WANT TO INCLUDE THE FIRST NAME LAST NAMR OR EMAIL ADDRESS TO SEARCH THE PERSON I
WANT TO SEARCH
void search_person()
{
long int phone_1920213;
printf("\n\nEnter Phone number of the person you want to search : ");
scanf("%ld", &phone_1920213);
}
FILE *fp;
fp = fopen("phonebook_1920213", "rb");
if (fp == NULL)
{
}
printf("No results! The number you have searched is not of on the list. Plase try again !\n");
//print to continue using the program
//press any key to continue
printf("\nKINDLY PRESS ANY KEY TO CONTINUE USING THE PROGRAM!\n");
return;
else
{
int flag = 0;
phonebook_1920213 p;
while (fread(&p, sizeof(p), 1, fp) == 1)
{
printf("
if(p.contactnum_1920213 ==phone_1920213)
printf("FIRST NAME\t\t\t\t SURNAME\t\t
{
}
_\n");
int i;
int len140
strlen(p.fname_1920213);
int len2= 20 strlen(p.lastname_1920213);
int len3 = 15;
printf("%s",p.fname_1920213);
for(i=0;i<len1;i++) printf(" ");
printf("%s", p. lastname_1920213);
for(i=0;i<len2;i++) printf(" ");
printf("%ld",p.contactnum_1920213);
for(i>0;i<len3;i++) printf(" ");
printf("%s",p.email_1920213);
printf("\n");
flag = 1;
break;
}
else continue;
// fflush(stdin);
}
if(flag == 0)
{
PHONE NO\t\t EMAIL\n");
printf("\nNo Results! The Person you have entered is not in the Phonebook\n");
fflush(stdin);
fclose(fp);
//print to continue using the program
//press any key to continue
printf("\nKINDLY PRESS ANY KEY TO CONTINUE USING THE PROGRAM!\n");
Transcribed Image Text:HOW CAN I ADD THE FIRST NAME. LAST NAME AND EMAIL ADDRESS TO THE SEARCH LIST? OR CAN YOU USE SWITCH STATEMENT ? THE PROBLEM HERE IS THAT I WANT TO INCLUDE THE FIRST NAME LAST NAMR OR EMAIL ADDRESS TO SEARCH THE PERSON I WANT TO SEARCH void search_person() { long int phone_1920213; printf("\n\nEnter Phone number of the person you want to search : "); scanf("%ld", &phone_1920213); } FILE *fp; fp = fopen("phonebook_1920213", "rb"); if (fp == NULL) { } printf("No results! The number you have searched is not of on the list. Plase try again !\n"); //print to continue using the program //press any key to continue printf("\nKINDLY PRESS ANY KEY TO CONTINUE USING THE PROGRAM!\n"); return; else { int flag = 0; phonebook_1920213 p; while (fread(&p, sizeof(p), 1, fp) == 1) { printf(" if(p.contactnum_1920213 ==phone_1920213) printf("FIRST NAME\t\t\t\t SURNAME\t\t { } _\n"); int i; int len140 strlen(p.fname_1920213); int len2= 20 strlen(p.lastname_1920213); int len3 = 15; printf("%s",p.fname_1920213); for(i=0;i<len1;i++) printf(" "); printf("%s", p. lastname_1920213); for(i=0;i<len2;i++) printf(" "); printf("%ld",p.contactnum_1920213); for(i>0;i<len3;i++) printf(" "); printf("%s",p.email_1920213); printf("\n"); flag = 1; break; } else continue; // fflush(stdin); } if(flag == 0) { PHONE NO\t\t EMAIL\n"); printf("\nNo Results! The Person you have entered is not in the Phonebook\n"); fflush(stdin); fclose(fp); //print to continue using the program //press any key to continue printf("\nKINDLY PRESS ANY KEY TO CONTINUE USING THE PROGRAM!\n");
Expert Solution
steps

Step by step

Solved in 4 steps with 5 images

Blurred answer
Knowledge Booster
Lock objects
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education