写作COMP1002程序设计、 辅导program编程

” 写作COMP1002程序设计、 辅导program编程Methodology in Information Technology (COMP1001)Assignment THREE(Due at noon on 30 October 2020)1. [20 marks] Write a Python program that will prompt the user for his/her first name, last name anda symbol. The program will print the first name, a space, and the last name on each line. But onlythe first character is printed on the first line, the First two characters on the second line and so onuntil the whole name is printed out. After that, the next line will print out the name except the lastcharacter, the next next line the name except for the last two characters, and so on until the firstcharacter is printed out. Also, for each odd-numbered column, the letter has to be replaced by theinput symbol. Note that the space should not be replaced. Your program should look like below:2. [30 marks] In cryptography, a monoalphabetic substitution cipher is an encryption algorithm thatconverts an English letter to another letter based on a key. For example, if the English text isdennis and the key is zaqxswcdevfrbgtnhymjukilop, the encrypted text will be xsggem. Thefollowing table shows the conversion:a b c d e f g h i j k l m n o p q r s t u v w x y zz a q x s w c d e v f r b g t n h y m j u k i l o pThe first row is the original English letters and the second row is the encrypted letters. The keymust be a permutation of 26 letters. The highlighted letters above are the one used in aboveexample.Write a Python program that accepts a key and a text string and produces the encrypted text inlowercase letters. If the input key is not a Permutation of 26 letters, the program should ask theuser to input again. Your program should look like below:23. [25 marks] In the lecture, we have explained how we can add an arbitrary list of long integerstogether using a few very simple procedures without doing even any mathematical computation.The solution is expressed in pseudo-code. There are still some works to do when converting apiece of pseudo-code to a program, e.g. data type conversion, precise loop variable setting, andmany small details to make a program. After this exercise, you could get a feeling on thedifference between designing in pseudo-code versus writing the program. Writing a program in Cwill even be more difficult than in Python.Write a Python program to realize the pseudo-code in the lecture note to add a list of long integers.You need to set up a table for the first step to add two small numbers. You may use a list of lists,or any appropriate data structure but the content must not be computed on-the-fly, following theconcept of symbolic computation. Your program should contain at least 4 functions implementingthe functions in the pseudo-code. Here are some sample outputs from your program:4. [25 marks] (a) The following decision tree T classifies a post in a social network into four types:technology, business, world, and unknown. Express the decision tree T in pseudo-code.(b) Assuming that the Probabilities of various branches of the tree are as shown, determine theaverage number of if-statements to be executed when making classification.(c) Redraw the decision tree in another better form T such that T and T are equivalent, i.e.given any input case, the two Decision trees will give the same output. Demonstrate that the twotrees are equivalent by Giving at least an example in each type to support your candidate tree T.0.6 0.40.2 0.8 0.6 0.40.3 0.70.4 0.6 0.5 0.53Submission InstructionsFollow the steps below:1. Create a folder and name it as student no_your name,e.g., 12345678d_CHANTaiMan2. For Q1, Q2 and Q3. You need to submit the source file (.py). Name the .py files asA3_Qquestion no_student no_your name.py,e.g., A3_Q1_12345678d_CHANTaiMan.py3. For Q4. You need to type your answers in a word document and save it as a .pdf file. Namethe single .pdf file as A3_student no_your name.pdf,e.g., A3_12345678d_CHANTaiMan.pdf4. Put all the .py and .pdf files into the folder.5. Compress the folder (.zip, .7z, or .rar).6. Submit the file to Blackboard.A maximum of 3 attempts For submission are allowed. Only the last attempt will be graded. A latepenalty of 5% per hour will be imposed.如有需要,请加QQ:99515681 或邮箱:99515681@qq.com

添加老师微信回复‘’官网 辅导‘’获取专业老师帮助,或点击联系老师1对1在线指导