Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class EncryptedPriceTag {
- private static final double[] priceTagEncrypted = {
- 1.80861, 1.91913, 1.96854, 1.77343, 1.94593,
- 1.92063, 1.80366, 1.70125, 1.92574, 1.80914,
- 1.81168, 1.72147, 1.73987, 1.96227, 1.70446,
- 1.95477, //112 - p
- 1.98968, //114 - r
- 1.83260, //105 - i
- 1.72788, //99 - c
- 1.76278,//101 - e
- 1.81758, 1.80528, 1.70235, 1.75671, 1.94322,
- };
- public String get() {
- StringBuilder stringBuilder = new StringBuilder();
- int firstCharacterPosition = (int) (0.6 * priceTagEncrypted.length); //15
- int lastCharacterPosition = (int) (0.8 * priceTagEncrypted.length); //20
- for (int i = firstCharacterPosition; i < lastCharacterPosition; i++) {
- double arrayValue = priceTagEncrypted[i];
- double degree = Math.round(Math.toDegrees(arrayValue));
- char decryptedCharacter = (char) degree;
- stringBuilder.append(decryptedCharacter);
- }
- return stringBuilder.toString();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement