Question: // Global Macro Values. They are used to define the size of 2D array of characters #define NUM_STRINGS 4 #define STRING_LENGTH 50 // Forward Declarations

// Global Macro Values. They are used to define the size of 2D array of

characters

#define NUM_STRINGS 4

#define STRING_LENGTH 50

// Forward Declarations

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

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

void reverseStrings(char strings[NUM_STRINGS][STRING_LENGTH]);

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

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

int splitAndPrintSentences(char s[NUM_STRINGS*STRING_LENGTH]);

void inputMatrix(int matrixA[3][3]);

void determinant(int matrixA[3][3]);

// Problem 3: reverseString (5 points)

// Reverse each string of strings[][].

// Consider one string at a time and reverse the characters. For instance,

"hi hello" should reverse to "olleh ih".

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

{

}

// Problem 4: encryptStrings (5 points)

// Traverse the 2D character array 'strings' and encrypt each string in 2

steps as follows-

// 1) Reverse the string.

// Hint: Use 'reverseStrings()' for this step.

// 2) Then shift those ASCII characters forward by the integer value of

'key'.

// If the string is "hello" and key = 2, reversing will get you "olleh"

and adding key to it will result in "qnnfj"

// If the value of 'key' is large, you will extend past the alphabetical

characters and reach non-alphabetical characters. Thats ok.

// NOTE: DO NOT encrypt the null terminator character. Use the null

terminator '\0' to find the end string.

// *** NOTE: If you were unable to code for reverseStrings(), then skip

that step in this function and simply shift the characters ahead by 'key'.

// While decrypting in the next function, you will again

have to skip the reversing part. You will get partial points in that case.

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

{

}

// Problem 5: decryptStrings (5 points)

// HINT: This should be very similiar to the encryption function defined

above.

// Traverse the 2D character array 'strings' and decrypt each string in 2

steps as follows-

// 1) Shift those ASCII characters backward by the integer value of 'key'.

// 2) Then reverse the string.

// Hint: Use 'reverseStrings()' for this step.

// *** NOTE: If you were unable to code for reverseStrings(), then skip

that step in this function and simply shift the characters backward by

'key'.

// You will get partial points in that case.

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

{

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!