Write a program that will convert names in the LAST NAME, FIRST NAME MI format t
ID: 3634872 • Letter: W
Question
Write a program that will convert names in the LAST NAME, FIRST NAME MI formatto FIRST NAME MI LAST NAME format. For example, given the name
Nixon, Richard M.
the program will convert it to:
Richard M. Nixon
You will read the names from a file and write the names to the console. The input file has
one name per line and the last line in the file has a ".". The program should read the input
filename from the user.
this is what i have so far.
// Include Section
#include <iostream>
#include <fstream>
// Main Program
int main ()
{
using namespace std;
// Output Odentification
cout << " In class # 11 by - Reuel Brumell - Reverse Names ";
//Variable Declarations
char filename; // opens the file names.txt
char names [100[; // array
int i =0; //
ifstream isfile; // input file stream
cout << " Enter the file you wish to print in reverse order:";
cin >> filename;
isfile.open("F://names.txt");
// checks if the file opening failed.
if (isfile.fail())
{
cout << " Input file opening failed.";
exit(1);
}