I'm writing a program that find the frequency of each letter in a c style string that will be read from a txt file.
I also have to display an error if the file isn't file.
I also have a switch statement that do all the menu inputs.
1) Gets the filename
2) Shows the upper case frequency of each letter
3) Shows the lower case frequency of each letter
4) ends program
The problem is that im having trouble with the error.
While in the menu it has to show the error, and then show that a file is found
If there is no file name then cases 'a' and 'b' can't be user
I've tried using a boolean when reading the file but it doesn't work
What am I doing wrong?
do
{
// function that displays menu
// get user input
// reads from file
switch( user input ){
case'a':
// gets the file name
break;
if( true ){
cout << "File is found << endl;
case 'b':
// gets display the upper freq
break;
case 'c':
// gets display the lower freq
break;
}
else
{
cout << "File is not found << endl;
}
case'd':
// ends the program
return 0;
break;
}
}
while( !false )