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

  Code to implement a staque

Write a C++ code to implement a Staque. Since the data structure is all about inserting and deleting numbers, it would be a good option to use a linked list to implement Staque.

  Member data for faculty number

Create a class Student_info, which inherits class Person, in which member data for faculty number, group and faculty are added. The class contains a constructor, member functions for accessing the data, for change of ID and for displaying the data..

  C++ program to calculate the temperature

Randomly generates the daily temperature (in F) of two cities A and B the month of July. The temperatures are integers in the range [60.. 90] and they are stored in two arrays tA and tB.

  Create a program for a company named retail-mart

Prompt the user to enter an item name (one word only), a quantity and a price. For this step, in addition to functionality, I'll be looking at: location of the variable declarations; appropriateness of data types selected; appropriateness of the va..

  Calculate the commission owing for that record

Construct an algorithm that will read a record on the file, calculate the commission owing for that record, and print the retail price, commission and employee number

  Write c program to accept inputs from user

Write down simple c program which accepts following inputs from user that is username and password, it must ask user what he will like to learn today and also ask user to enter char m=math , e= English.

  Objectivein this assignment you read a list of employees

objectivein this assignment you read a list of employees from a csv file and convert them into corresponding objects.

  Write program to keep track of a hardware store''s inventory.

Use seven parallel vectors to store the information. The program must contain at least the following functions: one to input data into the vectors, one to display the menu, one to sell an item and one to print the report for the manager.

  In competitive tournament

In competitive tournaments, it is common for all the players or teams to play in a series of matches in order to determine a single winner of the entire tournament. However, a number of different tournament formats exist. Here, we will concern our..

  Review structured programming concepts

Review structured programming concepts - Describe the main concepts of the object-oriented programming paradigm.

  Write a program that prints out a users astrological sign

Write one program that prints out a user's astrological sign. The program should ask a user to enter his / her birth month and birthday (the year is not important).

  Design a class: pounds (type long) and shillings (type int)

Design a class: pounds (type long), shillings (type int), pence(type int) data items.

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