” COMPSCI 111编程 写作、 辅导HTML,CSSQUESTION/ANSWER BOOKLET COMPSCI 111/111GTHE UNIVERSITY OF AUCKLANDSECOND SEMESTER, 2020Campus: CityCOMPUTER SCIENCEAn Introduction to Practical Computing(Time Allowed: TWO hours)NOTE:Calculators are NOT permitted.You must answer all questions in this question/answer booklet.There is space at the Back for answers that overflow the allotted space.Surname ModelForename(s) AnswersPreferred NameStudent IDLogin (UPI)Question Mark Out Of1 – 10 Short Answers 3011 Programming using Python 1512 Spreadsheets 1513 HTML5/CSS 2014 LaTeX 20TOTAL 100QUESTION/ANSWER BOOKLET COMPSCI 111/111GID .Page 2 of 21SECTION A SHORT ANSWERSAnswer all questions in this section in the space provided. If you run out of space, please usethe Overflow Sheet and indicate in the allotted space that you have used the Overflow Sheet.1. Artificial Intelligence (3 marks)What argument is Searle making in his Chinese Room discussion about the nature ofintelligence and how it applies to Artificial Intelligence programs?Searle is Making the argument that simple symbol manipulation, e.g.looking up a symbol in a table and copying over its entry, such as isdone in the Chinese Room discussion, does not represent understandingthe meaning of the symbol. Searles argument is that this is what AIprograms do. The crux of the argument is to counter Turings positionthat if that we need to look at the entity as a black box and if itsperformance seems intelligent, that for our purposes, we can call itintelligent. However, Searle is saying that we cannot simply go by itsperformance, we have to go inside the black box and see if itsperformance goes beyond mere syntactic symbol manipulation.(3 marks)2. Software Licences (3 marks)What is the main difference between software that is freeware and open source software?The main difference between freeware and open source software isthat freewares source code is proprietary and not publicly availablewhereas open Source softwares source code is publicly available andcan be used to create new software.(3 marks)QUESTION/ANSWER BOOKLET COMPSCI 111/111GID .Page 3 of 213. Digital Games (3 marks)Give an example of a stochastic board game and of a non-stochastic board game, anddiscuss how they exemplify their type of board game.An example of a stochastic board game is stratego and an example of anon-stochastic board game is chess. In non-stochastic board games, allboard information is known by both players and the immediate resultof an action can be correctly predicted by both players. In stochasticboard games, some board information is not known by both players andthis usually means that the immediate result of an action cannot becorrectly predicted by both players.In stratego, there is some board information that is only known by oneplayer, e.g., the identity of his pieces when they have not attacked orbeen attacked, while there is also information that is known to both,e.g., the location and ownership of pieces. This means that an attackerdoes not always know what the outcome of an attack will be before heexecutes the attack.In chess, all board information is known by both players, so each playerknows exactly the immediate result of their action, e.g., if they move apiece to a Specific location containing an enemy piece, then theycapture that piece.3 marks)4. Computer Hardware (3 marks)Which component within a computer (desktop or laptop) are almost all of the computersother components connected to? Describe this components purpose.The Motherboard. It provides communication between the computerscomponents.(3 marks)QUESTION/ANSWER BOOKLET COMPSCI 111/111GID .Page 4 of 215. History of Computing (3 marks)Describe the roles of the four people involved in preparing scientific tables before theadvent of computers.Two computers who do the calculations, one comparator who checkstheir results agree and a printer who prints the results.(3 marks)6. Computer Networks (3 marks)Describe the Difference between circuit switching and packet switching on a network.In circuit switching the nodes/computers are directly connected endto-end,and data is sent along this connection. In packet switching, thedata is broken into packets that are routed independently across thenetwork.(3 marks)QUESTION/ANSWER BOOKLET COMPSCI 111/111GID .Page 5 of 217. WWW (3 marks)On the WWW, what is the difference between the HTTP and HTTPS protocols?HTTPS encrypts an HTTP connection using TLS (Transport LayerSecurity). HTTP is unecrypted.(3 marks)8. Malware (3 marks)What is the difference between a computer virus and a computer worm?A virus needs a host program to spread it. A worm can spread itself.(3 marks)QUESTION/ANSWER BOOKLET COMPSCI 111/111GID .Page 6 of 219. Bits and Bytes (3 marks)How much Memory would be required to represent 248 different values?1 byte (8 bits)(3 marks)10. Digital Images (3 marks)How much memory would be required to store a 32-colour bitmap image that is 100pixels wide and is 16 pixels high? Show all your working.32 colours requires 5 bits per pixel (2 ^ 5 = 32)Number of pixels = 100 * 16= 1600 pixelsNumber of bits required = 5 * 1600= 8000 bits ( 1000 bytes)(3 marks)QUESTION/ANSWER BOOKLET COMPSCI 111/111GID .Page 7 of 21SECTION BAnswer all questions in This section in the space provided. If you run out of space, please usethe Overflow Sheet and indicate in the allotted space that you have used the Overflow Sheet.11. Programming Using Python (15 marks)(a) The following exponential function can be used to predict the spread of flu-likediseases: = 2(1)where d is the day number. The value for Day 0 is defined to be 1.Write a Python program that calculates and displays the number of flu infections aftera certain number of days. The number of days to predict is entered by the user. Youcan assume that the user will always enter an integer value greater than or equal to 1.Here are two examples of the program running with different values entered by the user.User input is indicated in the examples with bold and italicized font.Example 1:Enter the number of days to predict: 5The number of cases at day 1 is 1The number of cases at day 2 is 2The number of cases at day 3 is 4The number of cases at day 4 is 8The number of cases at day 5 is 16Example 2:Enter the number of days to predict: 1The number of cases at day 1 is 1days = int(input(Enter the number of days to predict: ))day = 1while day = days:cases = 2 ** (day – 1)print(The number of cases at day , day, is, cases)day = day + 1(5 marks)QUESTION/ANSWER BOOKLET COMPSCI 111/111GID .Page 8 of 21(b) Write a piece of code That prints the visibility rating for the visibility distance enteredby the user at the prompt Enter the Visibility Distance: . Use the tablebelow to determine the visibility rating. You can assume that the user will alwaysenter a floating-point number (i.e. a float). Two examples are given below.Visibility Rating Visibility DistanceGood 6Fair 3 6 (including 3 and 6)Poor 1 3 (including 1 but not 3)Fog 1Example 1:Enter the Visibility Distance: 0.2Your Visibility Rating is FogExample 2:Enter the Visibility Distance: 6.0Your Visibility Rating is Fairdistance = float(input(Enter the Visibility Distance: ))if distance 6:visibility = Goodelif distance = 3:visibility = Fairelif distance = 1:visibility = Poorelse:visibility = Fogprint(Your Visibility Rating is, visibility)(5 marks)QUESTION/ANSWER BOOKLET COMPSCI 111/111GID .Page 9 of 21(c) In the box below, complete the code that will make the following picture. Assumethat the turtle Begins in the middle of the window facing right and that the window isapproximately 500 steps wide. NOTE: You must use a while loop.import turtlesteps = 100angle1 = 45angle2 = 90number_of_repetitions = 10step_increment = 10repeat_number = 0while repeat_number number_of_repetitions:turtle.forward(steps)turtle.left(angle1)turtle.forward(steps)turtle.left(angle1)turtle.forward(steps)turtle.left(angle2)repeat_number = repeat_number + 1steps = steps + step_increment(5 marks)QUESTION/ANSWER BOOKLET COMPSCI 111/111GID .Page 10 of 2112. Spreadsheets (15 marks)The following spreadsheet displays information about the lunch a person had each day for oneweek.(a) Columns C to G of Rows 4 to 10 contain information about the lunch that the personhad on the day specified in Column B. What is the best formula to use in Cell E4 tofind the total number of calories the person consumed for lunch on the day specifiedin Cell B4? The Calorie table is located in Cells C17 : D23. Your answer must use aVLOOKUP function.Note: Your formula must be able to be filled down from E4 to E10 correctly.=VLOOKUP(C4,$C$17:$D$23,2,FALSE)*D4(6 marks)QUESTION/ANSWER BOOKLET COMPSCI 111/111GID .Page 11 of 21(b) Cell G4 indicates the number of calories consumed for lunch on the day specified inCell B4 that are under or over the goal number of calories specified in Cell E14.What is the best formula to use in Cell G4?Note: Your formula must be able to be filled down from G4 to G10 correctly.= E4 – $E$14(2 marks)(c) Cell E11 shows the total number of calories consumed for lunch for the week. Whatis the best formula to use in Cell E11?= SUM(E4:E10)(2 marks)(d) Cell E13 shows the average (mean) number of calories consumed for lunch each day.What is the best formula to use in Cell E13?= AVERAGE(E4:E10)(2 marks)(e) Cell G13 indicates whether the average number of calories in Cell E13 is under orover the goal number of calories specified in Cell E14. If the average is less than thegoal value, G13 should show Under. If the average is higher than the goal, thenCell G13 should Show Over. If the average is equal to the goal then Cell G13 is leftblank. What is the best formula to use in Cell G13?Note: Your formula must use an IF function.=IF(E13E14,Under,IF(E13E14,Over,))(3 marks)QUESTION/ANSWER BOOKLET COMPSCI 111/111GID .Page 12 of 21Question 13. HTML5 and CSS (20 marks)The following screenshot shows the body of a web page created using HTML5 and CSS:Complete the HTML5 code on the following pages so that it produces the output shownabove.You must use the styles defined in the internal style sheet in the head section on thefollowing page, and must not define any new styles.Note:(1) The URL for the University of Auckland Online Learning Resources is: httpss://www.online.auckland.ac.nz/.(2) The image is stored in a file called AucklandOnlineImage.png in the samefolder as the HTML file.(3) There are two sections (the Statistics section and the Slang Glossary section).QUESTION/ANSWER BOOKLET COMPSCI 111/111GID .Page 13 of 21!DOCTYPE htmlhtml lang=enheadmeta charset=UTF-8titleHTML/CSS Exam Question/titlestylebody {background-color: pink;font-family: Arial, Calibri, Sans-Serif}h1 {background-color:rgb(0,0,0); color:#E6FFE6;text-transform:uppercase; text-align:center}h2 {background-color:rgb(0,0,0); color:#E6FFE6;font-variant:small-caps}table, tr, td { border: 2px solid black;}#emphasis{font-size:large; color:red}#center {text-align:Center}#tablehead {background-color:rgb(0,0,0); color:#E6FFE6;font-weight:bold; text-align:center}.glossary{font-style:italic; font-weight:bold}.stat{text-align:right; font-weight:bold}/style/headbody!– Main Heading –(1 mark)!– Image –(2 marks)!– First Paragraph –(2 marks)QUESTION/ANSWER BOOKLET COMPSCI 111/111GID .Page 14 of 21!– Student Statistics Section –(7 marks)QUESTION/ANSWER BOOKLET COMPSCI 111/111GID .Page 15 of 21!– Slang Glossary Section –(8 marks)/body/htmlQUESTION/ANSWER BOOKLET COMPSCI 111/111GID .Page 16 of 2114. LaTeX (20 marks)On the following pages, complete the LaTeX code that will produce the output below:The image is stored in a file called Covid.png and is in the same folder as the LaTeXcode. When inserted into the document, the image should be centred and 6 cm wide.The following LaTeX commands have been included as a reference. You will not need touse all of these Commands.QUESTION/ANSWER BOOKLET COMPSCI 111/111GID .Page 17 of 21Normal commands Environments Math mode commands\usepackage{graphicx}\section{}\subsection{}\title{}\author{}\date{}\maketitle\item\textbf{}\emph{}\includegraphics{}\footnote{}itemizeenumerateverbatimflushrightcenterquotedisplaymathequationquotation$\sqrt{}\frac{}{}\leq\sum_{}^{}\infty\sigma^_\left(\right)(20 marks)\Documentclass[a4paper]{article}\begin{document}QUESTION/ANSWER BOOKLET COMPSCI 111/111GID .Page 18 of 21- Overflow Sheet 1 -Write the question number and letter next to your answer. You must ALSO indicate inthe allotted space that you have used the overflow sheet.QUESTION/ANSWER BOOKLET COMPSCI 111/111GID .Page 19 of 21- Overflow Sheet 2 -Write the question Number and letter next to your answer. You must ALSO indicate inthe allotted space that you have used the overflow sheet.QUESTION/ANSWER BOOKLET COMPSCI 111/111GID .Page 20 of 21Rough Working This page will not be markedQUESTION/ANSWER BOOKLET COMPSCI 111/111GID .Page 21 of 21Rough Working This page will not be marked________________________________________如有需要,请加QQ:99515681 或WX:codehelp
“
添加老师微信回复‘’官网 辅导‘’获取专业老师帮助,或点击联系老师1对1在线指导。