Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

//CSE240 Spring 2019 HW3 // Enter your name here // State the IDE that you use: Visual Studio or GCC #include #include #pragma warning(disable :

image text in transcribedimage text in transcribed

//CSE240 Spring 2019 HW3

// Enter your name here // State the IDE that you use: Visual Studio or GCC

#include #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 1: initializeStrings (5 points) // Traverse the 2D array of characters variable 'strings' (input from user in main() ) and set all characters in each // array to a null terminator so that there is a 4 row and 35 column 2D array full of null terminators. // The null terminator is represented by the character value '

1. You are given hw03q1.c file, which contains a partially completed program. You are to follow the instructions contained in comments and complete the required functions. You will be writing functions for a program that does manipulation on 1-D and 2-D arrays. In one part, the program accepts four strings and an integer key as input from the user. The program will then use the integer key to encrypt the input strings (reversing the string and adding the key to each character in the string), decrypt the strings and then print the strings. In another function, one long user-input string is broken into sentences to count and print them. There is also a matrix operation of determinant which uses 2D integer array. Example output given below. Go through the C file and see the sample expected output below [50 points] CSE240 HWB 2D Character Arrays Enter string for encryption: This is CSE240 Enter string for encryption: homework three Enter string for encryption: Arizona state university Enter string for encryption: tempe Enter a key value for encryption: 2 Encrypted Strings 264GUE"uk"ukjv ggtjv"mtqygoqj vkutgxkpw"gvcvu"cpqlktc grogv Decrypted Strings: This is CSE240 homework three Arizona state university tempe Enter sentences(max 4): I am grad student. I study at ASU. I like movies. I am grad student I study at ASU I like movies Number of sentences 3 CSE240 HW3 2D Integer Arrays Enter matrix element [e][e]: 3 Enter matrix element ej01]: 5 Enter matrix element [e][2]: 7 Enter matrix element [1][e]: 9 Enter matrix element [1][2]: 5 Enter matrix element [2][e]: 7 Enter matrix element [2][1]: 3 Enter matrix element [2][2]: 1 matrixA 3 5 7 9 2 5 7 3 1 Determinant of matrix 182

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions