So I'm writing a program and I want to have some user input. Let's say we define an int; called age. If the user is an adult (let's say 30 and up), I want the program to swap all the informal "you"'s to "formal" you's (many languages, like French, have this distinction, think of vous vs tu) In Dutch, "u" is formal as opposed to "je".
What would be the most concise way of doing this? I have this right now (using the date of today, 18 Sept 2015):
string abc;
if (2015 - year of birth > 30) {
abc = "u";
}
else {
abc = "je";
}
if (2015 - year of birth == 30) {
if ( September - month of birth > 0) {
abc = "u";
}
else {
abc = "je";
}
}
if (2015 - year of birth == 30) {
if (September - month of birth == 0) {
if (18 - day of birth >= 0) {
abc = "u";
}
else {
abc = "je";
}
}
}
I'm pretty sure it works but is probably suboptimal. How can I improve this?