Home › Forums › C Programming › decision program ?? › Re: Re: decision program ??
February 8, 2009 at 6:10 pm
#3521
GWILouisaxwzkla
Participant
could do:
C++
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | #include <iostream> #include <string> using namespace std; int main(void) { string name; string math; int a; int d; char mathGrade; cout << "Enter name: n"; cin >> name; cout << "Enter math grade " << name << " got: n"; cin >> mathGrade; if ( tolower ( mathGrade ) == 'a' || tolower ( mathGrade ) == 'b' || tolower ( mathGrade ) == 'c' ) cout << name << " passed n"; else if ( tolower ( mathGrade ) == 'd' || tolower ( mathGrade ) == 'f' ) cout << name << " failed n"; system("PAUSE"); return 0; } |