Advertisement
Guest User

Untitled

a guest
Mar 29th, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. #include <fstream>
  2. #include <iostream>
  3. #include <string>
  4. #include <iomanip>
  5. #include <stdio.h>
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10.  
  11. char option, m, c;
  12. int amount, n, k;
  13. string fname, dname, ename;
  14.  
  15. ofstream nstream;
  16. ifstream istream;
  17.  
  18.  
  19. cout << "Do you want to encrypt of decrypt? Enter D or E.";
  20. cin >> option;
  21. cout << endl;
  22.  
  23. while (option != 'D' && option != 'E')
  24. {
  25. cout << "That is not acceptable" << endl;
  26. cout << "Do you want to encrypt of decrypt? Enter D or E.";
  27. cin >> option;
  28. cout << endl;
  29. }
  30.  
  31.  
  32. if (option == 'E')
  33. {
  34. cout << "Enter the name of the file that you want to encrypt: ";
  35. cin >> fname;
  36. istream.open(“fname”);
  37. cout<<endl;
  38. cout << "Enter the name of the file that you want to output: ";
  39. cin >> ename;
  40. nstream.open(“ename”);
  41. cout<<endl;
  42. }
  43.  
  44. if (option == 'D')
  45. {
  46. cout << "Enter the name of the file that you want to decrypt: ";
  47. cin >> dname;
  48. istream.open(“dname”);
  49. cout<<endl;
  50. cout << "Enter the name of the file that you want to output: ";
  51. cin >> ename;
  52. nstream.open(“ename”);
  53. cout<<endl;
  54.  
  55. }
  56. cout << "Enter the number of digits that you want to de/encrypt(integers): ";
  57. cin >> k;
  58.  
  59. istream >> m;
  60. while (m >= 0);
  61. {
  62. if (m > 65 && m < 90);
  63. {
  64. c = m + k;
  65. while (c > 90)
  66. {
  67. c = c - 26;
  68. }
  69.  
  70. }
  71. if (m > 97 && m < 122);
  72. {(c = m + k);
  73. while (c > 122)
  74. {
  75. c = c - 26;
  76. }
  77. }
  78.  
  79. if(m >= 0)
  80. {
  81. c = m + k;
  82. }
  83.  
  84. }
  85.  
  86. nstream << c;
  87. cout<<"booty";
  88. return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement