This is meant to be a simple program designed to write a quick "happy birthday" email to someone. It seems like there is a problem with the if, else if and else statements. Please ignore the simple_error(); statements. They are not the issue here. Many thanks in advance - I just can't figure this out!
#include "std_lib_facilities.h"
string first_name;
int age;
char spouse;
string spouse2;
string grammar;
int main()
{
grammar = "s y";
cout << "\nPlease enter your name of the person you wish to write to (followed by 'enter'):\n";
cin >> first_name; // read characters into first_name
cout << "\nPlease enter the age of the person you wish to write to (followed by 'enter'):\n\n";
cin >> age;
if (age <= 0 || age > 110) {
simple_error("\nYou're Kidding! Right?!\n");
}
cout << "\nPlease enter the gender of the person's spouse (write 'm' for male, 'f' for female and 'p' for unmarried followed by 'enter'):\n\n";
cin >> spouse;
if (spouse != 'm' && spouse != 'f' && spouse != 'p') {
simple_error("\nUm ... Try Again?\n");
}
if (spouse = 'm') {
spouse2 = "your husband";
}
elseif (spouse = 'f'){
spouse2 = "your wife";
}
else {
spouse2 = "your friends and family";
grammar = " y";
}
cout << "\nDear " << first_name << ",\n";
cout << " I wanted to wish you a very happy birthday. I hope you have a great day.\n";
cout << "You really deserve it!\n";
cout << "I still can't believe your already " << age << " years old!\n";
cout << "I hope " << spouse2 << " get" << grammar << "ou some great presents!\n" << endl;
cout << "Yours Sincerely, \n\n\n";
cout << MY NAME\n";
}