Advertisement
Guest User

Untitled

a guest
Feb 11th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. public class EncryptedPriceTag {
  2. private static final double[] priceTagEncrypted = {
  3. 1.80861, 1.91913, 1.96854, 1.77343, 1.94593,
  4. 1.92063, 1.80366, 1.70125, 1.92574, 1.80914,
  5. 1.81168, 1.72147, 1.73987, 1.96227, 1.70446,
  6. 1.95477, //112 - p
  7. 1.98968, //114 - r
  8. 1.83260, //105 - i
  9. 1.72788, //99 - c
  10. 1.76278,//101 - e
  11. 1.81758, 1.80528, 1.70235, 1.75671, 1.94322,
  12. };
  13.  
  14. public String get() {
  15. StringBuilder stringBuilder = new StringBuilder();
  16. int firstCharacterPosition = (int) (0.6 * priceTagEncrypted.length); //15
  17. int lastCharacterPosition = (int) (0.8 * priceTagEncrypted.length); //20
  18. for (int i = firstCharacterPosition; i < lastCharacterPosition; i++) {
  19. double arrayValue = priceTagEncrypted[i];
  20. double degree = Math.round(Math.toDegrees(arrayValue));
  21. char decryptedCharacter = (char) degree;
  22. stringBuilder.append(decryptedCharacter);
  23. }
  24. return stringBuilder.toString();
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement