Question
This is only 2 question problem, please help, thanks!! Code (Please use visual studio): #include #include #pragma warning(disable : 4996) // compiler directive for Visual
This is only 2 question problem, please help, thanks!!
Code (Please use visual studio):
#include
#pragma warning(disable : 4996) // compiler directive for Visual Studio only
// Read before you start: // You are given a partially complete program. Your job is to complete the functions in order for this program to work successfully. // All instructions are given above the required functions, please read them and follow them carefully. // You shoud not modify the function return types or parameters. // You can assume that all inputs are valid. Ex: If prompted for an integer, the user will input an integer.
// 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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started