Changes between Version 16 and Version 17 of ProgrammingPrompts


Ignore:
Timestamp:
Nov 25, 2015, 1:43:10 PM (9 years ago)
Author:
Timothy Lin
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ProgrammingPrompts

    v16 v17  
    3131For this problem, you will implement a simple hash/checksum algorithm.
    3232
    33 Write a static method that takes in a string and returns it's {{{short}}} typed checksum. Calculate the checksum using the following steps:
     33Write a static method that takes in a string and returns it's {{{long}}}-typed checksum. Calculate the checksum using the following steps:
    34341. For each character, convert the {{{String}}} to a {{{char}}}.
    35352. For each {{{char}}}, raise it to the power of its index. (For example, the 7th {{{char}}} will be raised to the 6th power.)
    36363. Sum the powers.
    37 4. Modulus divide the sum to make it fit in a {{{short}}} data type.
     374. Allow overflow.
    3838
    3939=== !MovingAverage