What is the difference between a text file and a binary file

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

Assignment

Random File Access

• Discuss in detail the difference in the process of sequential file access and random file access.
• Also, explain the advantage of fixed-sized data fields over variables sized fields.
• How do fixed-sized data fields aid in random file access?
• Explain a situation where you would use the unget function while reading data from a text file.

Encryption Using File Streams

Part A

Complete the following questions:

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.

2. 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?

3. Why is the ifstream parameter of the read_data procedure in the previous question a reference parameter and not a value parameter?

4. 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.

Reference no: EM131396199

Questions Cloud

Outsourcing phenomena in manufacturing-business services : 1. What are some of the main differences between the outsourcing phenomena in manufacturing versus business services?
Harley-davidson- business overview for new planning team : As a member of Harley-Davidson's strategic planning team, you have been asked to create a five- to six-slide Microsoft PowerPoint presentation titled "Harley-Davidson Today: A Brief Overview of the Business" to orient members who have been newly a..
Inverse market demand : 1. Suppose two firms compete by choosing quantities and that neither of them sees the other's quantity before having to commit to its own production level. Inverse market demand is given by
Criticize the given definitions - faith is the bird : Criticize the following definitions in light of the eight rules for lexical definitions:- Faith is the bird that sings when the dawn is still dark.
What is the difference between a text file and a binary file : 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?
Growth rate of efficiency and level of efficiency : What is the difference between growth rate of efficiency and level of efficiency?
Heart and preventing cancer : Several medical studies have shown that drinking green tea is good for the heart and preventing cancer. How would such a study affect the public's demand for green tea at it's current price? How would it affect the type of plants that farmer's p..
Compare and contrast their inventory management systems : From the first e-Activity, examine the best practices found in the video on inventory management.From the second e-Activity, choose two service companies that manage inventory and compare and contrast their inventory management systems.
Kenya an attractive site for business process outsourcing : Read the attached article "The world economy calls: Will improved communications attract call centers to Africa?" from the Economist magazine. Then answer the following questions: 1. List at least three factors that make Kenya an attractive site f..

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create a base employee class

Create a base Employee class and a derived StudentEmployee class

  Check the product code and calculate the amount

Instead of getting the product names and prices from the standard input, enhance the program to read it from a file instead

  Write a set of nested loops that display 10 rows

Write a set of nested loops that display 10 rows of # characters. There should be 15 # characters in each row.

  Write a small program scropy

You are supposed to write a small program scropy, which takes two arguments on the command line: the names of a source file and a destination file.

  Write a program that asks the user to enter the names of 3

Write a program that asks the user to enter the names of three salesmen. The program should thenaccept the sales produced for salesman for each quarter of the year. Display the name, and the totalsales amount, of each salesman.

  Show how your function works

Write a function named longestSortedSequence that accepts an array of integers as a parameter and that returns the length of the longest sorted non-decreasing sequence of integers in the array. For case given the sequence:

  What impact do selection structures have on teste a program

What impact do selection structures have on teste a program?

  Program to convert number to words

Write a program that stores and converts a number entered in Roman numerals to an integer value. Your program must consist of a class named Roman.

  Determines whether a given number is a perfect square

Write and test the following function that determines whether a given number is a perfect squarebool IsSquare(int);

  Write a program that stimulates a bouncing ball

Write a program that stimulates a bouncing ball by computing its height in feet at each second as time passes on a simulated clock. At time zero, the ball begins at height zero.

  Design and implement a library system

Design and implement a library system that does the following: ? Takes details of a student/library users: first name, last name, other names, user ID number, and nationality.

  Create a vector of 2d and 3d geometric figures

Write a C++ program that allows the user to create a vector of 2D and 3D geometric figures then computes their areas and volumes if possible

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