hey guys i have a c++ program due tonight for class and im geting a errors that i dont know how to fix and was wondering can somebody look at my program and look at the errors and perhaps fix them.
Code:
#include <iomanip>
#include <iostream>
#include <fstream>
using namespace std;
bool myIsAlpha( char ch );
bool myIsDigit( char ch );
bool myIsUpper( char ch );
int main ()
{
char ch;
ifstream inputFile( "input.txt" );
inputFile.get(ch);
inputFile.open ( "input.txt" );
if (inputFile.fail() )
{
cout << "input.txt failed to open";
exit ( -1 );
}
int Alpha;
int Upper;
int Lower;
int Digit;
int White;
int Space;
int Total;
Alpha = 0;
Upper = 0;
Lower = 0;
Digit = 0;
White = 0;
Space = 0;
Total = 0;
cout << "Alpha";
cin >> ch;
cout << "Total";
cin >> ch;
cout << "Upper";
cin >> ch;
cout << "Lower";
cin >> ch;
cout << "Digit";
cin >> ch;
cout << "Space";
cin << ch;
while (inputFile)
{
Total++;
cout << ch;
if(myIsAlpha(ch))
{
Alpha++;
cout << ch;
if(myIsUpper(ch))
Upper++;
cout << ch;
}
else
{
Lower++;
cout << ch;
}
else if (myIsDigit(ch))
{
Digit ++;
cout << ch;
}
else if (isspace(ch))
{
White++;
cout << ch;
if (ch== ' ')
Space++;
cout << ch;
}
return 0;
}
bool myIsAlpha( char ch )
{
if (ch > 'a' && ch <= 'z' || ch>='A' && ch <= 'Z')
return true;
else
return false;
}
bool myIsDigit ( char ch )
{
if (ch >= '0' && ch <= '9')
return true;
else
return false;
}
bool myIsUpper ( char ch )
{
if ( ch >= 65 && ch <= 90)
return true;
else
return false;
}