Introduction to Computers - 2 nd exam- 授課教授:李錫智. 1. Double the Number <input type="button" value="Double the number:" onclick=“ num = parseFloat(document.getElementById('numberBox').value);

Slides:



Advertisements
Similar presentations
Introduction to computers Exam 2 授課教授:李錫智. Question_1 For the following program: Suppose the user enters 43 、 57 in the text boxes numberBox1 and numberBox2,
Advertisements

Introduction to Computers - 3 rd exam- 授課教授:李錫智. 1.Consider the following program: Magic 8-ball function GetResponse()
FCU, Department of ECE, IC Design Research Lab. TEL: # 4945 Pre-SIm , Post-Sim.
布林代數的應用--- 全及項(最小項)和全或項(最大項)展開式
: A-Sequence 星級 : ★★☆☆☆ 題組: Online-judge.uva.es PROBLEM SET Volume CIX 題號: Problem D : A-Sequence 解題者:薛祖淵 解題日期: 2006 年 2 月 21 日 題意:一開始先輸入一個.
:Word Morphing ★★☆☆☆ 題組: Problem Set Archive with Online Judge 題號: 10508:word morphing 解題者:楊家豪 解題日期: 2006 年 5 月 21 日 題意: 第一行給你兩個正整數, 第一個代表下面會出現幾個字串,
1 Q10276: Hanoi Tower Troubles Again! 星級 : ★★★ 題組: Online-judge.uva.es PROBLEM SET Volume CII 題號: Q10276: Hanoi Tower Troubles Again! 解題者:薛祖淵 解題日期: 2006.
Section 1.2 Describing Distributions with Numbers 用數字描述分配.
Instructor: Ching-Chi Lin 林清池 助理教授
3Com Switch 4500 切VLAN教學.
如何將數字變成可用之資訊 現代化資料處理與應用概念. 如何將數字變成可用之資訊 人最容易接受的訊息是圖像化資訊。 在一堆數字中,要進行比較分析,一般會使用表格形 式計算與分析。 所以一般我們會將數字依關聯性, 轉換成表格計算與分析。 此表格一般稱試算表或稱表格。 再將結果轉換為圖表,進行比較與分析。
授課教授:李錫智 Data Structures -2 nd exam-. 1.[15] A simple way for implementing the vector ADT is to use an array A, where A[i] stores the element at rank.
指導教授:陳淑媛 學生:李宗叡 李卿輔.  利用下列三種方法 (Edge Detection 、 Local Binary Pattern 、 Structured Local Edge Pattern) 來判斷是否為場景變換,以方便使用者來 找出所要的片段。
1 Web of Science 利用指引 單元二 瀏覽與處理查詢結果. 2 瀏覽檢索結果 查出的結果,預設以時間排列, 使用者可改變結果的排列方式: 還可以依被引用次數、相關度、 第一作者、刊名、出版年等排序 回到前先查的結果畫面 點選想看資料的完整書目 本館訂購範圍的期刊 全文,便可直接連結.
: Boxes ★★★☆☆ 題組: Problem Set Archive with Online Judge 題號: 11003: Boxes 解題者:蔡欣燁 解題日期: 2007 年 3 月 19 日.
五小專案 黃詩晴 章乃云. 目錄 計算機 智慧盤 拼圖 記憶大挑戰 數學題庫 心得 參考文獻.
: Factstone Benchmark ★★☆☆☆ 題組: Problem Set Archive with Online Judge 題號: : Factstone Benchmark 解題者:鐘緯駿 解題日期: 2006 年 06 月 06 日 題意: 假設 1960.
Lecture 8 Median and Order Statistics. Median and Order Statistics2 Order Statistics 問題敘述 在 n 個元素中,找出其中第 i 小的元素。 i = 1 ,即為找最小值。 i = n ,即為找最大值。 i = 或 ,即為找中位數。
: OPENING DOORS ? 題組: Problem Set Archive with Online Judge 題號: 10606: OPENING DOORS 解題者:侯沛彣 解題日期: 2006 年 6 月 11 日 題意: - 某間學校有 N 個學生,每個學生都有自己的衣物櫃.
: ShellSort ★★☆☆☆ 題組: Problem D 題號: 10152: ShellSort 解題者:林一帆 解題日期: 2006 年 4 月 10 日 題意:烏龜王國的烏龜總是一隻一隻疊在一起。唯一改變烏龜位置 的方法為:一隻烏龜爬出他原來的位置,然後往上爬到最上方。給 你一堆烏龜原來排列的順序,以及我們想要的烏龜的排列順序,你.
: The Playboy Chimp ★★☆☆☆ 題組: Problem Set Archive with Online Judge 題號: 10611: The Playboy Chimp 解題者:蔡昇宇 解題日期: 2010 年 2 月 28 日 題意:給一已排序的數列 S( 升冪.
1 網路同步學習 如何使用中山大學管理學院知識管理平台 愷中 製作. 2 如何登入中山大學網路學習平台 1. 首先, 請輸入 2. 點選申請帳號, 依照螢幕所示, 輸入個人資訊.
長訊科技 EVRCOM Voice Mail System 使用者操作說明及流程. 自動總機 -- 來電語音轉接服務流程 ( 範例流程 )
Introduction to Java Programming Lecture 17 Abstract Classes & Interfaces.
24-6 設定開始與結束場景中的 程式 最後我們要替這個遊戲收個尾, 幫它把開始 的等待畫面跟結束畫面處理一下。
: The largest Clique ★★★★☆ 題組: Contest Archive with Online Judge 題號: 11324: The largest Clique 解題者:李重儀 解題日期: 2008 年 11 月 24 日 題意: 簡單來說,給你一個 directed.
計算機概論 - 排序 1 排序 (Sorting) 李明山 編撰 ※手動換頁.
圖層的操作與管理 圖層的作用就如同一張張透明的賽璐璐片, 你可以將動畫中的每項物件, 放置在不同圖 層中, 圖層交疊就形成完整的畫面。在各圖 層中的物件, 做任何的移動或變化, 都不會 相互干擾, 所以當你編輯一個物件時, 只要 在物件所在的圖層進行操作, 將可大幅降低 製作過程的複雜度與難度。
: Happy Number ★ ? 題組: Problem Set Archive with Online Judge 題號: 10591: Happy Number 解題者:陳瀅文 解題日期: 2006 年 6 月 6 日 題意:判斷一個正整數 N 是否為 Happy Number.
: Fast and Easy Data Compressor ★★☆☆☆ 題組: Problem Set Archive with Online Judge 題號: 10043: Fast and Easy Data Compressor 解題者:葉貫中 解題日期: 2007 年 3.
行政院國家科學委員會工程技術發展處自動化學門 * 試以國立成功大學製造工程研究所 鄭芳田教授 產學合作計畫 : 智慧預測保養系統之設計與實作 成果報告盤點為範例 國科會工程處專題計畫成果典藏 自動化學門成果報告盤點範例.
: Problem A : MiniMice ★★★★☆ 題組: Contest Archive with Online Judge 題號: 11411: Problem A : MiniMice 解題者:李重儀 解題日期: 2008 年 9 月 3 日 題意:簡單的說,題目中每一隻老鼠有一個編號.
: Ahoy, Pirates! ★★★★☆ 題組: Contest Archive with Online Judge 題號: 11402: Ahoy, Pirates! 解題者:李重儀 解題日期: 2008 年 8 月 26 日 題意:有一個海盜島有 N 個海盜,他們的編號 (id)
Distributed Video Coding. Outline Distributed video coding Lossless compression Lossy compression Low complexity video encoding Distributed image coding.
: Multisets and Sequences ★★★★☆ 題組: Problem Set Archive with Online Judge 題號: 11023: Multisets and Sequences 解題者:葉貫中 解題日期: 2007 年 4 月 24 日 題意:在這個題目中,我們要定義.
:Nuts for nuts..Nuts for nuts.. ★★★★☆ 題組: Problem Set Archive with Online Judge 題號: 10944:Nuts for nuts.. 解題者:楊家豪 解題日期: 2006 年 2 月 題意: 給定兩個正整數 x,y.
從此處輸入帳號密碼登入到管理頁面. 點選進到檔案管理 點選「上傳檔案」上傳資料 點選瀏覽選擇電腦裡的檔案 可選擇公開或不公開 為平台上的資料夾 此處為檔案分類,可顯示在展示頁面上,若要參加 MY EG 競賽,做品一律上傳到 “ 98 MY EG Contest ” 點選此處確定上傳檔案.
資料結構實習-一 參數傳遞.
6-2 認識元件庫與內建元件庫 Flash 的元件庫分兩種, 一種是每個動畫專 屬的元件庫 (Library) ;另一種則是內建元 件庫 (Common Libraries), 兩者皆可透過 『視窗』功能表來開啟, 以下即為您說明。
Deletion in MIN-MAX Heaps Delete min element Delete max element.
Lecture 7 Sorting in Linear Time. Sorting in Linear Time2 7.1 Lower bounds for sorting 本節探討排序所耗用的時間複雜度下限。 任何一個以比較為基礎排序的演算法,排序 n 個元 素時至少耗用 Ω(nlogn) 次比較。
Management Abstracts Retrieval System; MARS 檢索操作.
: Lucky Number ★★★★☆ 題組: Proble Set Archive with Online Judge 題號: 10909: Lucky Number 解題者:李育賢 解題日期: 2008 年 4 月 25 日 題意:給一個奇數數列 1,3,5,7,9,11,13,15…
JAVA 程式設計與資料結構 第二十章 Searching. Sequential Searching Sequential Searching 是最簡單的一種搜尋法,此演 算法可應用在 Array 或是 Linked List 此等資料結構。 Sequential Searching 的 worst-case.
資料結構實習-二.
演算法 8-1 最大數及最小數找法 8-2 排序 8-3 二元搜尋法.
: Ubiquitous Religions ★★☆☆☆ 題組: Problem Set Archive with Online Judge 題號: 10583: Ubiquitous Religions 解題者:吳佳樺 解題日期: 2010 年 3 月 18 日 題意: 一開始給予兩個數字.
: Expect the Expected ★★★★☆ 題組: Contest Archive with Online Judge 題號: 11427: Expect the Expected 解題者:李重儀 解題日期: 2008 年 9 月 21 日 題意:玩一種遊戲 (a game.
845: Gas Station Numbers ★★★ 題組: Problem Set Archive with Online Judge 題號: 845: Gas Station Numbers. 解題者:張維珊 解題日期: 2006 年 2 月 題意: 將輸入的數字,經過重新排列組合或旋轉數字,得到比原先的數字大,
Chapter 10 m-way 搜尋樹與B-Tree
: Function Overloading ★★★☆☆ 題組: Problem Set Archive with Online Judge 題號: 11032:Function Overloading 解題者:許智祺 解題日期: 2007 年 5 月 8 日 題意:判對輸入之數字是否為.
演算法課程 (Algorithms) 國立聯合大學 資訊管理學系 陳士杰老師 Course 7 貪婪法則 Greedy Approach.
ProblemH - Hyper Toy Soldiers 星級 : ??? 題組: Online-judge.uva.es PROBLEM SET Volume CIV 題號: Problem H - Hyper Toy Soldiers 解題者: 柯名澤 解題日期: 2006 年.
實驗四 4X4矩陣鍵盤實驗 4X4矩陣鍵盤輸入並輸出至七段式顯示器.
Probability Distribution 機率分配 汪群超 12/12. 目的:產生具均等分配的數值 (Data) ,並以 『直方圖』的功能計算出數值在不同範圍內出現 的頻率,及繪製數值的分配圖,以反應出該 機率分配的特性。
計算機概論 第6章 數位邏輯設計.
: Dream ★★★☆☆ 題組: Contest Archive with Online Judge 題號: 11414: Dream 解題者:李育賢 解題日期: 2008 年 9 月 2 日 題意: 題目會給你一個數字代表測資的數量 ( 最多 100 組 ) , 每組測資第一個數字是此圖形點的個數.
: Problem E Antimatter Ray Clearcutting ★★★★☆ 題組: Problem Set Archive with Online Judge 題號: 11008: Problem E Antimatter Ray Clearcutting 解題者:林王智瑞.
: Wine trading in Gergovia ★★☆☆☆ 題組: Contest Volumes with Online Judge 題號: 11054: Wine trading in Gergovia 解題者:劉洙愷 解題日期: 2008 年 2 月 29 日 題意:在 Gergovia.
:Commandos ★★★☆☆ 題組: Contest Archive with Online Judge 題號: 11463: Commandos 解題者:李重儀 解題日期: 2008 年 8 月 11 日 題意: 題目會給你一個敵營區內總共的建築物數,以及建築物 之間可以互通的路有哪些,並給你起點的建築物和終點.
: SAM I AM ★★★★☆ 題組: Contest Archive with Online Judge 題號: 11419: SAM I AM 解題者:李重儀 解題日期: 2008 年 9 月 11 日 題意: 簡單的說,就是一個長方形的廟裡面有敵人,然 後可以橫的方向開砲或縱向開砲,每次開砲可以.
:Count the Trees ★★★☆☆ 題組: Problem Set Archive with Online Judge 題號: 10007:Count the Trees 解題者:楊家豪 解題日期: 2006 年 3 月 題意: 給 n 個點, 每一個點有自己的 Label,
: Finding Paths in Grid ★★★★☆ 題組: Contest Archive with Online Judge 題號: 11486: Finding Paths in Grid 解題者:李重儀 解題日期: 2008 年 10 月 14 日 題意:給一個 7 個 column.
:Problem E.Stone Game ★★★☆☆ 題組: Problem Set Archive with Online Judge 題號: 10165: Problem E.Stone Game 解題者:李濟宇 解題日期: 2006 年 3 月 26 日 題意: Jack 與 Jim.
幼兒行為觀察與記錄 第八章 事件取樣法.
: How many 0's? ★★★☆☆ 題組: Problem Set Archive with Online Judge 題號: 11038: How many 0’s? 解題者:楊鵬宇 解題日期: 2007 年 5 月 15 日 題意:寫下題目給的 m 與 n(m
Failure Candidate Identification for Silicon Debug 指導教授 : 曾王道 學生 : 卜竹君 許正明.
Data Structures -3 rd test- 2015/06/01 授課教授:李錫智. Question 1 Suppose we use an array to implement a sorted list. Please answer the following questions.
Data Structures -3 st exam- 授課教師 : 李錫智 教授. 1. [5] Assume we have a binary tree which is implemented in a pointer-based scheme. Describe how to know the.
Data Structures -2 nd exam- 授課教師 : 李錫智 教授 1. 1.[10] Please answer the following questions about stack: What is the response of the statement “(new stack()).isEmpty()”?
Presentation transcript:

Introduction to Computers - 2 nd exam- 授課教授:李錫智

1. Double the Number <input type="button" value="Double the number:" onclick=“ num = parseFloat(document.getElementById('numberBox').value); document.getElementById('numberBox').value = 2 * num;" />

1.(a) If you click the button once, what is the displayed value? Ans: 4 (b) If you click the button twice, what is the displayed value? Ans: 8 (c) If you click the button n times, what is the displayed value? Ans: 2 n+1

2. Develop a web page with two buttons and two text boxes. One button, labeled by “get square”, enables the value entered from text box A to be squared and the result to be displayed in test box B. The other button, labeled by “get square root”, enables the value entered from text box B to be square-rooted and the result to be displayed in text box A. The size of each box is 4. No default values are associated with the boxes. (a) Show your program without using functions. (b) Show your program using two functions, one for each button. The function for the first button is named as getx2 and the function for the second button is named as getsqrt.

2. (a) Without using functions Ans: Test_2 <input type="button" value="get square" onclick="squ=document.getElementById('textbox_A').value; squ=parseFloat(squ); squ=squ*squ; document.getElementById('textbox_B').value=squ;"/>

<input type="button" value="get square root" onclick=“ squroot= document.getElementById('textbox_B').value; squroot=parseFloat(squroot); squroot=Math.sqrt(squroot); document.getElementById('textbox_A').value=squroot;"/>

2. (b) using two functions (getx2 、 getsqrt) Ans: Test_2 function getx2() { var squ; squ=document.getElementById('textbox_A').value; squ=parseFloat(squ); squ=squ*squ; document.getElementById('textbox_B').value=squ; }

function getsqrt() { var squroot; squroot=document.getElementById('textbox_B').value; squroot=parseFloat(squroot); squroot=Math.sqrt(squroot); document.getElementById('textbox_A').value=squroot; }

3. Swap Page function Swap() { temp = document.getElementById('box1').value; document.getElementById('box1').value= document.getElementById('box2').value; document.getElementById('box2').value = temp; }

<input type="button" value="Swap Contents" onclick="Swap();" />

3.(a) Please show the page on the screen before any user input. Ans: (b) What happens when the user hit the button after he/she enters 20 and 40, respectively, in text box1 and text box2? Ans:

4.Suppose that you are going to arrange the students in a class in sequence from youngest to oldest. You must organize a line that begins with the youngest person and continues in ascending order according to age. Describe an algorithm for completing this task. Ans: 1. 假設此 sequence 有 n 個 students 排成一排,編號由 1~n 2. 令 i=1 3. 先假定第 i 個 student 是最年輕的,往後比較出生年月 日,比第 i 個 student 年輕的便跟他交換位置,一直比 較到第 n 個 student ,則第 i 個位置就是最年輕的 student 4. i=i+1 ,如果 i=n 則結束,否則回到 (3)

5.Suppose that you are going to merge two sequences of numbers, sequence A and sequence B, into sequence C. Both sequence A and sequence B were sorted in ascending order. It is required that sequence C be also sorted in ascending order. Describe an algorithm for completing this task. Ans: 1.Sequence A 與 Sequence B 分別排成兩排,位置由 1 開始編號, i 用來表示 sequence A 的位置, j 表示 sequence B 的位置, k 表示 sequence C 的位置 ( 以 C[ k ] 代表 ) 2. 令 i=1 、 j=1 、 k=1 3. 比較 A 的第 i 個位置的值 ( 以 A[ i] 表示 ) 與 B 的第 j 個位置的值 ( 以 B[ j ] 表示 ) ,如果 A[ i ] ≦ B[ j ] ,則將 A[ i ] 放入 C[ k ] ,並執行 i=i+1 與 k=k+1 ,即往後移一個位置,同理如果 A[ i ]>B[ j ] ,則將 B[ j ] 放入 C[ k ] ,並執行 j=j+1 與 k=k+1 4. 重複 (3) ,直到 i 大於 sequence A 的最後一個位置,或是 j 大於 sequence B 的最後一個位置 5. 將另一個 sequence 剩餘的 number 直接複製到 C[ k ] 的後面

6. Picture Fun function ChangeImage(imgSource) { document.getElementById('faceImg').src = imgSource; } How do you feel today?

<input type="button" value="I feel happy" onclick="ChangeImage('happy.gif');" /> <input type="button" value="I feel sad" onclick="ChangeImage('sad.gif');" /> <input type="button" value="I feel sleepy" onclick="ChangeImage('sleepy.gif');" /> <input type="button" value="I feel angry" onclick="ChangeImage('angry.gif');" />

6.(a) What happens if the user hits the “I feel happy” button? Ans: 如果 happy.gif 存在的話,它會顯現在 下圖紅框的 部分,否則只會顯示 face image (b) What happens if the user hits the “I feel sleepy” button? Ans: 如果 sleepy.gif 存在的話,它會顯現在 下圖紅框的 部分,否則只會顯示 face image

7.Suppose you want to compute the function value f(x) = x 2 + 2x + 3. You write a web page for doing this. The value of x is entered via a text box named “box for x”. After the click of a button named “click for f(x)”, the value of x is retrieved from the text box, f(x) is computed, and the result is displayed in another text box named “box for f(x)”. It is required that a function call is used for the onclick part of the button, and the function should be named as funCalc. The size of each text box is 5 and their default value is 0. Please show your program.

Ans: Test_7 function funCalc() { temp=document.getElementById('box for x').value; temp=parseFloat(temp); result=temp*temp+2*temp+3; document.getElementById('box for f(x)').value=result; }

<input type="button" value="click for f(x)" onclick="funCalc()"/>