Advertisement
akosiraff

Coding JAVA

Oct 27th, 2013
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1.  
  2. Download: http://solutionzip.com/downloads/coding-java/
  3. Write a program to read a message from keyboard, and an integer number between 1 and 10 for CODING. Prompt user if the numbers is not valid.
  4. Modify each of the characters and digits based on the following method.
  5. Modify each character or digit symbols by adding CODING to its Unicode and circulating around characters.
  6. A B C D E F G H I … P Q R S T U X Y Z
  7. For example if CODING is set to 5, then
  8. A-> F, B-> G, C-> H, …, S-> Z, T-> A, U-> B, X->C
  9. The same procedure applies for a-z, and 0-9.
  10. Then print the binary representation of the message on screen. Assume 8 bits for each symbol.
  11. For example, if input message is ABC, and CODING is set to 4 then the output would be:
  12. 010001010100011001000111 that stands for binary representation of EFG
  13. Note 1:Do not apply coding for any other symbols except characters and digits.
  14. Note 2: Develop appropriate algorithm for encoding and decoding (just for the bonus part). You should not use excessive if -else statements for encoding or decoding.
  15. Note 3: You should use appropriate methods and loops for encoding and decoding the message. Each method should not be longer than one screen shot.
  16. A sample program that reads a line of message from keyboard, and prints each character per line.
  17. Sample input and output of the program:
  18. F:\java\test>java lab6this is a testthis is a test F:\java\test>
  19. 50 marks
  20. Bonus [ 10 Marks]
  21. Develop another method(s), to take CODING and the binary message like the output of the program in the first part. The new method should decode the binary message and prints the original message on the screen.
  22.  
  23. Download: http://solutionzip.com/downloads/coding-java/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement