1 / 16

Introduction to Computers -1 st exam-

Introduction to Computers -1 st exam-. 授課教授 : 李錫智 教授. 第一題. Given 8 bits, (a) How many different distinct combinations can we get from these bits ? Ans : = 256

berit
Télécharger la présentation

Introduction to Computers -1 st exam-

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction to Computers-1st exam- 授課教授: 李錫智 教授

  2. 第一題 Given 8 bits, (a) How many different distinct combinations can we get from these bits? Ans: = 256 (b) John wrote a book consisting of 4K pages. Each page contains 0.5K characters. Suppose each character is represented by a byte. John wants to store his book in a 1.8 MB memory. Is the memory big enough for the book? Why or why not? Hint: Please be careful about the use of M and K in computer science. Ans: 4* 2^(10 )*0.5*2^10*1=2* 2^(20 )=2MB>1.8MB,not enough (c) Mary wants to represent any integer between -31 and 25. How many bits does Mary need to use? Ans: 6

  3. 第二題 Please give two advantages that networking can provide. Ans: (1)資料可分散式處理 (2)容錯,走不同的路徑 第三題 Why a message is broken into packets at the sender and the packets are reassembled in the receiver end? Please give at least two advantages. Ans: (1)大家可以公平地傳輸,不會被大的message擋住 (2)一小部分出錯,不用全部重送

  4. 第四題 What is the content of V in each case: (a) V = 20 + 12 + “ I love NSYSU”; (b) V = 20 + “ I love NSYSU ” + 12; (c) V = “I love NSYSU “ + 20 + 12; (d) V = “I love NSYSU “ + (20 + 12); (e) V = “” + 20 + 12 + “ I love NSYSU”; Ans: (a)32 I love NSYSU (b)20 I love NSYSU 12 (c) I love NSYSU 2012 (d) I love NSYSU 32 (e)2012 I love NSYSU

  5. 第五題 Suppose the speed of instruction execution is proportional to the clock rate of the CPU. If a program is run by a 1.5GHz CPU in 30 minutes, how soon will it be run by a 7.5GHz CPU? Ans: 30/5 = 6 minutes

  6. 第六題 What does the following web page look like on the screen? <html> <head><title> How Great is HTML </title></head> <body> <div style=”text-align:left”> <p> <a href=http://www.ee.nsysu.edu.tw> <u>Hello! EE-NSYSU</u> </a> </p> <table border=”1”> <tr><td>Freshmen</td><td>90</td></tr> <tr><td>Sophomore</td><td>91</td></tr> <tr><td>Junior</td><td>92</td></tr> <tr><td>Senior</td><td>93</td></tr> </table> <p> How wonderful the department is! </p> </div> </body> </html>

  7. 第六題(答案) Ans:

  8. 第七題 Write a web page to show the following table on the screen.

  9. 第七題(答案) Ans: <tr> <td> <ul> <li>Html</li> <li>Javascript</li> </ul> </td> <td> DDDD</td> <td> <ol style="list-style-type:lower-alpha"> <li>Chinese</li> <li>Physics</li> </ol> </td> </tr> </table> </body> </html> <html> <body> <table border="1"> <tr> <td>XXXX</td> <td> <ol> <li>Monday</li> <li>Tuesday</li> </ol> </td> <td> YYYYY</td> </tr> <tr> <td> AA</td> <td> BBB</td> <td> CCCCC</td> </tr>

  10. 第八題 Create a web page that can be used to compute a student’s overall average for a course. Your page should prompt the user to enter his or her homework score, test 1 score, test 2 score, test 3 score, and test 4 score, and show the information on the screen as indicated below (Note that the number of tests and the number of homework should be stored in variables in your program): Homework score: 90 Test 1 score: 80 Test 2 score: 90 Test 3 score: 80 Test 4 score: 90 Number of homework: 1 Number of tests: 4

  11. 第八題(答案) Ans: <html> <body> <script type="text/javascript"> h=0,t=0; homework=prompt("Homework score",""); h=h+1; text1=prompt("text1",""); t=t+1; text2=prompt("text2",""); t=t+1; text3=prompt("text3",""); t=t+1; text4=prompt("text4",""); t=t+1;

  12. 第八題(答案) document.write("Homework score:"+homework+"<br />"); document.write("Text1 score: "+text1+"<br />"); document.write("Text2 score: "+text2+"<br />"); document.write("Text3 score: "+text3+"<br />"); document.write("Text4 score: "+text4+"<br />"); document.write("<hr />"); document.write("Number of homework: "+h+“<br />"); document.write("Number of tests: "+t); </script> </body> </html>

  13. 第九題 What does the following web page look like on the screen after execution (Suppose the user types in 37)? <html> <head><title> Compute Square </title></head> <body> <script type=”text/javascript”> Var = prompt(“Enter the input:”, “”); document.write(“<hr />”); document.write(“The double of the input is: “ + (Var + Var)); document.write(“<hr />”); </script> </body> </html>

  14. 第九題(答案) • Ans:

  15. 第十題 Please write a web page which will prompt the user to collect his/her information and show the following on the user’s screen: Hello xxx! How are you today? Your personal data are: bbbbName: xxx bbbbSex: ss bbbbAge: aa where xxx denotes the input for the user’s name, ss denotes the input for the user’s sex (Male or Female), and aa denotes the input for the user’s age. Note that bbbb indicates a space of four blanks.

  16. 第十題(答案) Ans: <html> <body> <script type="text/javascript"> name=prompt("What’s your name?",""); sex=prompt("What’s your sex?",""); age=prompt("What’s your age?",""); document.write("Hello "+name+"!"+" How are you today?"+"<br />"); document.write("Your personal data are: "+"<br/>"); document.write("&nbsp; &nbsp; &nbsp; &nbsp;Name: "+name+"<br />"); document.write("&nbsp; &nbsp; &nbsp; &nbsp;Sex: "+sex+"<br />"); document.write("&nbsp; &nbsp; &nbsp; &nbsp;Age: "+age+"<br />"); </script> </body> </html>

More Related