char xusername[10];     char xbankname[10];     int xaccountnum[4];     int xcardnum[14];     int xpass[4];     int xwalletnum[11];     int xOTP[4];     printf("Enjoy a range of our banking services including cash withdrawals and deposits, card and loan installment payments, bill payments, smart wallet recharge, and card-less services.\n\n\n");     printf("If you are bank staff press 1. \t\t\t If you are a customer press 2.\n");     int num; label0:     scanf_s("%d", &num);     if (num == 1) {//bank staff         char bank_staff[10] = { "mahmoud" };         char xbank_staff[10];         int bank_pass[4] = { 5,5,5,5 };         int xbank_pass[4];         int doha = 0;     labelinf1:         printf("Enter your name.\n");         scanf_s("%s", xbank_staff, 10);         if (strcmp(xbank_staff, bank_staff) == 0) {             printf("Enter your password.\n");             scan_array(xbank_pass, 4);             for (int i = 0; i < 4; i++) {                 if (xbank_pass[i] == bank_pass[i]) {                     doha++;                 }                 else {                     printf("\aWrong password.\n");                     break;                 }             }             if (doha == 4) {                 printf("Enter the name you want to show their data.\n");                 char yara[10];             labelinf:                 scanf_s("%s", yara, 10);                 if (strcmp(yara, user[0].user_name) == 0) {                     printf("\n");                     print_struct(user[0].user_name, user[0].bank_name, user[0].account_num, 4, user[0].card_number, 14, user[0].balance);                 }                 else if (strcmp(yara, user[1].user_name) == 0) {                     printf("\n");                     print_struct(user[1].user_name, user[1].bank_name, user[1].account_num, 4, user[1].card_number, 14, user[1].balance);                 }                 else if (strcmp(yara, user[2].user_name) == 0) {                     printf("\n");                     print_struct(user[2].user_name, user[2].bank_name, user[2].account_num, 4, user[2].card_number, 14, user[2].balance);                 }                 else if (strcmp(yara, user[3].user_name) == 0) {                     printf("\n");                     print_struct(user[3].user_name, user[3].bank_name, user[3].account_num, 4, user[3].card_number, 14, user[3].balance);                 }                 else if (strcmp(yara, "x") == 0) {                     goto label3;                 }                 else {                     printf("\aError. Enter a valid username. or press x to end program.\n");                     goto labelinf;                 }             }             else {                 printf("\aError. Try again or press x to end program.\n");                 goto labelinf1;             }         } else if (strcmp(xbank_staff, "x") == 0) {             goto label3;         }         else {             printf("\aError. Enter a valid name or press x to end program.\n");             goto labelinf1;         }     }     else if (num == 2) {         printf("For card-less services press 1:\t\t\tIf you have a card press 2:\n");         int c;     label:         scanf_s("%d", &c);         if (c == 1) {//depositing money in a bank acounnt without card number , we will need the account number of the address you want to deposit money to             int choicey = 0;         label6:             printf("If you need to make a withdrawal PRESS 1\t\t\tIf you need to make a DEPOSIT PRESS 2\n");             scanf_s("%d", &choicey);             if (choicey == 1) A flowchart for that part of a code

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

char xusername[10];
    char xbankname[10];
    int xaccountnum[4];
    int xcardnum[14];
    int xpass[4];
    int xwalletnum[11];
    int xOTP[4];

    printf("Enjoy a range of our banking services including cash withdrawals and deposits, card and loan installment payments, bill payments, smart wallet recharge, and card-less services.\n\n\n");
    printf("If you are bank staff press 1. \t\t\t If you are a customer press 2.\n");
    int num;
label0:
    scanf_s("%d", &num);
    if (num == 1) {//bank staff
        char bank_staff[10] = { "mahmoud" };
        char xbank_staff[10];
        int bank_pass[4] = { 5,5,5,5 };
        int xbank_pass[4];
        int doha = 0;
    labelinf1:
        printf("Enter your name.\n");

        scanf_s("%s", xbank_staff, 10);
        if (strcmp(xbank_staff, bank_staff) == 0) {
            printf("Enter your password.\n");
            scan_array(xbank_pass, 4);
            for (int i = 0; i < 4; i++) {
                if (xbank_pass[i] == bank_pass[i]) {
                    doha++;
                }
                else {
                    printf("\aWrong password.\n");
                    break;
                }
            }
            if (doha == 4) {

                printf("Enter the name you want to show their data.\n");
                char yara[10];
            labelinf:
                scanf_s("%s", yara, 10);

                if (strcmp(yara, user[0].user_name) == 0) {
                    printf("\n");
                    print_struct(user[0].user_name, user[0].bank_name, user[0].account_num, 4, user[0].card_number, 14, user[0].balance);
                }
                else if (strcmp(yara, user[1].user_name) == 0) {
                    printf("\n");
                    print_struct(user[1].user_name, user[1].bank_name, user[1].account_num, 4, user[1].card_number, 14, user[1].balance);
                }
                else if (strcmp(yara, user[2].user_name) == 0) {
                    printf("\n");
                    print_struct(user[2].user_name, user[2].bank_name, user[2].account_num, 4, user[2].card_number, 14, user[2].balance);
                }
                else if (strcmp(yara, user[3].user_name) == 0) {
                    printf("\n");
                    print_struct(user[3].user_name, user[3].bank_name, user[3].account_num, 4, user[3].card_number, 14, user[3].balance);
                }
                else if (strcmp(yara, "x") == 0) {
                    goto label3;
                }
                else {
                    printf("\aError. Enter a valid username. or press x to end program.\n");
                    goto labelinf;


                }

            }
            else {
                printf("\aError. Try again or press x to end program.\n");
                goto labelinf1;
            }

        }

else if (strcmp(xbank_staff, "x") == 0) {
            goto label3;
        }
        else {
            printf("\aError. Enter a valid name or press x to end program.\n");
            goto labelinf1;
        }

    }
    else if (num == 2) {
        printf("For card-less services press 1:\t\t\tIf you have a card press 2:\n");
        int c;
    label:
        scanf_s("%d", &c);
        if (c == 1) {//depositing money in a bank acounnt without card number , we will need the account number of the address you want to deposit money to

            int choicey = 0;
        label6:
            printf("If you need to make a withdrawal PRESS 1\t\t\tIf you need to make a DEPOSIT PRESS 2\n");
            scanf_s("%d", &choicey);
            if (choicey == 1)

A flowchart for that part of a code

Expert Solution
steps

Step by step

Solved in 2 steps with 3 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY