i don't know how to make this program.. please help me.. tnx
Write a complete Java program that will fill an array with int values read
in from the keyboard, one per line, and outputs their sum as well as all
the numbers read in, with each number annotated to say what percentage it
contributes to the sum. Your program will ask the user how many integers
there will be, that will determine the length of the array. Sample Output:
How many integers will you enter? 4 Enter 4 integers, one per line: 2 1 1
2 The sum is 6. The numbers are: 2 which is 33.33% of the sum. 1 which is
16.67% of the sum. 1 which is 16.67% of the sum. 2 which is 33.33% of the
sum
No comments:
Post a Comment