|
@@ -1,9 +1,23 @@
|
1
|
1
|
/**
|
2
|
2
|
* Created by iyasuwatts on 10/17/17.
|
3
|
3
|
*/
|
|
4
|
+import java.util.*;
|
4
|
5
|
public class Main {
|
5
|
6
|
|
6
|
7
|
public static void main(String[] args){
|
|
8
|
+ System.out.println("Choose a positive whole number");
|
|
9
|
+ Scanner userInput = new Scanner(System.in);
|
|
10
|
+ String userNumber = userInput.nextLine();
|
|
11
|
+ Integer userNumberConverted = Integer.parseInt(userNumber);
|
|
12
|
+ Integer sumTotal = 0;
|
|
13
|
+
|
|
14
|
+ for (int i = userNumberConverted; i > 0; i--) {
|
|
15
|
+ sumTotal = userNumberConverted + i;
|
|
16
|
+ }
|
|
17
|
+
|
|
18
|
+ System.out.println("The total sum is " + sumTotal);
|
7
|
19
|
|
8
|
20
|
}
|
|
21
|
+
|
|
22
|
+
|
9
|
23
|
}
|