首页 > > 详细

代写EE5805留学生作业、代做Programming课程作业、代做Java编程语言作业、Java作业代做 代写Python编程|代做数据库SQL

EE5805 Java Network Programming
Test 1, 2019/20 Summer Term
Question 1. (30 marks)
The simple substitution cipher is a cipher that has been in use for hundreds of years. It basically consists
of substituting every plaintext character for a different ciphertext character. The alphabet set is simplified
to contain only the space character, comma, full-stop, digits (0-9), uppercase letters (A-Z) and lowercase
letters (a-z).
alphabets = { ,.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz}
key = {9fj,.6SpC57aeU VJ4Z0ybLXTx2guqI3Hwtin8GQNP1KFRklEzdrvocWsDhBAMmYO}
You can see from the given key that
• ‘ ‘ is substituted by ‘9’
• ‘,’ is substituted by ‘f’
• ‘.’ is substituted by ‘j’
• ‘0’ is substituted by ‘,’
• ‘1’ is substituted by ‘.’
• ‘2’ is substituted by ‘6’
• and so on.
a) [20 marks] Implement the methods encrypt(String key, String text) and decrypt(String key, String
cipher) in the class Q1.java.
b) [10 marks] Create a test class Q1Test.java with two test cases for the two methods in part (a) using
JUnit.
• For encryption:
key: 9fj,.6SpC57aeU VJ4Z0ybLXTx2guqI3Hwtin8GQNP1KFRklEzdrvocWsDhBAMmYO
text: Cheers, you will see this message if your program is correct.
expected result: VkKKsDf9YoB9Mldd9DKK9hklD9rKDDQRK9lF9YoBs9csoRsQr9lD9PossKPhj
• For decryption:
key: 9fj,.6SpC57aeU VJ4Z0ybLXTx2guqI3Hwtin8GQNP1KFRklEzdrvocWsDhBAMmYO
cipher: VkKKsDf9YoB9Mldd9DKK9hklD9rKDDQRK9lF9YoBs9csoRsQr9lD9PossKPhj
expected result: Cheers, you will see this message if your program is correct.
Question 2. (40 marks)
A video content provider maintains a daily log of the clients’ streaming requests. The streaming requests
are stored in a file (video_data.txt) with one request per line. Each streaming request contains the
following three fields separated by commas:
• a timestamp (represented by a long integer),
• a video ID (a string), and
• a client’s IP address.
Write a Java program to find the top 5 most active clients from the log file, i.e. the five IP addresses with
the highest view count.
Implement the methods readDataFile(String filename) and findTop5Clients(List list) in the
class Q2.java. The specification of the methods is written in the comment section.
The expected program output is as follow:
END OF PAPER

联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-23:00
  • 微信:codinghelp
热点文章
程序代写更多图片

联系我们 - QQ: 99515681 微信:codinghelp
© 2014 www.7daixie.com
程序代写网!