|
|
|
ya so what wrote for the goUserEdit function worker great, how do we get gid rid of all the other cin?
|
|
|
There are only 4 more cin's. I have already explained how to handle all of the cases. By now you should know how to do this. If not, please re-read my previous comments and try to understand better, then experiment.
<Added>
http://msdn2.microsoft.com/en-gb/library/89e4h321.aspx
|
|
|
ya i understand. i am attempting to study encryption and decryption, please help me with these guidlines.
Implement the class Crypto
Implement TOTAL of five (5) different encryption/decryption functions
Allow the user to save the cipher text to a file.
Implement a program that lets a user encrypt/decrypt text using your Crypto class functions
Your program must allow the user to continue encrypting/decrypting text until he/she chooses to quit
Your program must allow the user to choose any of the encryption functions you implemented in the class Crypto.
Allow the user to enter a line of plain text, and encrypt it--show the user the encrypted text AND the original clear text
Allow the user to enter a line of encrypted text, and decrypt it-- show the user the clear text that results from decryption AND the original encrypted text
Display must be well formatted
Keep the user interface as clean, logical, and simple as possible
here is all that i have in this, the needs to be done with that CinReader thing.
|
|
|
here is the .cpp file
#include "crypto.h"
Crypto::Crypto ()
{
cout << "building a Crypto instance\n\n";
}
Crypto::~Crypto ()
{
cout << "destroying a Crypto instance\n\n";
}
string Crypto::eCaesar (string text)
{
int asciiValue = 0;
for (int i=0; i<text.length(); i++)
{
if (isalpha(text))
{
asciiValue = static_cast<int>(toupper(text));
asciiValue += 3;
if (asciiValue > 90)
asciiValue -= 26;
text = static_cast<char>(asciiValue);
}
}
cipherText = text;
return cipherText;
}
string Crypto::dCaesar (string text)
{
int asciiValue = 0;
for (int i=0; i<text.length(); i++)
{
if (isalpha(text))
{
asciiValue = static_cast<int>(toupper(text));
asciiValue -= 3;
if (asciiValue < 65)
asciiValue += 26;
text = static_cast<char>(asciiValue);
}
}
clearText = text;
return clearText;
}
|
|
|
here is the header file
#include "crypto.h"
Crypto::Crypto ()
{
cout << "building a Crypto instance\n\n";
}
Crypto::~Crypto ()
{
cout << "destroying a Crypto instance\n\n";
}
string Crypto::eCaesar (string text)
{
int asciiValue = 0;
for (int i=0; i<text.length(); i++)
{
if (isalpha(text))
{
asciiValue = static_cast<int>(toupper(text));
asciiValue += 3;
if (asciiValue > 90)
asciiValue -= 26;
text = static_cast<char>(asciiValue);
}
}
cipherText = text;
return cipherText;
}
string Crypto::dCaesar (string text)
{
int asciiValue = 0;
for (int i=0; i<text.length(); i++)
{
if (isalpha(text))
{
asciiValue = static_cast<int>(toupper(text));
asciiValue -= 3;
if (asciiValue < 65)
asciiValue += 26;
text = static_cast<char>(asciiValue);
}
}
clearText = text;
return clearText;
}
<Added>
oops here is the header file....
#pragma once
#include <iostream>
#include <string>
using namespace std;
class Crypto
{
public:
Crypto (); // constructor
~Crypto (); // destructor
string eCaesar (string text);
string dCaesar (string text);
private:
string clearText;
string cipherText;
};
|
|
|
please help asap, it is urgent!!!
|
|
|
oh gosh please please help...
|
|
This 23 message thread spans 2 pages: < < 1 [2] > > |