Question: Please create a c++ coding program that will follow the question below. Please use basic looping skills and coding skills that beginner coding student would

Please create a c++ coding program that will follow the question below. Please use basic looping skills and coding skills that beginner coding student would use.

Program 9 "Caeser Cipher"

Introduction

Hiding the meaning of messages by putting them in some kind of code is something we have all done, from the coding rings and secret symbols of childhood to the top secrecy of military and commercial establishments secret data. In fact, some of the earliest uses of computers were for coding messages and for breaking the enemys coded messages. Newer coding methods are among the most interesting research areas in computer science today.

The Caesar Cipher

One of the simplest examples of a substitution cipher is the Caesar Cipher, which is said to have been used by Julius Caesar to communicate with his army. Caesar is considered to be one of the first persons to have ever employed encryption for the sake of securing messages. Caesar decided that shifting each letter in the message would be his standard algorithm, and so he informed all of his generals of his decision, and was then able to send them secured messages. Using the Caesar Shift (3 to the right), the message,

RETURNTOROME Please create a c++ coding program that will would be encrypted as Please create a c++ coding program that willUHWXUQWRURPH

In this example, 'R' Please create a c++ coding program that will 'U', 'E' Please create a c++ coding program that will 'H', and so on. Now, even if the enemy did intercept the message, it would be useless, since only Caesars generals could read it.

The Assignment

Write a program to implement the Caesar Cipher

Problem

Write a program that will ask the user to enter the name of a file. Your program should then ask the user to enter 'encrypt' or 'decrypt'.

If the user enters anything else your program should print an error message and exit.

If they entered 'encrypt' your program should open the file and encrypt it by shifting each character (including white space) 3 values to the right.

If they entered 'decrypt' your program should open the file and decrypt it by shifting each character (including white space) 3 values to the left.

If the file fails to open your program should print an error message and exit.

The decrypted or encrypted message should be displayed on the screen and also written to an output file named message.

[edit]Sample Solution Output

Enter File Name: This_is_a_bad_file_name Enter encrypt or decrypt: decrypt Error: File did NOT open. ____________________________________________________________________________________________________________ Enter File Name: plainText.txt Enter encrypt or decrypt: openFile Error: Bad Command. ____________________________________________________________________________________________________________ Enter File Name: plainText.txt Enter encrypt or decrypt: encrypt Vhg#xw#shuvslfldwlv#xqgh#rpqlv#lvwh#qdwxv#huuru#vlw#yroxswdwhp#dffxvdqwlxp#groruhptxh#odxgdqwlxp/# wrwdp#uhp#dshuldp/#hdtxh#lsvd#txdh#de#loor#lqyhqwruh#yhulwdwlv#hw#txdvl#dufklwhfwr#ehdwdh#ylwdh# glfwd#vxqw#h{solfder1#Qhpr#hqlp#lsvdp#yroxswdwhp#txld#yroxswdv#vlw#dvshuqdwxu#dxw#rglw#dxw#ixjlw/# vhg#txld#frqvhtxxqwxu#pdjql#groruhv#hrv#txl#udwlrqh#yroxswdwhp#vhtxl#qhvflxqw1#Qhtxh#sruur#txlvtxdp# hvw/#txl#groruhp#lsvxp#txld#groru#vlw#dphw/#frqvhfwhwxu/#dglslvfl#yholw/#vhg#txld#qrq#qxptxdp#hlxv# prgl#whpsrud#lqflgxqw#xw#oderuh#hw#groruh#pdjqdp#doltxdp#txdhudw#yroxswdwhp1#Xw#hqlp#dg#plqlpd# yhqldp/#txlv#qrvwuxp#h{huflwdwlrqhp#xoodp#frusrulv#vxvflslw#oderulrvdp/#qlvl#xw#doltxlg#h{#hd# frpprgl#frqvhtxdwxuB# Txlv#dxwhp#yho#hxp#lxuh#uhsuhkhqghulw#txl#lq#hd#yroxswdwh#yholw#hvvh#txdp#qlklo#prohvwldh#frqvhtxdwxu/# yho#looxp#txl#groruhp#hxp#ixjldw#txr#yroxswdv#qxood#sduldwxuB ____________________________________________________________________________________________________________ OUTPUT FILE: message Vhg#xw#shuvslfldwlv#xqgh#rpqlv#lvwh#qdwxv#huuru#vlw#yroxswdwhp#dffxvdqwlxp#groruhptxh#odxgdqwlxp/# wrwdp#uhp#dshuldp/#hdtxh#lsvd#txdh#de#loor#lqyhqwruh#yhulwdwlv#hw#txdvl#dufklwhfwr#ehdwdh#ylwdh# glfwd#vxqw#h{solfder1#Qhpr#hqlp#lsvdp#yroxswdwhp#txld#yroxswdv#vlw#dvshuqdwxu#dxw#rglw#dxw#ixjlw/# vhg#txld#frqvhtxxqwxu#pdjql#groruhv#hrv#txl#udwlrqh#yroxswdwhp#vhtxl#qhvflxqw1#Qhtxh#sruur#txlvtxdp# hvw/#txl#groruhp#lsvxp#txld#groru#vlw#dphw/#frqvhfwhwxu/#dglslvfl#yholw/#vhg#txld#qrq#qxptxdp#hlxv# prgl#whpsrud#lqflgxqw#xw#oderuh#hw#groruh#pdjqdp#doltxdp#txdhudw#yroxswdwhp1#Xw#hqlp#dg#plqlpd# yhqldp/#txlv#qrvwuxp#h{huflwdwlrqhp#xoodp#frusrulv#vxvflslw#oderulrvdp/#qlvl#xw#doltxlg#h{#hd# frpprgl#frqvhtxdwxuB# Txlv#dxwhp#yho#hxp#lxuh#uhsuhkhqghulw#txl#lq#hd#yroxswdwh#yholw#hvvh#txdp#qlklo#prohvwldh#frqvhtxdwxu/# yho#looxp#txl#groruhp#hxp#ixjldw#txr#yroxswdv#qxood#sduldwxuB ____________________________________________________________________________________________________________ Enter File Name: encrypted.txt Enter encrypt or decrypt: decrypt Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur? ____________________________________________________________________________________________________________ OUTPUT FILE: message Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur? 

[edit]Extra Credit

Also report the frequency of the vowels (A ,E ,I , O, U, Y) in input message.

Note: You must clearly label the extra credit output with the following makers.

*** Start Extra Credit ***  *** End Extra Credit *** 

Transcribed image text

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!