Finding Letter Grade and Marital Status

This is a discussion on Finding Letter Grade and Marital Status within the C++ Programming forums, part of the General Programming Boards category; I'm working on this program which finds the letter grade and marital status of a student..the problem is outputting the ...

Finding Letter Grade and Marital Status

I'm working on this program which finds the letter grade and marital status of a student..the problem is outputting the Letter Grade and Marital Status.. they come out wrong. what am I doing wrong here?

cout<<"\n The Name of the Student: "<<Name;
cout<<"\n The Marital Status of the Student: "<<MarStat;
cout<<"\n The Test Score of the student: "<<TestScore;
cout<<"\n The Letter Grade of the student: "<<Grade;
}
system("PAUSE");
return 0;
}

I'm sorry, I didn't make it clear that I must use two switch statements- 1 for finding the letter grade and 1 for finding the marital status.
Elad..thanks for your help, i appreciate the whole re-writing.
Am I setting proper case conditions for the test scores? How do I get it to print MARRIED when a user enters m, for example?
I tried using strcpy, but the compiler says " passing `char' to argument 1 of `strcpy(char *, const char *)' lacks a cast "

MarStat is declared to be a single char, not an array of char in the first line after main(). you can't read a string, which is an array of char into a single char. That's what is causing the error. That's why I put the variable marStat (which is declared as a char array) in my rewrite. MarStat can never be a string based on how you declare it.

switch statements are based on integer results. Since char types are actually integers to the computer they can be as case results rather than type int.

Here's the only way I can think of to use a switch statement to do the grading:

and when I print the results..I get the right number grade that was input, but when I want to display the letter grade, it prints out integers like 65...I have absolutely noooo idea why it does this..do u?

the reason that your skipping the name the second time through has to do with the getline function some thing to do with getting all 15 characters, your getting a number for the Grade output because you have grade set to int type when it should be char, im not to keen on #define so i dont use it much here your code and some of mine (and it works) good luck