Homework Solution: Correct my assignment for decryption and encryption FOR C language IN GCC(PUTTY) or VS…

    Correct my assignment for decryption and encryption FOR C language IN GCC(PUTTY) or VS Write functions for a program, which accepts 5 strings and an integer key as input from the keyboard. The program will then use the integer key to encrypt the input strings (adding the key to each character in the string), sort the encrypted strings by using stricmp(string1, string2) in VS or GCC for determining their order, decrypt the strings, and then print the strings. You will do this by using a 2D array of characters. You will also first need to initialize all indices in the 2D array of characters to “null terminators”. There are more instructions in the code below. Please read the comments carefully and do not change the main function. So, I wrote the code. but I am getting wrong output. Please correct them: #include <stdio.h> #include <string.h> //#pragma warning(disable : 4996)
    // Read before you start:
    // Do not modify any part of this program that you are given. Doing so may cause you to fail automated test cases.
    // You are given a partially complete program. Your job is to complete the functions in order for this program to work successfully.
    // You should complete this homework assignment using Microsoft Visual Studios 2013 (or a later version).
    // All instructions are given above the required functions, please read them and follow them carefully. 
    // If you modify the function return types or parameters, you will fail the automated test cases.
    // You can assume that all inputs are valid. Ex: If prompted for an integer, an integer will be input.
    // NOTE: For this assignment, you can assume that all input characters will be lowercase characters.
    
    // Global Macro Values. They are used to define the size of a 5 x 32 two-dimensional array of characters #define NUM_STRINGS 5 #define STRING_LENGTH 32 // Forward Declarations void initializeStrings(char[NUM_STRINGS][STRING_LENGTH]); void encryptStrings(char[NUM_STRINGS][STRING_LENGTH], int); void decryptStrings(char[NUM_STRINGS][STRING_LENGTH], int); void swapStrings(char[STRING_LENGTH], char[STRING_LENGTH]); void sortStrings(char[NUM_STRINGS][STRING_LENGTH]); void printStrings(char[NUM_STRINGS][STRING_LENGTH]); // Problem 1: initializeStrings (5 points)
    // Traverse the 2D array of characters variable 'strings' (in the main program) and set all 32 characters in each of 
    // the 5 char arrays to a null terminator so that there is a 5 row and 32 column 2D array full of null terminators.
    // The null terminator is represented by the character value '' and is used to denote the end of a string.
    // This will come in use later in the program when you will need to print the 2D array of characters.
    
    void initializeStrings(char strings[NUM_STRINGS][STRING_LENGTH]) { int i,j; for(i=0;i<NUM_STRINGS;i++) { for(j=0;j<STRING_LENGTH;j++) { strings[i][j]=''; } } } // Problem 2: encryptStrings (5 points)
    // Traverse the 2D array of characters variable 'strings' and encrypt each string using the integer value 'key'.
    // In order to encrypt the 2D array of characters, we will shift those ASCII characters forward by the integer value of 'key'.
    // If the string is "hello" and key = 2, we will shift those characters forward in ASCII by 2 and the result will be "jgnnq".
    // The case above is an example of a string that has alphabetical letters in the encrypted and decrypted string.
    // Once the value of 'key' gets larger, you will extend past alphabetical characters and reach non-alphabetical characters.
    // NOTE: DO NOT encrypt the null terminator characters. Use the null terminators to find the end of each array of characters.
    
    void encryptStrings(char strings[NUM_STRINGS][STRING_LENGTH], int key) { int i,j; for(i=0;i<NUM_STRINGS;i++) { for(j=0;j<STRING_LENGTH;j++) { if(strings[i][j]=='') { break; } else { int ascii_code=strings[i][j]; strings[i][j]=ascii_code+2; } } } } // Problem 3: decryptStrings (5 points)
    // Traverse the 2D array of characters variable 'strings' and decrypt each string using the integer value 'key'.
    // In order to decrypt the 2D array of characters, we will shift those ASCII characters backwards by the integer value of 'key'.
    // If the string is "jgnnq" and key = 2, we will shift those characters backward in ASCII by 2 and the result will be "hello".
    // NOTE: DO NOT decrypt the null terminator characters. Use the null terminators to find the end of each array of characters.
    // HINT: This should be very similiar to the encryption function defined above in Problem 2.
    void decryptStrings(char strings[NUM_STRINGS][STRING_LENGTH], int key)
    
    void decryptStrings(char strings[NUM_STRINGS][STRING_LENGTH], int key) { int i,j; for(i=0;i<NUM_STRINGS;i++) { for(j=0;j<STRING_LENGTH;j++) { if(strings[i][j]=='') { break; } else { int ascii_code=strings[i][j]; strings[i][j]=ascii_code-2; } } } } // Problem 4: swapStrings (5 points)
    // Swap the strings that are passed as parameters, this function will be used in Problem 5.
    // If string1 is "hello" and string2 is "goodbye", after calling this function, string1 will be "goodbye" and string2 will be "hello".
    void swapStrings(char string1[STRING_LENGTH], char string2[STRING_LENGTH])
    
    void swapStrings(char string1[STRING_LENGTH], char string2[STRING_LENGTH]) { char temp_string; int i; for(i=0;i<STRING_LENGTH;i++) { temp_string=string1[i]; string1[i]=string2[i]; string2[i]=temp_string; } } // Problem 5: sortStrings (20 points)
    // Sort the 5 strings contained in the 2D character array parameter labeled "strings".
    // Sort the strings based on their ASCII character value (use stricmp or strcasecmp to compare strings).
    // NOTE: You MUST incorporate your "swapStrings" function to recieve full points for this part.
    // See the output provided in the word document for example input and output.
    
    void sortStrings(char strings[NUM_STRINGS][STRING_LENGTH]) { int i,j; for(i=0;i<NUM_STRINGS;i++) { for(j=0;j<NUM_STRINGS;j++) { if(strcmp(strings[i],strings[j])>0) { swapStrings(strings[i],strings[j]); } } } } // Problem 6: printStrings (10 points)
    // Traverse the 2D character array "strings" and print each of the contained strings.
    // See the example outputs provided in the word document. Your output should match the example outputs.
    
    void printStrings(char strings[NUM_STRINGS][STRING_LENGTH]) { int i; for(i=0;i<NUM_STRINGS;i++) { printf("nString %d : %s",(i+1),strings[i]); } }
    // You should study and understand how this main function works.
    // Do not modify it in any way, there is no implementation needed here.
    void main()
    {
            char strings[NUM_STRINGS][STRING_LENGTH]; // will store 5 strings each with a max length of 32
            int key, i;
            char input[STRING_LENGTH];
            initializeStrings(strings);
    
            printf("Assignment 3: 2D Character Arraysnn");
    
            for (i = 0; i < NUM_STRINGS; i++)
            {
                    printf("Enter the next String: "); // prompt for string
                    fgets(input, sizeof(input), stdin); // store input string
                    input[strlen(input) - 1] = ''; // convert trailing 'n' char to '' (null terminator)
                    strcpy(strings[i], input); // copy input to 2D strings array
            }
    
            printf("Enter a key value for encryption: "); // prompt for integer
            scanf("%d", &key); // store integer
    
            encryptStrings(strings, key);
            printf("nEncrypted Strings:n");
            printStrings(strings);
            sortStrings(strings);
            decryptStrings(strings, key);
            printf("nSorted Strings:n");
            printStrings(strings);
            i = getchar(); // remove the character 'n'
            i = getchar(); // keep console open
    }
    
    These are my wrong outpul compared with the right outputs: Current wrong output Assignment 3: 2D Character Arrays Enter the next String: orange Enter the next String: pink Enter the next String: green Enter the next String: violet Enter the next String: blue Enter a key value for encryption: 3 Encrypted Strings: qtcpig rkpm itggp xkqngv dnwg Sorted Strings: violet pink orange green blue Desired right output: Scenario 2 Wrong Current Output: Desired right output: Scenario3: Wrong current output: Desired correct output:
    Assignment 3: 2D Character Arrays Enter the next String: orange Enter the next String: pink Enter the next String: green Enter the next String: violet Enter the next String: blue Enter a key value for encryption: 3 Encrypted Strings: qtcpig rkpm itggp xkqngv dnwg Sorted Strings: violet pink orange green blue

    Expert Answer

     
    /*The source code of the modified program is given below; Modified coding parts are highlighted in BOLD;*/ #include <stdio.h> #include <string.h>

    Redress my ordinance control decryption and encryption FOR C diction IN GCC(PUTTY) or VS

    Write operations control a program, which accepts 5 strings and an integer solution as input from the solutionboard. The program gain then redression the integer solution to encrypt the input strings (adding the solution to each quality in the string), class the encrypted strings by using stricmp(string1, string2) in VS or GCC control determining their arrange, decrypt the strings, and then stereotype the strings. You gain do this by using a 2D equip of qualitys. You gain to-boot pristine want to initialize whole indices in the 2D equip of qualitys to “inoperative terminators”. There are further instructions in the legislation adown. Delight decipher the comments carefully and do referable alter the deep operation. So, I wrote the legislation. excepting I am getting evil-doing output. Delight redress them:

    #include <stdio.h>
    #include <string.h>

    //#pragma caution(referable designate : 4996)

    // Decipher anteriorly you start:
    // Do referable differ any portio of this program that you are fond. Doing so may cacorrection you to trip automated criterion instances.
    // You are fond a portioially consummate program. Your lesson is to consummate the operations in arrange control this program to production successfully.
    // You should consummate this homeproduction ordinance using Microsoft Visual Studios 2013 (or a posterior statement).
    // Whole instructions are fond over the required operations, delight decipher them and supervene them carefully. 
    // If you differ the operation recompense types or parameters, you gain trip the automated criterion instances.
    // You can arrogate that whole inputs are efficient. Ex: If alerted control an integer, an integer gain be input.
    // NOTE: Control this ordinance, you can arrogate that whole input qualitys gain be lowerinstance qualitys.
    

    // Global Macro Estimates. They are redressiond to designate the largeness of a 5 x 32 two-dimensional equip of qualitys

    #designate NUM_STRINGS 5
    #designate STRING_LENGTH 32

    // Controlward Declarations
    void initializeStrings(char[NUM_STRINGS][STRING_LENGTH]);
    void encryptStrings(char[NUM_STRINGS][STRING_LENGTH], int);
    void decryptStrings(char[NUM_STRINGS][STRING_LENGTH], int);
    void swapStrings(char[STRING_LENGTH], char[STRING_LENGTH]);
    void classStrings(char[NUM_STRINGS][STRING_LENGTH]);
    void stereotypeStrings(char[NUM_STRINGS][STRING_LENGTH]);

    // Problem 1: initializeStrings (5 points)

    // Traverse the 2D equip of qualitys changeable 'strings' (in the deep program) and established whole 32 qualitys in each of 
    // the 5 char equips to a inoperative terminator so that there is a 5 grade and 32 post 2D equip liberal of inoperative terminators.
    // The inoperative terminator is represented by the quality estimate '' and is redressiond to portray the purpose of a string.
    // This gain succeeding in redression posterior in the program when you gain want to stereotype the 2D equip of qualitys.
    

    void initializeStrings(char strings[NUM_STRINGS][STRING_LENGTH])
    {
    int i,j;
    for(i=0;i<NUM_STRINGS;i++)
    {
    for(j=0;j<STRING_LENGTH;j++)
    {
    strings[i][j]=’’;
    }
    }
    }

    // Problem 2: encryptStrings (5 points)

    // Traverse the 2D equip of qualitys changeable 'strings' and encrypt each string using the integer estimate 'key'.
    // In arrange to encrypt the 2D equip of qualitys, we gain transfer those ASCII qualitys controlward by the integer estimate of 'key'.
    // If the string is "hello" and solution = 2, we gain transfer those qualitys controlward in ASCII by 2 and the purpose gain be "jgnnq".
    // The instance over is an vision of a string that has alphabetical lore in the encrypted and decrypted string.
    // Once the estimate of 'key' gets larger, you gain extpurpose departed alphabetical qualitys and thrust non-alphabetical qualitys.
    // NOTE: DO NOT encrypt the inoperative terminator qualitys. Redression the inoperative terminators to experience the purpose of each equip of qualitys.
    

    void encryptStrings(char strings[NUM_STRINGS][STRING_LENGTH], int solution)
    {
    int i,j;
    for(i=0;i<NUM_STRINGS;i++)
    {
    for(j=0;j<STRING_LENGTH;j++)
    {
    if(strings[i][j]==’’)
    {
    break;
    }
    else
    {
    int ascii_code=strings[i][j];
    strings[i][j]=ascii_code+2;
    }
    }
    }
    }

    // Problem 3: decryptStrings (5 points)

    // Traverse the 2D equip of qualitys changeable 'strings' and decrypt each string using the integer estimate 'key'.
    // In arrange to decrypt the 2D equip of qualitys, we gain transfer those ASCII qualitys awkwards by the integer estimate of 'key'.
    // If the string is "jgnnq" and solution = 2, we gain transfer those qualitys awkward in ASCII by 2 and the purpose gain be "hello".
    // NOTE: DO NOT decrypt the inoperative terminator qualitys. Redression the inoperative terminators to experience the purpose of each equip of qualitys.
    // HINT: This should be very similiar to the encryption operation designated over in Problem 2.
    void decryptStrings(char strings[NUM_STRINGS][STRING_LENGTH], int solution)
    

    void decryptStrings(char strings[NUM_STRINGS][STRING_LENGTH], int solution)
    {
    int i,j;
    for(i=0;i<NUM_STRINGS;i++)
    {
    for(j=0;j<STRING_LENGTH;j++)
    {
    if(strings[i][j]==’’)
    {
    break;
    }
    else
    {
    int ascii_code=strings[i][j];
    strings[i][j]=ascii_code-2;
    }
    }
    }
    }

    // Problem 4: swapStrings (5 points)

    // Swap the strings that are passed as parameters, this operation gain be redressiond in Problem 5.
    // If string1 is "hello" and string2 is "goodbye", succeeding pursuit this operation, string1 gain be "goodbye" and string2 gain be "hello".
    void swapStrings(char string1[STRING_LENGTH], char string2[STRING_LENGTH])
    

    void swapStrings(char string1[STRING_LENGTH], char string2[STRING_LENGTH])
    {
    char temp_string;
    int i;
    for(i=0;i<STRING_LENGTH;i++)
    {
    temp_string=string1[i];
    string1[i]=string2[i];
    string2[i]=temp_string;
    }
    }

    // Problem 5: classStrings (20 points)

    // Class the 5 strings contained in the 2D quality equip parameter labeled "strings".
    // Class the strings domiciled on their ASCII quality estimate (correction stricmp or strcasecmp to assimilate strings).
    // NOTE: You MUST weld your "swapStrings" operation to recieve liberal points control this portio.
    // See the output supposing in the signal instrument control vision input and output.
    

    void classStrings(char strings[NUM_STRINGS][STRING_LENGTH])
    {
    int i,j;
    for(i=0;i<NUM_STRINGS;i++)
    {
    for(j=0;j<NUM_STRINGS;j++)
    {
    if(strcmp(strings[i],strings[j])>0)
    {
    swapStrings(strings[i],strings[j]);
    }
    }
    }
    }

    // Problem 6: stereotypeStrings (10 points)

    // Traverse the 2D quality equip "strings" and stereotype each of the contained strings.
    // See the vision outputs supposing in the signal instrument. Your output should mate the vision outputs.
    

    void stereotypeStrings(char strings[NUM_STRINGS][STRING_LENGTH])
    {
    int i;
    for(i=0;i<NUM_STRINGS;i++)
    {
    printf(“nString %d : %s”,(i+1),strings[i]);
    }
    }

    // You should examine and know how this deep operation productions.
    // Do referable differ it in any method, there is no implementation wanted here.
    void deep()
    {
            char strings[NUM_STRINGS][STRING_LENGTH]; // gain treasure 5 strings each with a max prolixity of 32
            int solution, i;
            char input[STRING_LENGTH];
            initializeStrings(strings);
    
            stereotypef("Ordinance 3: 2D Quality Equipsnn");
    
            control (i = 0; i < NUM_STRINGS; i++)
            {
                    stereotypef("Enter the present String: "); // alert control string
                    fgets(input, largenessof(input), stdin); // treasure input string
                    input[strlen(input) - 1] = ''; // apply inoculation 'n' char to '' (inoperative terminator)
                    strcpy(strings[i], input); // vision input to 2D strings equip
            }
    
            stereotypef("Enter a solution estimate control encryption: "); // alert control integer
            scanf("%d", &key); // treasure integer
    
            encryptStrings(strings, solution);
            stereotypef("nEncrypted Strings:n");
            stereotypeStrings(strings);
            classStrings(strings);
            decryptStrings(strings, solution);
            stereotypef("nSorted Strings:n");
            stereotypeStrings(strings);
            i = getchar(); // abstract the quality 'n'
            i = getchar(); // protect solace open
    }
    

    These are my evil-doing outpul assimilated with the direct outputs:

    Popular evil-doing output

    Ordinance 3: 2D Quality Equips Enter the present String: orange-colored-colored-colored-flame-flame Enter the present String: pink Enter the present String: inexperienced Enter the present String: violet Enter the present String: cerulean Enter a solution estimate control encryption: 3 Encrypted Strings: qtcpig rkpm itggp xkqngv dnwg Classed Strings: violet pink orange-colored-colored-colored-flame-flame inexperienced cerulean

    Desired direct output:

    Scenario 2

    Evil-doing Popular Output:

    Desired direct output:

    Scenario3:

    Evil-doing popular output:

    Desired redress output:

    Ordinance 3: 2D Quality Equips Enter the present String: orange-colored-colored-colored-flame-flame Enter the present String: pink Enter the present String: inexperienced Enter the present String: violet Enter the present String: cerulean Enter a solution estimate control encryption: 3 Encrypted Strings: qtcpig rkpm itggp xkqngv dnwg Classed Strings: violet pink orange-colored-colored-colored-flame-flame inexperienced cerulean

    Expert Tally

     

    /*The commencement legislation of the mitigated program is fond adown; Mitigated coding portios are highlighted in BOLD;*/

    #include <stdio.h>

    #include <string.h>

    //#pragma caution(referable designate : 4996)

    // Decipher anteriorly you start:

    // Do referable differ any portio of this program that you are fond. Doing so may cacorrection you to trip automated criterion instances.

    // You are fond a portioially consummate program. Your lesson is to consummate the operations in arrange control this program to production successfully.

    // You should consummate this homeproduction ordinance using Microsoft Visual Studios 2013 (or a posterior statement).

    // Whole instructions are fond over the required operations, delight decipher them and supervene them carefully.

    // If you differ the operation recompense types or parameters, you gain trip the automated criterion instances.

    // You can arrogate that whole inputs are efficient. Ex: If alerted control an integer, an integer gain be input.

    // NOTE: Control this ordinance, you can arrogate that whole input qualitys gain be lowerinstance qualitys.

    // Global Macro Estimates. They are redressiond to designate the largeness of a 5 x 32 two-dimensional equip of qualitys

    #designate NUM_STRINGS 5

    #designate STRING_LENGTH 32

    // Controlward Declarations

    void initializeStrings(char[NUM_STRINGS][STRING_LENGTH]);

    void encryptStrings(char[NUM_STRINGS][STRING_LENGTH], int);

    void decryptStrings(char[NUM_STRINGS][STRING_LENGTH], int);

    void swapStrings(char[STRING_LENGTH], char[STRING_LENGTH]);

    void classStrings(char[NUM_STRINGS][STRING_LENGTH]);

    void stereotypeStrings(char[NUM_STRINGS][STRING_LENGTH]);

    // Problem 1: initializeStrings (5 points)

    // Traverse the 2D equip of qualitys changeable ‘strings’ (in the deep program) and established whole 32 qualitys in each of

    // the 5 char equips to a inoperative terminator so that there is a 5 grade and 32 post 2D equip liberal of inoperative terminators.

    // The inoperative terminator is represented by the quality estimate ‘’ and is redressiond to portray the purpose of a string.

    // This gain succeeding in redression posterior in the program when you gain want to stereotype the 2D equip of qualitys.

    void initializeStrings(char strings[NUM_STRINGS][STRING_LENGTH])

    {

    int i,j;

    for(i=0;i<NUM_STRINGS;i++)

    {

    for(j=0;j<STRING_LENGTH;j++)

    {

    strings[i][j]=’’;

    }

    }

    }

    // Problem 2: encryptStrings (5 points)

    // Traverse the 2D equip of qualitys changeable ‘strings’ and encrypt each string using the integer estimate ‘key’.

    // In arrange to encrypt the 2D equip of qualitys, we gain transfer those ASCII qualitys controlward by the integer estimate of ‘key’.

    // If the string is “hello” and solution = 2, we gain transfer those qualitys controlward in ASCII by 2 and the purpose gain be “jgnnq”.

    // The instance over is an vision of a string that has alphabetical lore in the encrypted and decrypted string.

    // Once the estimate of ‘key’ gets larger, you gain extpurpose departed alphabetical qualitys and thrust non-alphabetical qualitys.

    // NOTE: DO NOT encrypt the inoperative terminator qualitys. Redression the inoperative terminators to experience the purpose of each equip of qualitys.

    void encryptStrings(char strings[NUM_STRINGS][STRING_LENGTH], int solution)

    {

    int i,j;

    for(i=0;i<NUM_STRINGS;i++)

    {

    for(j=0;j<STRING_LENGTH;j++)

    {

    if(strings[i][j]==’’)

    {

    break;

    }

    else

    {

    int ascii_code=strings[i][j];

    strings[i][j]=ascii_code+key;

    }

    }

    }

    }

    // Problem 3: decryptStrings (5 points)

    // Traverse the 2D equip of qualitys changeable ‘strings’ and decrypt each string using the integer estimate ‘key’.

    // In arrange to decrypt the 2D equip of qualitys, we gain transfer those ASCII qualitys awkwards by the integer estimate of ‘key’.

    // If the string is “jgnnq” and solution = 2, we gain transfer those qualitys awkward in ASCII by 2 and the purpose gain be “hello”.

    // NOTE: DO NOT decrypt the inoperative terminator qualitys. Redression the inoperative terminators to experience the purpose of each equip of qualitys.

    // HINT: This should be very similiar to the encryption operation designated over in Problem 2.

    void decryptStrings(char strings[NUM_STRINGS][STRING_LENGTH], int solution)

    {

    int i,j;

    for(i=0;i<NUM_STRINGS;i++)

    {

    for(j=0;j<STRING_LENGTH;j++)

    {

    if(strings[i][j]==’’)

    {

    break;

    }

    else

    {

    int ascii_code=strings[i][j];

    strings[i][j]=ascii_code-key;

    }

    }

    }

    }

    // Problem 4: swapStrings (5 points)

    // Swap the strings that are passed as parameters, this operation gain be redressiond in Problem 5.

    // If string1 is “hello” and string2 is “goodbye”, succeeding pursuit this operation, string1 gain be “goodbye” and string2 gain be “hello”.

    void swapStrings(char string1[STRING_LENGTH], char string2[STRING_LENGTH])

    {

    char temp_string[STRING_LENGTH];

    int i;

    for(i=0;i<STRING_LENGTH;i++)

    {

    temp_string[i]=string1[i];

    }

    for(i=0;i<STRING_LENGTH;i++)

    {

    string1[i]=string2[i];

    }

    for(i=0;i<STRING_LENGTH;i++)

    {

    string2[i]=temp_string[i];

    }

    }

    // Problem 5: classStrings (20 points)

    // Class the 5 strings contained in the 2D quality equip parameter labeled “strings”.

    // Class the strings domiciled on their ASCII quality estimate (correction stricmp or strcasecmp to assimilate strings).

    // NOTE: You MUST weld your “swapStrings” operation to recieve liberal points control this portio.

    // See the output supposing in the signal instrument control vision input and output.

    void classStrings(char strings[NUM_STRINGS][STRING_LENGTH])

    {

    int i,j;

    for(i=0;i<NUM_STRINGS;i++)

    {

    for(j=0;j<NUM_STRINGS;j++)

    {

    if(stricmp(strings[i],strings[j])<0)

    {

    swapStrings(strings[i],strings[j]);

    }

    }

    }

    }

    // Problem 6: stereotypeStrings (10 points)

    // Traverse the 2D quality equip “strings” and stereotype each of the contained strings.

    // See the vision outputs supposing in the signal instrument. Your output should mate the vision outputs.

    void stereotypeStrings(char strings[NUM_STRINGS][STRING_LENGTH])

    {

    int i;

    for(i=0;i<NUM_STRINGS;i++)

    {

    printf(“String %d : %sn”,(i+1),strings[i]);

    }

    }

    // You should examine and know how this deep operation productions.

    // Do referable differ it in any method, there is no implementation wanted here.

    void deep()

    {

    char strings[NUM_STRINGS][STRING_LENGTH]; // gain treasure 5 strings each with a max prolixity of 32

    int solution, i;

    char input[STRING_LENGTH];

    initializeStrings(strings);

    printf(“Ordinance 3: 2D Quality Equipsnn”);

    control (i = 0; i < NUM_STRINGS; i++)

    {

    printf(“Enter the present String: “); // alert control string

    fgets(input, largenessof(input), stdin); // treasure input string

    input[strlen(input) – 1] = ‘’; // apply inoculation ‘n’ char to ‘’ (inoperative terminator)

    strcpy(strings[i], input); // vision input to 2D strings equip

    }

    printf(“Enter a solution estimate control encryption: “); // alert control integer

    scanf(“%d”, &key); // treasure integer

    encryptStrings(strings, solution);

    printf(“nEncrypted Strings:n”);

    printStrings(strings);

    sortStrings(strings);

    decryptStrings(strings, solution);

    printf(“nSorted Strings:n”);

    printStrings(strings);

    i = getchar(); // abstract the quality ‘n’

    i = getchar(); // protect solace open

    }

    /*Control emend knowing output screenshots are fast here*/