Please help this in Java
Problem 1: Treaure Huat (4 points) You have come acros a mysterions old docnent, which is rumored to be the ey to finding the fabled treasure of the pirate Captain Blackbeard (worth 4 points). Decrypt the text to learn the location of the treasure chest (and to successfally solve the problem) ZDIBOK HIZLE CR GUN DGRU BG GWN GBII GANN PBIF GNO ONNG Hints Most 17th century pirates have not taken auy web security classes and thas, bave not learut that affine cipbers can easily be broken. The plaintext was written in contemporary English. Note that only the letters of the alphabet (A, B. .2) are encrypted, punctuation marks and spaces are mot. Tasks I. Write a Java function to caleulate the frequencies of letters in the ciphertext, and find at least two pairs of corresponding plain and cipher characters! (2 points) 2. Express the decryption of a character as an alfine transformation in modulo 26 arit hmetic, and complete the source code to decrypt the ciphestext! (2 point) Note that in Java, .9 % 26 "" .9 and .9 % 26 !, 17 Problem 1: Treaure Huat (4 points) You have come acros a mysterions old docnent, which is rumored to be the ey to finding the fabled treasure of the pirate Captain Blackbeard (worth 4 points). Decrypt the text to learn the location of the treasure chest (and to successfally solve the problem) ZDIBOK HIZLE CR GUN DGRU BG GWN GBII GANN PBIF GNO ONNG Hints Most 17th century pirates have not taken auy web security classes and thas, bave not learut that affine cipbers can easily be broken. The plaintext was written in contemporary English. Note that only the letters of the alphabet (A, B. .2) are encrypted, punctuation marks and spaces are mot. Tasks I. Write a Java function to caleulate the frequencies of letters in the ciphertext, and find at least two pairs of corresponding plain and cipher characters! (2 points) 2. Express the decryption of a character as an alfine transformation in modulo 26 arit hmetic, and complete the source code to decrypt the ciphestext! (2 point) Note that in Java, .9 % 26 "" .9 and .9 % 26 !, 17