Create several pieces of code to practice programming


Assignment

1 Encryption Program

In this assignment you will be asked to create several pieces of code to practice programming practices.

The required files you will be creating:

- tar directory.sh
- test encrypt.sh
- encrypt.c
- test encrypt.c
- svn.log
- makeftle

SVN

Subversion is a useful task even at a local level, it allows you to re-store old past version of code just in case you current code is wrong. Another use is project sharing but this becomes more important in future classes.

The objective here is to create a local SVN repository and show that you using this repository for correct use.

1. create the repository

2. create SEPERATE DIRECTORY create your project folder that will contain all your code for this assignment.

3. Check out this your repository to the your project folder.

4. commit,add, update and use the repository

5. submit svn log when handing in assignment 2

Tar file
Tarring is handy tool to have when submitting large projects because of its compressing abilities. As seen by the previous lab assignments, this can be done in a simple command tar but simply tarring everything is DANGEROUS.
For this section of the assignment you will need to create script that does the following:
- tar correct files into a folder
- reads in a user name for the folder
- concatinates your nsid to the end of the folder name
- compress only necessary files: .h,.c,makeftle,.sh,.txt
- DOES not include .svn folder or useless files like .o or executable example use:
marinaSchmidt : . / t a r f o l d e r . sh assig nme nt 2
marinaSchmidt : l s
assignment 2 mts 299 . ta r

Encryption

This is where you will be creating the main program that will encrypt and decrypt strings passed in by the user at execution time. For this assignment you will not be expected to program the whole project just yet, rather you will need to setup an environment that allows for quick testing and well planned functions.

Create encrypt.c that takes in user input from the execution of the program and print back what is taken in then print out the ASCII for of the input.

example:
marinaSchmidt : . / encrypt h e l l o world s t r i n g passed : h e l l o world
ASCII : 85121215 231518124

Note: use printf
hint: look at using argv to read in command line input at execution You will need to create stub functions for future work:
- convert to ascii() Note: you will implementing this function.
- scrambler()
- cipher()
- shifter()

You will need to implement convert to ascii() as well determine what pa- rameters the functions will take in and what they return. Please include sig- natures of each function in the header files and source files. Remember good programming practice is to make things simple and easy to test. Please add any other functions to the list if you see fit but you will need to explain in comments what the purpose of that function is.

Description:
- convert to ascii(): converts standard string format to decimal ascii code.
- scrambler(): moves characters in a string to different location in non linear manner.
- cipher(): applies a mathematical computation to each character to con- vert it to another letter.
- shifter(): adds an offset to each character to shift to another character.
You will need to add more detail on each function in the comment signature to show your plan of implementation.

testing scaffold

To ensure one code works, a user must test each function before starting a new one to ensure no cascading of bugs, this is known as TDD (test driven development).

create test functions for the above function list in separate file called test encrypt.c you will also need a header file such that test file can call those function's to test. Also create int main that calls all the test functions and output which ones failed, passed and any other useful output.

Right now all your tests should fail except convert to ascii. Make sure to record your output of these tests to output file to show it does correct test coverage.

testing script

Sometimes you will need to take in user input to test the program fully, but this can become painful when there is multiple tests to do. Creating a script to take in different input types is a useful and painless method of testing.

Write a script called test encrypt.sh runs your code with various input tests and shows the output of each test. To obtain full marks make the script user reader friendly in understanding if the output was correct or not.

makefile

In the next assignment this code will become big as it will need to include some extra libraries, therefore we need a makefile. Start with creating a makefile that compiles your code into .o object files and executable files. This section will be marked on proper use and format of the makefile.

Remember once you made a good makefile, you will never have to make another one again.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Create several pieces of code to practice programming
Reference No:- TGS01604032

Expected delivery within 24 Hours