Hello all, I just started a new java class and I am having a little bit off a problem with this program I have to write. I need to have a program that reads an integer value from the user and displays the sum of all the even integers from 1 to the input value and the odd sum of all the integers both being inclusive. I get the java part of it for the most part I just can't think of the math part to calculate this. I know I need to use JOption and parse stuff but can't even begin to think of the math part that does this, any help? thank you.

Example: User enters 7.

Sum of even integers = 2+4+6 = 12

Sum of odd integers = 1+3+5+7=16