C++ program to copy selective text from one file to another

C++ program to copy selective text from one file to another
This is a c++ program with a complete different aspect, it doesn't belong to the common topics. This program can create a file, simultaneously it will clear our concept of opening and closing the same file. Also will help us to know to how to open a file in input mode with the command 'ios::out'. The second switch option is provided to us to just to see what does the file contains in it. This option can help us to learn a different aspect of how o open a file in output mode that is with 'ios::in'. this can also clarify our concept of how to open and read a file simultaneously. The third switch option is to create a complete new file which will contain the vowels of file1. The file1 is ran in a loop if the pointer encounters a vowel then the vowel will be copied to the file2. At the end of the loop both the files have to be closed. As a result the third one will clarify that how can we close two files simultaneously. Basically, the third option teaches us how to deal with two files all together. This was a short discussion on the program.So, without wasting much time lets start with the program. The program is as follows:
#include
#include
#include
#include
#include
void main()
{
clrscr();
int n,j;
fstream ofile,afile;
char str[100];
char ch,ch1;
do
{
cout<<"\n\t1.Create Text\n\t2.Read from File\n\t3.create another file";
cout << "\n 4.Exit  ";
cin>>ch;
switch(ch)
{
    case '1' :
ofile.open("smp.txt",ios::out);
cout<<"\n Enter The Text ";
gets(str);
ofile<<str;
ofile.close();
break;
    case '2' :
char tmp1;
afile.open("smp.txt",ios::in);
while(!afile.eof())
{
afile.get(tmp1);
if(isalpha(tmp1))
{
  if (islower(tmp1))
  {
  if (tmp1=='a'||tmp1=='e'||tmp1=='i'||tmp1=='o'||tmp1=='u')
  cout << "\n Lower case vowel "<<tmp1;
  else
  cout<<"\n Lower case consonants "<<tmp1;
  }
  if (isupper(tmp1))
  {
  if (tmp1=='A'||tmp1=='E'||tmp1=='I'||tmp1=='O'||tmp1=='U')
  cout << "\n Upper case vowel "<<tmp1;
  else
  cout<<"\n Lower case consonants "<<tmp1;
  }
}

}
afile.close();
break;
    case '3' : ofile.open("smp.txt",ios::in);
afile.open("smp1.txt",ios::out);
char c;
while(ofile)
{
ofile.get(c);
c = tolower(c);
if (c=='a'||c=='i'||c=='e'||c=='o'||c=='u')
afile.put(c);
}
ofile.close();
afile.close();

    case '4' : exit(0);
}
cout<<"\n\t DO U want to continue ";
cin>>ch1;
  }while(ch1=='Y'||ch1=='y');
getch();
}