|
@@ -1,9 +1,37 @@
|
|
1
|
+import java.util.Scanner;
|
|
2
|
+
|
1
|
3
|
/**
|
2
|
4
|
* Created by iyasuwatts on 10/17/17.
|
3
|
5
|
*/
|
4
|
6
|
public class Main {
|
5
|
7
|
|
6
|
|
- public static void main(String[] args){
|
|
8
|
+ //public String [] sort(String[] n){
|
7
|
9
|
|
8
|
|
- }
|
|
10
|
+ //}
|
|
11
|
+ //public int addItUp(int n)
|
|
12
|
+
|
|
13
|
+public int main(int [] args){
|
|
14
|
+ System.out.println("Enter a number: ");
|
|
15
|
+ Scanner input = new Scanner(System.in);
|
|
16
|
+ int number = input.nextInt();
|
|
17
|
+ int sum=0;
|
|
18
|
+ for(int element: args){
|
|
19
|
+ sum+=element;}
|
|
20
|
+
|
|
21
|
+ System.out.println("Your Total is: "+sum);
|
|
22
|
+ return 0;
|
9
|
23
|
}
|
|
24
|
+ }
|
|
25
|
+
|
|
26
|
+ /*public int sumOf(int [] number){
|
|
27
|
+ int y = input.nextInt();
|
|
28
|
+ int sum=0;
|
|
29
|
+ //step 2 loop through numbers in array
|
|
30
|
+ for(int element: number){
|
|
31
|
+ sum+=element;
|
|
32
|
+ }
|
|
33
|
+
|
|
34
|
+ return sum;
|
|
35
|
+ }*/
|
|
36
|
+
|
|
37
|
+
|