Aditi has used a text editing software to type some text. After saving the article as WORDS.TXT, she realised that she has wrongly typed alphabet J in place of the alphabet I everywhere in the article.
Write a function definition for JTOI() in C++ that would display the corrected version of the entire content of the file WORDS.TXT with all the alphabets “J” to be displayed as an alphabet 'I' on screen.
Note: Assuming that WORD.TXT does not contain any J alphabet otherwise.
Example: If Aditi 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'
#include <iostream.h>
int main(void)
{
clrscr();
JTOI();
getch();
}
void JTOI()
{
char ch;
ifstream F('WORDS.TXT' );
while(F.get(ch))
{
if(ch=='J')
ch='I';
cout<<ch;
}
F.close(); //IGNORE
}



