/*
The following program reads the name of an input file and then 
it copies the contents of the file exactly as they look like in 
the file after changing every lowercase letter to uppercase 
to another file whose name is entered by the user.
 */
#include <iostream>
#include <string>
#include <fstream>
using namespace std;

int main()
{
	ifstream inputFile;
	ofstream outputFile;
	string inputFileName, outputFileName, line;
	int i, n;
	cout << "Enter the name of the input file: ";
	cin >> inputFileName;
	inputFile.open(inputFileName.c_str());
	if (!inputFile)
	{
		cout << "Can't open the file." << endl;
		return 1;
	}
	cout << "Enter the name of the output file: ";
	cin >> outputFileName;
	outputFile.open(outputFileName.c_str());
	getline(inputFile,line);
	while (inputFile)
	{
		n = line.size();
		for (i = 0; i < n; i++)
			line[i] = toupper(line[i]);
		outputFile << line << endl;
		getline(inputFile,line);
	}
	inputFile.close();
	outputFile.close();
	return 0;
}
