Data File Handling - Text File (SD/PAPER/2017/P.6)

Sunidhi has used a text editing software to type some text. After saving the article as WORDS.TXT. She realized that she has wrongly typed alphabet J in place of I everywhere in the article.

Write a function definition JTOI( ) in C++ that would display the corrected version of entire content of the file WORDS.TXT with all alphabets 'J' to be replaced with 'I' everywhere in file and display on screen. 

Note: Assuming that WORDS.TXT does not contain any J alphabet otherwise.

Example: If Sunidhi has stored the following content in the file WORDS.TXT

WELL, THJS JS A WORD BY JTSELF. YOU COULD STRETCH THJS TO BE A SENTENCE.

The function JTOI() should display the following content:

WELL, THIS IS A WORD BY ITSELF. YOU COULD STRETCH THIS TO BE A SENTENCE. 


No comments

Post your comments

Powered by Blogger.