Write a java, c#,c/c++ program for file/directory processing

Assignment Help Basic Computer Science
Reference no: EM13971752

Write a Java, C# or C/C++ program (the choice is yours) for file/directory processing according to the following rules. The program requested for this project must have a text menu like this:

0 - Exit

1 - Select directory

2 - List directory content (first level)

3 - List directory content (all levels)

4 - Delete file

5 - Display file (hexadecimal view)

6 - Encrypt file (XOR with password)

7 - Decrypt file (XOR with password)

Select option:

The menu is displayed and the user must select an option (a number between 0 and 7). The action corresponding to the selection is performed, then the menu is displayed again and the user can choose another option. This cycle is repeated until the user selects 0, which exits the loop and ends the program.

The options are:

0 - Exit

This options ends the program

1 - Select directory

The user is prompted for a directory [absolute] name. This is the first options that must be selected by the user. All the options below are working on the directory selected here. After performing several operations on the selected directory, the user can select another directory and work with it.

2 - List directory content (first level)

This option displays the content of the selected directory on the screen. All the files and sub-directories from the first level must be displayed (files and directories should be listed separately). If no directory was selected an error message must be displayed.

3 - List directory content (all levels)

This option displays the content of the selected directory on the screen. All the files and sub-directories from the first and subsequent levels must be displayed (files and directories should be listed separately). If no directory was selected an error message must be displayed.

4 - Delete file

This option prompts the user for a filename and deletes that file from the selected directory. If no directory was selected an error message must be displayed. If the directory does not contain the file specified by the user, an error message must be displayed. The filename does not include any path, it's just the name of the file.

5 - Display file (hexadecimal view)

This option prompts the user for a filename (from the selected directory) and displays the content of that file on the screen, in hexadecimal view. If no directory was selected an error message must be displayed. If the directory does not contain the file specified by the user, an error message must be displayed. The filename does not include any path, it's just the name of the file.

Note 1: The hexadecimal view displays each byte of the file in hexadecimal; it should look something like this, but simpler:

Note2: The ASCII representation, the Current Offset and the Value Preview are NOT required; also there is no window, no graphics, no colors, just black and white text display. Being a text only display, you are required to display ONLY the Data Offset and the Hexadecimal Representation.

6 - Encrypt file (XOR with password)

This option prompts the user for a password (max 256 bytes long, may contain letters, digits, other characters) and then prompts the user for a filename and encrypts the content of the selected file using that password. The encryption method is very simple: just XOR the password with the file content byte after byte; the password being shorter than the file content, you must repeat the password as needed.

Example:

passwordpasswordpasswordpasswordpasswordpasswordpass

this is the file content that we need to encrypt now

chiphertext is obtained here by XORing byte to byte

Note1: the user must be prompted for the filename of the encrypted file (containing the ciphertext) as well, otherwise we would need to overwrite the initial file.

Note2: If no directory was selected an error message must be displayed. If the directory does not contain either of the files specified by the user, an error message must be displayed. The filenames do not include any path.

7 - Decrypt file (XOR with password)

This option prompts the user for a password (max 256 bytes long, may contain letters, digits, other characters) and then prompts the user for a filename and decrypts the content of the selected file using that password. The decryption method is very simple: just XOR the password with the file content byte after byte; the password being shorter than the file content, you must repeat the password as needed.

Example:

passwordpasswordpasswordpasswordpasswordpasswordpass

chiphertext is here ...

this is the file content that we had initially

Note1: the user must be prompted for the filename of the decrypted file as well, otherwise we would need to overwrite the initial file.

Note2: it may seem strange that we are using the same operation (XOR) both for encryption and for decryption, but this is how XOR (exclusive OR) works.

Note3: If no directory was selected an error message must be displayed. If the directory does not contain either of the files specified by the user, an error message must be displayed. The filenames do not include any path.

Testing:

1. You should use this file as the test file for Display, Encryption and Decryption.

2. For encryption, use the following password "Qwertyuiop[123$4$567]"

3. After encrypting this file with the above password, you obtain an encrypted file of the same length; after decrypting that file with the same password you should obtain an exact replica of this file, and this must be reflected in the Report document by appropriate screenshots showing the content of the files involved in these operations.

Deliverables:

1. Source code (zipped)

2. A Report showing the program performing each of the 7 actions correctly (use screenshots), plus screenshots showing the error reporting situations

Reference no: EM13971752

Questions Cloud

Calculate the amount of resources : (a) Calculate the firm operating cycle and cash conversion cycle. (b) Calculate the firm total resources invested in the firm CCC. [Hint: calculate the amount of resources invested in each asset/liability at any given point in time.]
How much must the firm remit each year : How much must the firm remit each year for 10 years if the funds earn 8 percent annually and there is $100 million outstanding?
Risk management and insurance class : You drink 5 beers to celebrate the end of your risk management and insurance class, then have an accident while driving home from the bar.
Assume that the initial cost is paid now and revenues : Assume that the initial cost is paid now and revenues are received at the end of each year. If the company requires an 11% return for such an investment, should it undertake the revision?
Write a java, c#,c/c++ program for file/directory processing : A Report showing the program performing each of the 7 actions correctly (use screenshots), plus screenshots showing the error reporting situations
Yield to maturity of dylon corp : Dylon Corp.'s bonds currently sell for $1,180 and have a par value of $1,000. They pay a $60 annual coupon and have a 15-year maturity, but they can be called in 5 years at $1,100. What is their yield to maturity (YTM)?
Critical analysis of the relevant literature : Assessment focuses on the scope of the project and the extent to which the methodical investigation of relevant and contemporary research material has been incorporated into its development.
Determine the amount of foreign tax credit eastwood : Determine the amount of foreign tax credit Eastwood will be allowed to take in determining its US tax liability in each of the three years.
Hedge of an anticipated purchase : On December 1, 2008, Jolly Rice Company enters into a 90-day forward contract with a rice speculator to purchase 500 tons of rice at $1,000 per ton.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  What is a plausible explanation of what may have happened

Prepare a short research paper of approximately 1300-1500 words, double-spaced, exclusive of cover, title page, and table of contents, endnotes and bibliography. Your paper must use APA formatting with the exception that tables and figures can be ins..

  Write a subroutine in marie assembly that multiplies two val

Write a subtoutine in MARIE assembly that multiplies two values where the arguments for this subroutine are two pointers (each pointer pointing to a value).

  Maintaining the integrity of the linked list

We do not have pointers to any other nodes (except by following links). Describe an O(1) algorithm that logically removes the value stored in such a node from the linked list, maintaining the integrity of the linked list. (Hint: Involve the next n..

  Display the total and average number of calories burned

Write a condition-controlled while loop that allows the user to enter the calories they burned. Stop looping when the user enters a negative number. Display the Total and Average number of calories burned.

  Write a visual logic program for an application

Write a visual logic program for an application that allows a user to enter the cost of home maintenance in each of the four seasons summer, fall, winter and spring and displays the total.

  The information security officer at a medium-sized company

The CIO asks you to explain why you believe it is important to secure the Windows and Unix/Linux servers from known shortcomings and vulnerabilities. Explain to your CIO what you can do to make sure the network infrastructure is more secure.

  Explain how to generate array of random numbers

For some general variables L and U, write a comment that explains how to generate a 1 x N array of random numbers whose values are between L and U.

  Java program that displays do java

Write a Java program that displays DO JAVA as following pattern: Hint: You may need to use the System.out.println() function. Use one vertical space between two letters in a word and two vertical spaces between two words (i.e., DO and JAVA).

  Discuss the constituent parts it/is professional ethics

Connect or relate the discussed constituent parts into an overall structure that may relate to an IT/IS code of conduct or ethics.

  How would you deallocate memory in a destructor

We can use the destructor to deallocate memory for an object. How would you deallocate memory in a destructor?

  Write a program that asks user to input grade of student

Write a program that asks the user to input the grade of the student. If the grade is equal or greater than 60, the program prints the word "pass", otherwise it prints the word "fail".

  The class is analysis and design of information systems

Guidelines: Grading will include content supported with examples, research and references with in-text citations, grammar and spelling. A minimum of 250 words is required.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd