Write cpp code to open a document with the name hello-txt

Assignment Help C/C++ Programming
Reference no: EM131322127

Assignment

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.

/* 1. 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:

Now, write a program that encrypts or decrypts a file using this cipher.

Include the .cpp file in addition to the responses above.

For example,

crypt -d -kFEATHER encrypt.txt output.txt

decrypts a file using the keyword FEATHER. You must always supply a keyword.

Reference no: EM131322127

Questions Cloud

What fraction of cycles are we stalling due to data hazards : If we use no forwarding, what fraction of cycles are we stalling due to data hazards?
How much of the total variability in a particular phenomenon : Reactions to Mischel's observation were of two varieties.- How much of the total variability in a particular phenomenon should we expect to explain with some other variable?
Determining the sociological object : According to the argument laid out in the lecture, in what sense can sociological theory be an object for sociology, as any other sociological object? Explain and illustrate
Write a comparative essay : HUM 111 :This is a comparative essay. Comparison approached properly will require some critical thinking on your part. Use a point-by-point approach for the essay. That means, if comparing subject A with subject B, don't do the first half of the e..
Write cpp code to open a document with the name hello-txt : 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.
Describe difference between randomization and matching : Describe the difference between randomization (random assignment) and matching? What are the advantages and disadvantages of each?
What do researchers interested in psychometrics study : Distinguish among observational, physiological, and self-report measures.- What do researchers interested in psychometrics study?
Why must researchers use reliable measures : Why must researchers use reliable measures?- Why is it virtually impossible to eliminate all measurement error from the measures we use in research?
Why is health a social issue as much as a biological issue : Why is health a social issue as much as a biological issue? Name three ways in which health and medicine are linked to social inequality?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write a switch statement that assigns a string variable

Write a switch statement that assigns a String variable monthName with the months January, February, March, April, May, and June, ifmonthNum is 1, 2, 3, 4, 5, 6, accordingly.

  Program to print out the values and their counts

So we read in each number and add the number to an ordered linked list. If we are adding a number to the list and we find that number, then we will just count it. If we do not find the number in the linked list, then we will add a new node to the ..

  How do you make a row with different string names

How do you make a row with different string names and put a certain amount of space between each one?

  What is a friend function and how is it declared

What is a friend function and how is it declared? Which operators cannot be overloaded and why? What is a macro in C++ programming and what are some advantages to using them? Explain the purpose of an inline function?

  Make the program as efficient as possible

Write a Forms application, using loops, that generates the following diamond pattern when the button is clicked. For your output, use a multi-line textbox with the TextAlign property set to Center. Make the program as efficient as possible! You ca..

  Build a definition for a class that stores data

Using C++ language, build a definition for a class that stores data about a two dimensional vector. The class has to have mutators and accessors to get and set the x and y values. Make x and y integers. Then overload the operator * so that it retu..

  Write a function to print first n number of fibonacci series

Write a recursive function to print first n number of Fibonacci series.

  Implement uniform random number generator

Implement Uniform Random Number generator and Generate 1000 Random number between 0 an 10000.

  Write a program for keeping a course list

Write a program for keeping a course list for each student in a college. The information about each student should be kept in an object that contains the student's name and a list of courses completed by the student.

  Write a program which has a base process which communicates

write a program which has a base process which communicates with child processes acting as bombers that it

  Computer program the requirements are attached please see

the requirements are attached. please see them. the program should be done in c or c. also i need read me file to tell

  Using visual studio for pc,inside the visual c++

Data and Code to be used for this assignment 3 are attached. Using Visual Studio for PC,Inside the Visual C++ option, we want to select a Win32 Console Application.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd