morgue
10-16-2003, 10:24 PM
Can someone tell me why this isn't working?
I can't compile, when I get to compile it freezes on 'linking...'
I'm using Visual C++ 6
#include <iostream.h>
int main()
{
int grade,
aCount = 0,
bCount = 0;
cout << "Enter the letter grandes." << endl
<< "Enter the EOF character to end input." << endl;
while ( ( grade = cin.get() ) != EOF)
{
switch ( grade )
{
case 'A':
case 'a':
aCount++;
break;
case 'B':
case 'b':
bCount++;
break;
default:
cout << "Incorrect. Enter a new grade." << endl;
break;
}
}
cout << "\n\nTotals for each letter grade are: "
<< "\nA: " << aCount
<< "\nB: " << bCount << endl;
return 0;
}
I can't compile, when I get to compile it freezes on 'linking...'
I'm using Visual C++ 6
#include <iostream.h>
int main()
{
int grade,
aCount = 0,
bCount = 0;
cout << "Enter the letter grandes." << endl
<< "Enter the EOF character to end input." << endl;
while ( ( grade = cin.get() ) != EOF)
{
switch ( grade )
{
case 'A':
case 'a':
aCount++;
break;
case 'B':
case 'b':
bCount++;
break;
default:
cout << "Incorrect. Enter a new grade." << endl;
break;
}
}
cout << "\n\nTotals for each letter grade are: "
<< "\nA: " << aCount
<< "\nB: " << bCount << endl;
return 0;
}