C# program to encrypt the letters

Assignment Help Programming Languages
Reference no: EM13936326

The caeser cipher, which shifts all letters by a certain amount, is easy to decipher. Try this, instead of numbers use letters. Consider this, the word is FEATHER. Remove duplicate letters, making FEATHR, and append the rest of the letters of the alphabet in reverse order.

Now encrypt the letters as follows:

Now, write a program that encrypts or decrypts a file using this cipher.

For example,

crypt -d -kFEATHER encrypt.txt output.txt
decrypts a file using the keyword FEATHER. You must always supply a keyword.

This is what I have so far:

#include <iostream>
#include <fstream>
#include <string>

using namespace std;
string rem_Duplicate(string str1)
{
string str2;
int pos;
for (int i = 0; i < str1.length(); i++)
{
if ((pos = str2.find(str1[i])) < 0)
str2 += str1[i];
}
cout << str2 << endl;
return str2;
}

int main()
{
ofstream output_file;
ifstream input_file("output.txt");
output_file.open("input.txt");
string FEATHER;
string key = FEATHER;
cout << "Enter the Key: ";
cin >> key;
key = rem_Duplicate(key);

input_file.close();
output_file.close();

cin.clear();
cin.ignore();
cin.get();

return 0;

Reference no: EM13936326

Questions Cloud

Discuss the media release and newspaper article : Discuss the Media Release and newspaper article in the context of the statement "regulation is the output of a political process". Do you agree or disagree?
C++ program to design a class : The class should have a constructor that accepts a nonnegative integer and uses it to initialize the Numbers object. It should have a member function print() that prints the English description of the Numbers object. Demonstrate the class by writi..
Preparing and analyzing financial statements : As the CFO of your corporation, you are in charge of preparing and analyzing financial statements that will be presented to potential investors and creditors
What is expected relation between relative interest rates : Effects of real interest rates. What is the expected relationship between the relative real interest rates of two countries and the exchange rate of their currencies?
C# program to encrypt the letters : Consider this, the word is FEATHER. Remove duplicate letters, making FEATHR, and append the rest of the letters of the alphabet in reverse order.
Ensure data stored on file servers : Implement and install a website for a hospital. Needs to write an article that shows the WEBSITE DEVELOPMENT. Check and maintain the software which is installed in the network devices.
What are the basic rights of landlords and tenants : What are the requirements and general conditions of a valid lease? What are the basic rights of landlords and tenants? What are their rights in situations such as evictions
What are opportunity costs of starting your own franchise : What firm did you pick? Why is it interesting to you? What are some opportunity costs of starting your own franchise?
Copyright and other privacy policies along with navigations : Create a simple static website. Your website should have the following requirements Requirements: Create a master page Your website should have minimum of 5 different pages Your website should include a form that will register the users.

Reviews

Write a Review

Programming Languages Questions & Answers

  Occurrence of the longest substring of capital

Input a string. Output the starting position and length of the first occurrence of the longest substring of capital Xs in that string. The first letter is in position 1.

  Write pseudocode to accept candy name

Write a pseudocode for the following: A programm to accept a candy name (for exmple, "chocolate-covered blueberries'), price per pound, and number of pounds sold.

  Explain how perl deallocates dynamic memory

It's one thing to TALK about how Perl manages dynamic memory. it is another thing completely to SEE how Perl manages dynamic memory.

  Application should calculate and display the order amounts

Make sure the number of units for each package is numeric, and is not negative.

  The ideal hpc programming language

Read the article titled, "The Ideal HPC Programming Language" dated 2010. Describe one (1) way in which arrays are used in high-performance computing

  Implement a tic tac toe game in any programming language

You have to do this assignment to make a game in computer programming language tic tac the boxes of the game should be interactive and in red and green color

  Program that prompts the user to enter the mass of a person

Write a program that prompts the user to enter the mass of a person in kilograms and outputs the equivalent weight in pounds.

  Write program to show percentage of calories come from fat

Write a program which asks user to enter number of calories and fat grams in a food item. The program must display percentage of the calories that come from fat.

  Write program to calculate tips for services rendered

Write program to calculate tips for services rendered. The program must request person's occupation, amount of the bill and the percentage tip as input

  Create a three-page website that displays text and links

Create a three-page website that displays text and links, demonstrating effective use of the basic code from chapter 2. You will build three (3) new HTML documents, and must use http://www.lipsum.com to generate placeholder text for the written co..

  Prevent stack smashing within an executable program

What is pseudocode, and how does it assist in code translation? What are two methods that can be employed to prevent stack smashing within an executable program?

  Store a list of items on a grocery list

write a program that uses a string array to store a list of items on a grocery list. The program should allow the user (via a menu) to add an item to the list, clear the list, and display the list.

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