[轉錄][試題] 97上 諶玉真 計算機程式 期末考

看板NTUCHE-02-HW作者 (妳的美,我不配)時間14年前 (2010/01/03 23:01), 編輯推噓2(201)
留言3則, 3人參與, 最新討論串1/1
※ [本文轉錄自 NTU-Exam 看板] 作者: k0185123 (Ethan) 看板: NTU-Exam 標題: [試題] 97上 諶玉真 計算機程式 期末考 時間: Fri Jan 9 14:11:11 2009 課程名稱︰計算機程式 課程性質︰大一化工選修 課程教師︰諶玉真 開課學院:工學院 開課系所︰化工 考試日期(年月日)︰2009/1/8 考試時限(分鐘):2hrs 是否需發放獎勵金:是 (如未明確表示,則不予發放) 試題 : 1.Write a subroutine UCASE that properly converts every name to uppercase regardless of collating sequence. Print out the names(in uppercase), grades and the letter grades in alphabetic order of the names. The names and the grades of the students are Sally White 75.0 Johnny Wang 85.0 Billy Smith 62.0 Simon Tsao 97.0 June Brown 46.0 Mary Johnson 12.0 Sean Koch 78.0 Don Recht 92.0 90 - 100 A 80 - 89 B 70 - 79 C 60 - 69 D 0 - 59 E 2.There are eight students playing card games. Two sets of cards are used. Please shuffle these 104 cards. Note that these two sets of cards should not be rearranged separately. <Spade Heart Diamond Club> 3.In a group of n people, what is the probability that two or more of them have the same birthday? It is possible to determine the answer to this question by simulation. Write a function PROBABILITY that calculates the probability that two or more of n people will have the same birthday, where n is a calling argument. The function should create an array of size n and generate n birthdays in the range 1 to 365 randomly. It should then check to see if any of the n birthdays are identical. The function should perform this experiment at least 5000times and calculate the fraction of those times in which two or more people had the same birthday. 4.A point in a rank-2 array is said to be a relative maximum if it is higher than any of the eight points surrounding it. For example, the element at position (2,2) in the following array is a relative maximum, since it is larger than any of the surrounding points. 11 7 -2 0 0 0 -7 14 3 ==> 0 1 0 2 -3 5 0 0 0 Find all the position of the relative maxima of the following 8x8 array by using your own internal subroutine MYFINDPICK. The result should dislay like the format shown in the upper matrix. The program should only consider interior points within the matrix, since any point along an edge of the matrix cannot be completely surrounded by points lower than itself. 2 -1 -2 1 3 -5 2 1 -2 0 -2.5 5 -2 2 1 0 -3 -3 -3 3 0 0 -1 -2 -4.5 4 -7 6 1 -3 0 5 -3.5 4 -7 6 1 -3 0 5 -9 -6 -5 -3 1 2 0 0.5 -7 -4 -5 -3 2 4 3 -1 -6 -5 -5 -2 0 1 2 5 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.112.240.149 ※ 編輯: k0185123 來自: 140.112.240.149 (01/09 14:11) ※ 編輯: k0185123 來自: 140.112.240.149 (01/09 16:30) -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 58.114.200.172

01/04 18:08, , 1F
感謝推~!
01/04 18:08, 1F

01/07 11:23, , 2F
THX
01/07 11:23, 2F

01/12 21:12, , 3F
是喔,原來有考古題阿...那這次就不公布解答了
01/12 21:12, 3F
文章代碼(AID): #1BGB5NdL (NTUCHE-02-HW)