Write a program to generate personalized junk mail. Theprogram takes input both
ID: 3619106 • Letter: W
Question
Write a program to generate personalized junk mail. Theprogram takes input both from an input file and from the keyboard.The input file contains the text of a letter, except that the nameof the recipient is indicated by the three characters #N#. Theprogram asks the user for a name an then writes the letter toa second file but with the three letters #N# replaces by the name.The three-letter string #N# will occur exactly once in theletter. Hint: Have your program read from the input file until itencounters the three characters #N#, and have it copy what it readsto the output file as it goes. When it encounters the three letters#N#, it then sends output to thescreen asking for the name from thekeyboard. You should be able to figure out eh rest fo the details.Your program should define a functionthat is called with theinpute-and output-file streams as arguments. Write a program to generate personalized junk mail. Theprogram takes input both from an input file and from the keyboard.The input file contains the text of a letter, except that the nameof the recipient is indicated by the three characters #N#. Theprogram asks the user for a name an then writes the letter toa second file but with the three letters #N# replaces by the name.The three-letter string #N# will occur exactly once in theletter. Hint: Have your program read from the input file until itencounters the three characters #N#, and have it copy what it readsto the output file as it goes. When it encounters the three letters#N#, it then sends output to thescreen asking for the name from thekeyboard. You should be able to figure out eh rest fo the details.Your program should define a functionthat is called with theinpute-and output-file streams as arguments.Explanation / Answer
please rate - thanks #include #include using namespace std; void replace(ifstream&,ofstream&); int main() {char filename[30]; bool found=false; coutfilename; ifstream input; ofstream output; input.open(filename); if(input.fail()) { coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.