Write a program to read a file and encode

Assignment Help JAVA Programming
Reference no: EM13164624

Problem Description:

Suppose an encrypted file was created using the encoding/decoding scheme . Each letter is substituted by some other letter according to a given mapping as shown below.

String letters = "abcdefghijklmnopqrstuvwxyz";

String enc = "kngcadsxbvfhjtiumylzqropwe";

For example, every 'a' becomes a 'k' when encoding a text, and every 'k' becomes an 'a' when decoding. You will write a program, encode or decode a File, and then encodes or decodes the File using the mapping above. Capital letters are mapped the same way as the lower case letters above, but remain capitalized. For example, every 'A' becomes 'K' when encoding a file, and every 'K' becomes an 'A' when decoding. Numbers and other characters are not encoded and remain the same.

Write a program to read a file and encode the file to an encrypted file. And write a program to get an encrypted file and decode to original file. Your program should prompt the user to enter an input file name and an output file name

What should you do?

  1. Ask for input file name/ output file name (encrypted file). The encrypt using above encode/decode.
  2. Ask for encrypted file and decoded to original input file.

Reference no: EM13164624

Questions Cloud

A robot can take steps of 1 meter : A robot can take steps of 1 meter, 2 meters, or 3 meters. Write a recursive function to calculate the number of ways the robot can walk n meters. (n is an integer obtained from user.) As example:
Code works and does what it is suppose to do : Please make sure the code works and does what it is suppose to do. I keep getting answers on my other assignments that were copy and pasted from god knows where and had nothing to do with the assignment instructions.
If there are 4 command line arguments : If there are 4 command line arguments (a b c filename.dat) then the engine should take a,b,c and store the resulting x1 and x2 in filename.dat working in silent mode (no use of screen)
The factorial of a positive integer n, denoted by n! : Write a program that computes the sequence of factorial values: 1! = 1, 2! = 2, 3! = 6, 4! = 24, 5! = 120, 6! = 720, ....
Write a program to read a file and encode : Write a program to read a file and encode the file to an encrypted file. And write a program to get an encrypted file and decode to original file. Your program should prompt the user to enter an input file name and an output file name
Class polygon which draws a hexagon for a set of numbers : Write a class Polygon which draws a hexagon for a set of numbers given by the user. You must only use method drawLine of class Graphics (other fill or draw methods won't be accepted).
Using wireshark note the ip address and tcp port number : Using wireshark note the IP address and TCP port number used by your client computer (source) to transfer the file to any FTP server?
Ask the user to enter a positive non-zero integer value. : Write a program which aske the user to Enter a positve non-zero integer value. if the value enterd zero or negative print as error message and end the program; otherwise, use the integer to call a method displayPattern(n) which must display the follo..
Class named person with fields for holding a person''s name : Design a class named Person with fields for holding a person's name, address, and telephone number. Write one or more constructors and the appropriate mutator and accessor methods for the class's fields.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Implement a shopping cart class with user interface

project will be to implement a shopping cart class with user interface (UI) that contains main() in Net Beans. The UI class will be used to perform user input/output and to invoke the appropriate methods of shopping cart class. When your program star..

  Compute the average grades

Write a program that allows a teacher to compute the average grades for EACH student in his or her class (NOT a single average for the entire class)

  Determine the type of moped

Write a driver class called MopedRental. This class should perform the following: asks the user to enter the size of the moped, the day of the week and the number of hours rented, creates the Moped object, based on the size, and displays the input..

  Design and implement a small and simple email server

Design and implement a small and simple email server

  Implement a shopping cart class with user interface

project will be to implement a shopping cart class with user interface (UI) that contains main() in Net Beans. The UI class will be used to perform user input/output and to invoke the appropriate methods of shopping cart class. When your program star..

  Write a method in java that uses a switch statement

Write a method in JAVA that uses a switch statement and takes a person's age using an integer parameter , then checks if the age is valid (0-110), and then RETURNS a string based on the age

  Develop java code to compute monthly rent for housing units

Develop a java code that computes monthly rent for 3 housing units namely Bungalows,Apartments and hostels. All housing units have got size,color and monthly rental rate.

  Reads in up to 1000 non-negative integers

Write a program that reads in up to 1000 non-negative integers and displays distinct numbers (i.e., if a number appears multiple times, it is displayed only once). (Hint: Read each number and store it in an array if it is new. If the number is alread..

  Regular expression that selects lines

Write a regular expression that selects lines containing the html BR tag. The rules for this tag are that, like all html tags, it starts with . In between are the letters b and r in that order

  Difference between the two following statements

What exactly is the difference between the two following statements and which is preferred, please provide details: 1) frame.setSize(400, 300); // Set JFrame Size

  Write down the java code for the bank

Write down the java code for the bank of Fraud. User is presented with menu which looks something like this: 1. Deposit 2. Withdrawal 3. Check Balance 4. Exit.

  Object-oriented gui drawing editor

A simple object-oriented GUI drawing editor that allows a user to create, move and erase rectangles, squares, circles and lines in an interactive graphics. How can I draw move erase rectangles, squares, circles and lines in GUI/java.

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