[Solved] CSE 102 Homework 6

$25

File Name: CSE_102_Homework_6.zip
File Size: 169.56 KB

SKU: [Solved] CSE 102 –Homework 6 Category: Tag:
5/5 - (1 vote)

CSE102 HW06In this homework, you are going to implement a program which encrypts, or decrypts a given message. The message contains only English letters and they are all in lowercase.Function: void menu()This is a menu function. User enters a choice to execute corresponding sub-program. When 0 is chosen, the program stops. Whenever a sub-program is finished, your program goes back to menu so that user can execute another sub-program. You are going to use do-while loop and switch case to implement this function. The user will have three different choices, i.e., {1, 2, or 0}. Any other input will be invalid, and program must display menu again when a wrong input is entered.Sample output if this function is:1. Encrypt2. Decrypt0. ExitChoice:Function: void encrypt_open_msg()This function reads content of open_msg.txt file, encrypts it, shows encrypted message on screen and then writes to secret_msg.txt file. In encryption, function asks for a key value that is actually a positive integer between 1 and 26 at the beginning. Then, it reads a line of the message, reverses the line, and replaces each character of the line by a corresponding letter in reverse direction. For instance, assume that the key is 5 and line is one word that is gebze. Reverse of gebze is ezbeg. ezbeg becomes zuwzb when function replaces each character by 5 in reverse direction (e->z, z->u, b->w, e->z, g->b).Sample input of the function (content of open_msg.txt):gebze technical university.Sample output of the function:Key: 5*zuwzb_ozxcidxvg_pidqzmndotFunction: void decrypt_secret_msg()This function reads each line of the message contained in secret_msg.txt, decrypts the secret line, shows the open line on screen and then writes the open line to open_msg.txt file. Decryption of a secret message is obtained by reversing the encryption operations.Sample input of the function (content of secret_msg.txt):*zuwzb_ozxcidxvg_pidqzmndotSample output of the function:Key: 5gebze technical universityFunction: int find_size_of_line(char line[])This function calculates number of characters in line[].Function: void reverse_line(char line[], int line_lenght)This function reverses content of line[].GEBZE TECHNICAL UNIVERSITYDEPARTMENT OF COMPUTER ENGINEERINGNotes: You are not allowed to use built-in string functions. Maximum line buffer is 1024. Space and dot is encrypted as _ and *, respectively. Decryption is the reverse.Due Date: Defined on Moodle.Submission Rule: student_no.zip (includes the followings) student_no.c open_msg.txt secret_msg.txt

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] CSE 102 Homework 6
$25