Suppose that you are still writing the same
Want to see the full answer?
Check out a sample textbook solutionChapter 6 Solutions
Problem Solving with C++, Student Value Edition plus MyProgrammingLab with Pearson eText -- Access Card Package (9th Edition)
Additional Engineering Textbook Solutions
Computer Systems: A Programmer's Perspective (3rd Edition)
Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)
Starting out with Visual C# (4th Edition)
Objects First with Java: A Practical Introduction Using BlueJ (6th Edition)
Starting Out with C++ from Control Structures to Objects (8th Edition)
Database Concepts (7th Edition)
- What is the difference between a text and a binary file? Can you use a text editor to see a text or binary file?arrow_forwardCan you explain what a file is? Why is it necessary to "open" and "close" a file? Suppose we do it that way, what will happen?arrow_forwardWhat is the difference between a text file and a binary file? Is it possible to view a text or binary file in a text editor?arrow_forward
- The Problem: Our program uses binary files as input. How can we be sure we get the right binary files?arrow_forwardYour ReadRoomFile program reads a room file. Is it possible to tell how many rooms are in the file from the file size? Explain why or why not?arrow_forwardCreate two programs that processes data with file I/O, nested loops, and other logic Read data from the first text file, loop through the second text file, and do something. Output something to a third text file.arrow_forward
- Modify your program from Learning Journal Unit 7 to read dictionary items from a file and write the inverted dictionary to a file. You will need to decide on the following: How to format each dictionary item as a text string in the input file. How to covert each input string into a dictionary item. How to format each item of your inverted dictionary as a text string in the output file. Create an input file with your original three-or-more items and add at least three new items, for a total of at least six items. Include the following in your Learning Journal submission: The input file for your original dictionary (with at least six items). The Python program to read from a file, invert the dictionary, and write to a different file. The output file for your inverted dictionary. A description of how you chose to encode the original dictionary and the inverted dictionary in text files. Show more... Modify your program from Learning Journal Unit 7 to read dictionary items from a…arrow_forwardI should have two files and the out put it's not correctarrow_forwardis it possible to just join both files together and for it to compile correctly?arrow_forward
- First, take your program and add one more feature: at the end, just before you close the file, write the word “END” all by itself on a line. Run that program once to create a file of items with “END”. Instead of reading from cin and writing to a file, you read from your file and write to cout. The only tricky part is deciding when to stop reading. In your previous code, you stopped reading when the user said they didn’t want to continue. For the new code, keep reading until you read “END” for the name of the produce. You can use “==” on strings, so if (product name == ”END”) will tell you that you can stop reading. My code: #include<iostream>#include<string.h>#include<fstream>using namespace std; int main(){ string filename; cout<<"Enter the name of the file to store the information"<<endl; getline(cin,filename); ofstream fileptr(filename.c_str()); if(!fileptr.is_open()) { cout<<"Couldn't open a file"<<endl; }…arrow_forwardIs there a certain sort of object that you should construct in order to read data from a text file?arrow_forwardFind out what a file's extension means and how it affects the file you're working on. This is an easy idea to grasp.arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education