Exercise 2: File manipulation Assume that we have a first file called French.txt enclosing the following words, and a second file called English.txt containing the translation of the French words in English: French.txt English.txt Apple Strawberry Pomme Fraise Banane Banana Poire Pear Orange Orange Merci Thanks Bonjour Hello • Create the two files French.txt , and English.txt as text documents, and enter the words as above. (in the same directory of the program) Wahiba Ben Abdessalem • Write ac ++ program that includes the following steps: 1- Open the file French.txt for reading and display all the words at the screen. 2- Close the file French.txt. 3- Reopen (reading) the French.txt file and open (reading) the English.txt file, to do this you must declare two ifstream variables: ifstrem infile1, infile2; To open the two files at the same time: infile1.open ("French.txt"); infile2.open ("English.txt"); - Read each French word from French.txt, and each equivalent English word from English.txt, and write the two words in a third file called translator.txt. Put a space or (---->) between the two words in this file. (open (writing) translator.txt) 4- Close all the opened files. 5- Reopen (reading) the file translator.txt and display the translated words. • Take into account the end of files when opening files. The expected output is the following: The French file words are: Pomme Fraise Banane Poire Orange Merci Bonjour The translated words are the following: French English Pomme -----> Apple Fraise --.> Strawberry Banane -----> Banana Poire ---> Pear Orange Merci -----> Thanks Bonjour ----> Hello -> Orange
Exercise 2: File manipulation Assume that we have a first file called French.txt enclosing the following words, and a second file called English.txt containing the translation of the French words in English: French.txt English.txt Apple Strawberry Pomme Fraise Banane Banana Poire Pear Orange Orange Merci Thanks Bonjour Hello • Create the two files French.txt , and English.txt as text documents, and enter the words as above. (in the same directory of the program) Wahiba Ben Abdessalem • Write ac ++ program that includes the following steps: 1- Open the file French.txt for reading and display all the words at the screen. 2- Close the file French.txt. 3- Reopen (reading) the French.txt file and open (reading) the English.txt file, to do this you must declare two ifstream variables: ifstrem infile1, infile2; To open the two files at the same time: infile1.open ("French.txt"); infile2.open ("English.txt"); - Read each French word from French.txt, and each equivalent English word from English.txt, and write the two words in a third file called translator.txt. Put a space or (---->) between the two words in this file. (open (writing) translator.txt) 4- Close all the opened files. 5- Reopen (reading) the file translator.txt and display the translated words. • Take into account the end of files when opening files. The expected output is the following: The French file words are: Pomme Fraise Banane Poire Orange Merci Bonjour The translated words are the following: French English Pomme -----> Apple Fraise --.> Strawberry Banane -----> Banana Poire ---> Pear Orange Merci -----> Thanks Bonjour ----> Hello -> Orange
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
Please Solution All Point on Required
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 6 steps with 4 images
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY