SlideShare a Scribd company logo
1 of 2
Encryption Using File Streams
Part A
Complete the following questions:
Write C++ code to open a document with the name Hello.txt,
place the message “Hello, World!” in the document, and exit the
document. Re open the file you closed, and read the message
into a string variable. Exit out of the file.
When do you open the file as an ifstream, as an ofstream, or as
an fstream? Could you simply open all files as an fstream?
Why is the ifstream parameter of the read_data procedure in the
previous question a reference parameter and not a value
parameter?
What is the difference between a text file, and a binary file?
Part B
Random monoalphabet cipher.
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:
See exhibit A
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.
Submit a screenshot of the executed program and the code of
the program.
Encryption Using File StreamsPart AComplete the following questi.docx

More Related Content

Similar to Encryption Using File StreamsPart AComplete the following questi.docx

INSTRUCTIONS For this assignment you will be generating all code on y.pdf
 INSTRUCTIONS For this assignment you will be generating all code on y.pdf INSTRUCTIONS For this assignment you will be generating all code on y.pdf
INSTRUCTIONS For this assignment you will be generating all code on y.pdf
adayarboot
 
Data export in matlab alvian zainuddin
Data export in matlab alvian zainuddinData export in matlab alvian zainuddin
Data export in matlab alvian zainuddin
Alvianzainuddin
 

Similar to Encryption Using File StreamsPart AComplete the following questi.docx (20)

Satz1
Satz1Satz1
Satz1
 
Bt0067 c programming and data structures2
Bt0067 c programming and data structures2Bt0067 c programming and data structures2
Bt0067 c programming and data structures2
 
Lesson 03 python statement, indentation and comments
Lesson 03   python statement, indentation and commentsLesson 03   python statement, indentation and comments
Lesson 03 python statement, indentation and comments
 
Unit VI
Unit VI Unit VI
Unit VI
 
File handling3 (1).pdf uhgipughserigrfiogrehpiuhnfi;reuge
File handling3 (1).pdf uhgipughserigrfiogrehpiuhnfi;reugeFile handling3 (1).pdf uhgipughserigrfiogrehpiuhnfi;reuge
File handling3 (1).pdf uhgipughserigrfiogrehpiuhnfi;reuge
 
INSTRUCTIONS For this assignment you will be generating all code on y.pdf
 INSTRUCTIONS For this assignment you will be generating all code on y.pdf INSTRUCTIONS For this assignment you will be generating all code on y.pdf
INSTRUCTIONS For this assignment you will be generating all code on y.pdf
 
1
11
1
 
Clean Code Tutorial maXbox starter24
Clean Code Tutorial maXbox starter24Clean Code Tutorial maXbox starter24
Clean Code Tutorial maXbox starter24
 
Python file handlings
Python file handlingsPython file handlings
Python file handlings
 
Python programming msc(cs)
Python programming msc(cs)Python programming msc(cs)
Python programming msc(cs)
 
Python
PythonPython
Python
 
M02 un04 p03
M02 un04 p03M02 un04 p03
M02 un04 p03
 
7 Data File Handling
7 Data File Handling7 Data File Handling
7 Data File Handling
 
Bioinformatica 27-10-2011-p4-files
Bioinformatica 27-10-2011-p4-filesBioinformatica 27-10-2011-p4-files
Bioinformatica 27-10-2011-p4-files
 
Chapter10
Chapter10Chapter10
Chapter10
 
Data export in matlab alvian zainuddin
Data export in matlab alvian zainuddinData export in matlab alvian zainuddin
Data export in matlab alvian zainuddin
 
Perly Parallel Processing of Fixed Width Data Records
Perly Parallel Processing of Fixed Width Data RecordsPerly Parallel Processing of Fixed Width Data Records
Perly Parallel Processing of Fixed Width Data Records
 
1. introduction to computer
1. introduction to computer1. introduction to computer
1. introduction to computer
 
Python Tutorial
Python TutorialPython Tutorial
Python Tutorial
 
Python tutorial
Python tutorialPython tutorial
Python tutorial
 

More from elishaoatway

PROBLEM IDENTIFICATION AND RECOMMENDATIONS FOR SFK ORGANIZATION .docx
PROBLEM IDENTIFICATION AND RECOMMENDATIONS FOR SFK ORGANIZATION .docxPROBLEM IDENTIFICATION AND RECOMMENDATIONS FOR SFK ORGANIZATION .docx
PROBLEM IDENTIFICATION AND RECOMMENDATIONS FOR SFK ORGANIZATION .docx
elishaoatway
 
Problem Set #2 SCOR470 Fall 2015 Topics Soil water pote.docx
Problem Set #2 SCOR470 Fall 2015 Topics Soil water pote.docxProblem Set #2 SCOR470 Fall 2015 Topics Soil water pote.docx
Problem Set #2 SCOR470 Fall 2015 Topics Soil water pote.docx
elishaoatway
 
Problem descriptionThe Jim Thornton Coffee House chain is .docx
Problem descriptionThe Jim Thornton Coffee House chain is .docxProblem descriptionThe Jim Thornton Coffee House chain is .docx
Problem descriptionThe Jim Thornton Coffee House chain is .docx
elishaoatway
 
Problem 5The probability distributions for inter-arrival a.docx
Problem 5The probability distributions for inter-arrival a.docxProblem 5The probability distributions for inter-arrival a.docx
Problem 5The probability distributions for inter-arrival a.docx
elishaoatway
 
Problem 4-6 Calculating Internal Growth [LO3]The most recent fin.docx
Problem 4-6 Calculating Internal Growth [LO3]The most recent fin.docxProblem 4-6 Calculating Internal Growth [LO3]The most recent fin.docx
Problem 4-6 Calculating Internal Growth [LO3]The most recent fin.docx
elishaoatway
 
PROBLEM 8-18a. Fill in the worksheet with the appropriate value.docx
PROBLEM 8-18a. Fill in the worksheet with the appropriate value.docxPROBLEM 8-18a. Fill in the worksheet with the appropriate value.docx
PROBLEM 8-18a. Fill in the worksheet with the appropriate value.docx
elishaoatway
 
PROBLEM 5-5BPrepare a correct detailed multiple-step income st.docx
PROBLEM 5-5BPrepare a correct detailed multiple-step income st.docxPROBLEM 5-5BPrepare a correct detailed multiple-step income st.docx
PROBLEM 5-5BPrepare a correct detailed multiple-step income st.docx
elishaoatway
 
Problem BackgroundYour project consists of six activities show.docx
Problem BackgroundYour project consists of six activities show.docxProblem BackgroundYour project consists of six activities show.docx
Problem BackgroundYour project consists of six activities show.docx
elishaoatway
 
Problem 8-2B(a) Journalize the transactions, including explanati.docx
Problem 8-2B(a) Journalize the transactions, including explanati.docxProblem 8-2B(a) Journalize the transactions, including explanati.docx
Problem 8-2B(a) Journalize the transactions, including explanati.docx
elishaoatway
 
Problem B Regulatory Compliance 1 No.docx
Problem B Regulatory Compliance     1  No.docxProblem B Regulatory Compliance     1  No.docx
Problem B Regulatory Compliance 1 No.docx
elishaoatway
 
PROBLEM 3-22EventProduct CostsPeriod Costsa.b..docx
PROBLEM 3-22EventProduct CostsPeriod Costsa.b..docxPROBLEM 3-22EventProduct CostsPeriod Costsa.b..docx
PROBLEM 3-22EventProduct CostsPeriod Costsa.b..docx
elishaoatway
 
Problem 3 15 pointsThe following items were taken from the po.docx
Problem 3 15 pointsThe following items were taken from the po.docxProblem 3 15 pointsThe following items were taken from the po.docx
Problem 3 15 pointsThe following items were taken from the po.docx
elishaoatway
 
Problem 3-1A Identifying adjusting entries with explanations LO C3.docx
Problem 3-1A Identifying adjusting entries with explanations LO C3.docxProblem 3-1A Identifying adjusting entries with explanations LO C3.docx
Problem 3-1A Identifying adjusting entries with explanations LO C3.docx
elishaoatway
 
Essay #2 addresses some topic in the broad scope of Transcendentalis.docx
Essay #2 addresses some topic in the broad scope of Transcendentalis.docxEssay #2 addresses some topic in the broad scope of Transcendentalis.docx
Essay #2 addresses some topic in the broad scope of Transcendentalis.docx
elishaoatway
 

More from elishaoatway (20)

PROBLEM IDENTIFICATION AND RECOMMENDATIONS FOR SFK ORGANIZATION .docx
PROBLEM IDENTIFICATION AND RECOMMENDATIONS FOR SFK ORGANIZATION .docxPROBLEM IDENTIFICATION AND RECOMMENDATIONS FOR SFK ORGANIZATION .docx
PROBLEM IDENTIFICATION AND RECOMMENDATIONS FOR SFK ORGANIZATION .docx
 
Problem Set #2 SCOR470 Fall 2015 Topics Soil water pote.docx
Problem Set #2 SCOR470 Fall 2015 Topics Soil water pote.docxProblem Set #2 SCOR470 Fall 2015 Topics Soil water pote.docx
Problem Set #2 SCOR470 Fall 2015 Topics Soil water pote.docx
 
Problem descriptionThe Jim Thornton Coffee House chain is .docx
Problem descriptionThe Jim Thornton Coffee House chain is .docxProblem descriptionThe Jim Thornton Coffee House chain is .docx
Problem descriptionThe Jim Thornton Coffee House chain is .docx
 
Problem 5The probability distributions for inter-arrival a.docx
Problem 5The probability distributions for inter-arrival a.docxProblem 5The probability distributions for inter-arrival a.docx
Problem 5The probability distributions for inter-arrival a.docx
 
Problem 4-6 Calculating Internal Growth [LO3]The most recent fin.docx
Problem 4-6 Calculating Internal Growth [LO3]The most recent fin.docxProblem 4-6 Calculating Internal Growth [LO3]The most recent fin.docx
Problem 4-6 Calculating Internal Growth [LO3]The most recent fin.docx
 
PROBLEM 8-18a. Fill in the worksheet with the appropriate value.docx
PROBLEM 8-18a. Fill in the worksheet with the appropriate value.docxPROBLEM 8-18a. Fill in the worksheet with the appropriate value.docx
PROBLEM 8-18a. Fill in the worksheet with the appropriate value.docx
 
PROBLEM 5-5BPrepare a correct detailed multiple-step income st.docx
PROBLEM 5-5BPrepare a correct detailed multiple-step income st.docxPROBLEM 5-5BPrepare a correct detailed multiple-step income st.docx
PROBLEM 5-5BPrepare a correct detailed multiple-step income st.docx
 
Problem BackgroundYour project consists of six activities show.docx
Problem BackgroundYour project consists of six activities show.docxProblem BackgroundYour project consists of six activities show.docx
Problem BackgroundYour project consists of six activities show.docx
 
Problem 8-2B(a) Journalize the transactions, including explanati.docx
Problem 8-2B(a) Journalize the transactions, including explanati.docxProblem 8-2B(a) Journalize the transactions, including explanati.docx
Problem 8-2B(a) Journalize the transactions, including explanati.docx
 
Problem B Regulatory Compliance 1 No.docx
Problem B Regulatory Compliance     1  No.docxProblem B Regulatory Compliance     1  No.docx
Problem B Regulatory Compliance 1 No.docx
 
PROBLEM 3-22EventProduct CostsPeriod Costsa.b..docx
PROBLEM 3-22EventProduct CostsPeriod Costsa.b..docxPROBLEM 3-22EventProduct CostsPeriod Costsa.b..docx
PROBLEM 3-22EventProduct CostsPeriod Costsa.b..docx
 
Problem 3 15 pointsThe following items were taken from the po.docx
Problem 3 15 pointsThe following items were taken from the po.docxProblem 3 15 pointsThe following items were taken from the po.docx
Problem 3 15 pointsThe following items were taken from the po.docx
 
Problem 3-1A Identifying adjusting entries with explanations LO C3.docx
Problem 3-1A Identifying adjusting entries with explanations LO C3.docxProblem 3-1A Identifying adjusting entries with explanations LO C3.docx
Problem 3-1A Identifying adjusting entries with explanations LO C3.docx
 
Essay 21) Describe the opportunities and challenges posed by the d.docx
Essay 21) Describe the opportunities and challenges posed by the d.docxEssay 21) Describe the opportunities and challenges posed by the d.docx
Essay 21) Describe the opportunities and challenges posed by the d.docx
 
Essay 11) Evaluate the Articles of Confederation as a guide for su.docx
Essay 11) Evaluate the Articles of Confederation as a guide for su.docxEssay 11) Evaluate the Articles of Confederation as a guide for su.docx
Essay 11) Evaluate the Articles of Confederation as a guide for su.docx
 
Essay (1) QuestionWhat is the so-called Machine Age How was it .docx
Essay (1) QuestionWhat is the so-called Machine Age How was it .docxEssay (1) QuestionWhat is the so-called Machine Age How was it .docx
Essay (1) QuestionWhat is the so-called Machine Age How was it .docx
 
Essay #2 addresses some topic in the broad scope of Transcendentalis.docx
Essay #2 addresses some topic in the broad scope of Transcendentalis.docxEssay #2 addresses some topic in the broad scope of Transcendentalis.docx
Essay #2 addresses some topic in the broad scope of Transcendentalis.docx
 
Essay # 2 The Tempest Prompt4-5 pages (MLA format)Char.docx
Essay # 2 The Tempest Prompt4-5 pages (MLA format)Char.docxEssay # 2 The Tempest Prompt4-5 pages (MLA format)Char.docx
Essay # 2 The Tempest Prompt4-5 pages (MLA format)Char.docx
 
Es la actividad que hacemos con pecesEs un animal blanco y negro q.docx
Es la actividad que hacemos con pecesEs un animal blanco y negro q.docxEs la actividad que hacemos con pecesEs un animal blanco y negro q.docx
Es la actividad que hacemos con pecesEs un animal blanco y negro q.docx
 
Erving Goffman is one of the most important sociological thinkers in.docx
Erving Goffman is one of the most important sociological thinkers in.docxErving Goffman is one of the most important sociological thinkers in.docx
Erving Goffman is one of the most important sociological thinkers in.docx
 

Recently uploaded

Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
EADTU
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
CaitlinCummins3
 

Recently uploaded (20)

Major project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesMajor project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategies
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management
 
demyelinated disorder: multiple sclerosis.pptx
demyelinated disorder: multiple sclerosis.pptxdemyelinated disorder: multiple sclerosis.pptx
demyelinated disorder: multiple sclerosis.pptx
 
ANTI PARKISON DRUGS.pptx
ANTI         PARKISON          DRUGS.pptxANTI         PARKISON          DRUGS.pptx
ANTI PARKISON DRUGS.pptx
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
male presentation...pdf.................
male presentation...pdf.................male presentation...pdf.................
male presentation...pdf.................
 
Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...
 
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUMDEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
 
An Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppAn Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge App
 
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
 
Climbers and Creepers used in landscaping
Climbers and Creepers used in landscapingClimbers and Creepers used in landscaping
Climbers and Creepers used in landscaping
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in Hinduism
 
The Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFThe Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDF
 
How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17
 
diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....
 
Graduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxGraduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptx
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
 

Encryption Using File StreamsPart AComplete the following questi.docx

  • 1. Encryption Using File Streams Part A Complete the following questions: Write C++ code to open a document with the name Hello.txt, place the message “Hello, World!” in the document, and exit the document. Re open the file you closed, and read the message into a string variable. Exit out of the file. When do you open the file as an ifstream, as an ofstream, or as an fstream? Could you simply open all files as an fstream? Why is the ifstream parameter of the read_data procedure in the previous question a reference parameter and not a value parameter? What is the difference between a text file, and a binary file? Part B Random monoalphabet cipher. 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: See exhibit A 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. Submit a screenshot of the executed program and the code of the program.