Question: Please explain with JAVA code You will get a set of numbers from the users. In this assignment you should implement a code that calculates

Please explain with JAVA code

Please explain with JAVA code You will get a set of numbers

You will get a set of numbers from the users. In this assignment you should implement a code that calculates the result for Kayseri Compression Method. KCM has three inputs: number of integers (n), compression level (level), n different integer values. It gives a set of integers which shows the compressed value. KCM is calculated as follow: A = e1, e2, ..., en KCM1(A) = (e1+e2), (e2+e3), ..., (en-1+en) For example: When, n = 7, level = 1, and numbers are {1, 2, 3, 4, 5, 6, 7}then the result becomes {3,5,7,9,11, 13} because of {1+2, 2+3, 3+4, 4+5,5+6, 6+7} For the same input, when level = 2, the answer will be {8, 12, 16, 20, 24} Input Format Two integer values n, and level, respectively. The next line includes n numbers. Constraints The numbers are in integer size Output Format A single line that includes a set of numbers Sample Input 0 72 1 2 3 4 5 6 7 Sample Output 0 8 12 16 20 24 Explanation 0 Original: 1 2 3 4 5 6 7 Level 1:35 7 9 11 13 Level 2: 8 12 16 20 24

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!