Computer Science > LECTURE SLIDES/NOTES > University of Michigan - EECS 183ciphers (All)

University of Michigan - EECS 183ciphers

Document Content and Description Below

/** * ciphers.cpp * * Hadianto Leonard & Tian You Guo * leonhadi & kevinguo * * EECS 183: Project 3 * * <#description#> */ #include "caesar.h" #include "vigenere.h" #include "polybius.h" ... #include <iostream> #include <string> using namespace std; int main() { string cipherInput; string encrypt; string message; string key; int keynum; bool flag; char grid [SIZE][SIZE]; //ask user to choose between Caesar,Vigenere, or Polybius) cout << "Choose a cipher (Caesar, Vigenere, or Polybius): "; // used getline to get the entire line, and make it uppercase getline(cin, cipherInput); cipherInput = toUpperCase(cipherInput); if (cipherInput == "CAESAR" || cipherInput == "C") { // ask if user want to encrypt or decrypt, getline to avoid conflict and make it uppercase cout << "Encrypt or decrypt: "; getline(cin,encrypt); encrypt = toUpperCase(encrypt); // set flag to true if user want to encrypt and flag to false if user want to decrypt if(encrypt == "ENCRYPT" || encrypt == "E") { flag = true; } else if (encrypt == "DECRYPT" || encrypt == "D") { flag = false; } // if it's not either print invalid mode and exit program else { cout << "Invalid mode!"; return 0; } // get message from user cout << "Enter a message: "; getline(cin,message); // get the key cout << "What is your key: "; cin >> keynum; [Show More]

Last updated: 2 years ago

Preview 1 out of 4 pages

Buy Now

Instant download

We Accept:

We Accept
document-preview

Buy this document to get the full access instantly

Instant Download Access after purchase

Buy Now

Instant download

We Accept:

We Accept

Reviews( 0 )

$7.00

Buy Now

We Accept:

We Accept

Instant download

Can't find what you want? Try our AI powered Search

330
2

Document information


Connected school, study & course


About the document


Uploaded On

Mar 23, 2021

Number of pages

4

Written in

Seller


seller-icon
Muchiri

Member since 4 years

209 Documents Sold

Reviews Received
19
5
1
1
6
Additional information

This document has been written for:

Uploaded

Mar 23, 2021

Downloads

 2

Views

 330

Document Keyword Tags


$7.00
What is Scholarfriends

In Scholarfriends, a student can earn by offering help to other student. Students can help other students with materials by upploading their notes and earn money.

We are here to help

We're available through e-mail, Twitter, Facebook, and live chat.
 FAQ
 Questions? Leave a message!

Follow us on
 Twitter

Copyright © Scholarfriends · High quality services·