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...
icon
Related questions
Question
Please Solution All Point on Required
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)
Dr. Wahiba Ben Abdessalem
• Write a c ++ 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 -----> Orange
Merci ------> Thanks
Bonjour ------> Hello
Transcribed Image Text: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) Dr. Wahiba Ben Abdessalem • Write a c ++ 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 -----> Orange Merci ------> Thanks Bonjour ------> Hello
Expert Solution
steps

Step by step

Solved in 6 steps with 4 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
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 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)
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
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY