I am very new to java. I was wondering how can I calculate total age in months and store it as variable? this is what I have so far:
* You will ask the user to provide their name (as a single word, assume first name here)
* You will ask the user their age in full years (no fraction or months)
* You will ask the user how many full months since their last birthday (again, whole numbers here).
* You will use this information to calculate the user's age in months and use that information to print
* out a greeting.
Hello Amir, so if statements would be a good way to execute the last part of your code. Here is what that code would look like. P.S. I changed your variable "a" to "age" because that was what you used in your comments, and make sure and also add the additional months since the user's last birthday to the variable for total months. Hope this is helpful.