NTU-Exam 板


LINE

課程名稱︰計算機程式 課程性質︰化工系必修 課程教師︰徐振哲 開課學院:工學院 開課系所︰化工系 考試日期(年月日)︰2019/11/28 考試時限(分鐘):忘了 試題 : Problem 1 (15 points): Make the following array of plots: ┌─────────────────────────┐ │Create the following function: │ │z=x*sin(x)exp(-y^2) │ │use 3D surface plot with contour, plot the above │ │function between x=0~2pi and y=-2~2 │ ├─────────────────────────┤ │Plot the following points with black circles and │ │y=x^2 with a red solid line for x=0~5 │ │┌──┬──┬──┬──┬──┬──┐ │ ││ x │ 0 │ 1 │ 2 │ 3 │ 4 │ │ │├──┼──┼──┼──┼──┼──┤ │ ││ y │ 1 │2.5 │ 4 │9.5 │ 17 │ │ │└──┴──┴──┴──┴──┴──┘ │ ├─────────────────────────┤ │plot y=x^3*exp(x) and y=x*exp(x) on the same plot │ │using solid and dashed lines, respectively, │ │between -1 and 3. │ └─────────────────────────┘ Problem 2 (15 points): Do the following in ONE*.m file and function file and properly display results: (i) (5 points) Ask the user to input a positive integer "m". Find and display minimum "n" such that 1*2*3+2*3*4+3*4*5+...+n*(n+1)*(n+2)>m. (ii) (5 points) Solve the following equation sets: x+3y-z=3 2x-3y+3z=4 y+z=5 (iii) (5 points) Create the following function, and then plot for x=-1~5 y=|x| for x<1 y=exp(x)*sin(x) for 1<=x<3 y=log(x) for x>=3 Problem 3 (20 points): Do the following using ONE*.m file: (i) (10 points) Ask the user to input a positive even integer "n" greater than 2, if the input number is not a positive even integer, display "Invalid input", then ask the user to input it again for up to THREE TIMES. For the fourth wrong input, display "bye-bye" then exit the code. (ii) (10 points) Find show the pair of a and b, such that a and b are both prime numbers and a+b=n. Problem 4 (20 points): Fibonacci series is a series starts from a1=0 and a2=1, and each term equals the sum of the previous two terms, a_n+2_ = a_n+1_ + a_n_ such that the a1~a7 are 0,1,1,2,3,5,8, respectively. Answer the following questions (You are NOT allowed to use functions related to Fibonacci): (以底線表示下標) (i) (10 points) Ask the user to input a positive integer m, and display a_m_. (ii) (10 points) Plot the ratio of a_n+1_/a_n_ vs. n for n=1~200. Also draw a horizontal line for y=(1+sqrt5)/2. (Note: a_n+1_/a_n_ approaches (1+sqrt5)/2 when n approaches infinite) Problem 5 (15 points): In ONE*.m file, use the following methods to find and properly display approximated pi: pi_1, pi_2, pi_3 (i) (5 points) pi_1: Calculate the approximate area of the following curve: y=sqrt(1-x^2) between 0and 1 with n=150. You may use either A or B. https://i.imgur.com/Mvl0ANI.jpg (ii) (5 points) Create two arrays AA and BB, each has 1500 elements of random number between -1 and 1. C=AA.^2+BB.^2. Use "mask" to calculate the fraction of elements in C that are less than 1. Use this fraction to calculate pi_2. (iii) (5 points) Use 20 terms approximation to calculate approximated pi: pi_3 (you are NOT allowed to type in terms manually.) π 1 1 1 1 ─ = 1 - ─ + ─ - ─ + ─ ...... 4 3 5 7 9 Problem 6 (10 points): Use "rand" to generate a random positive integer N below 99999, then create a 1*M array AA with 0, 1, and 2, where AA represent N as a ternary number (三進位數). For example, N=5, AA=[1 2]; N=24, AA=[2 2 0]. Properly display AA and N (not necessarily to be in the same line.) Note: You are NOT allwed to use ANY Matlab functions for conversion between binary, decimal, and hexadecimal numbers such as "bi2de", "bin2dec", "dec2bin", "dec2hex", or "de2bi". Problem 7 (5 points, Answer on THIS exam sheet): Write down your comments and suggestionsto this course (for example: course, lecturer, exams, and teaching assistant.) --
1F:→ CaCO2: 這樣未來澳洲打工度假根本撈不到錢啊 07/12 12:44
2F:推 f19890230: 這樣說也沒錯,認同鈣二氧化碳大大 07/12 12:44
3F:→ CaCO2: 那個,我是碳酸鈣啦ww 07/12 12:45
4F:→ f19890230: 碳酸鈣是CaCO3喔 07/12 12:45
5F:→ CaCO2: ...所以我是鈣二氧化碳Orz 07/12 12:45
6F:推 BadNose: 樓上文組 07/12 12:45
--



※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.112.236.34 (臺灣)
※ 文章網址: https://webptt.com/m.aspx?n=bbs/NTU-Exam/M.1584940010.A.2EA.html ※ 編輯: installbtien (140.112.236.34 臺灣), 03/23/2020 13:07:13
7F:推 heypostcard : 老師不是不發回題目嗎 你怎麼全背的XDD 04/07 19:18
8F:→ installbtien: 原來樓上跟我同一個班 他發回來給我們看的時後我有 04/07 23:19
9F:→ installbtien: 拍起來 04/07 23:19







like.gif 您可能會有興趣的文章
icon.png[問題/行為] 貓晚上進房間會不會有憋尿問題
icon.pngRe: [閒聊] 選了錯誤的女孩成為魔法少女 XDDDDDDDDDD
icon.png[正妹] 瑞典 一張
icon.png[心得] EMS高領長版毛衣.墨小樓MC1002
icon.png[分享] 丹龍隔熱紙GE55+33+22
icon.png[問題] 清洗洗衣機
icon.png[尋物] 窗台下的空間
icon.png[閒聊] 双極の女神1 木魔爵
icon.png[售車] 新竹 1997 march 1297cc 白色 四門
icon.png[討論] 能從照片感受到攝影者心情嗎
icon.png[狂賀] 賀賀賀賀 賀!島村卯月!總選舉NO.1
icon.png[難過] 羨慕白皮膚的女生
icon.png閱讀文章
icon.png[黑特]
icon.png[問題] SBK S1安裝於安全帽位置
icon.png[分享] 舊woo100絕版開箱!!
icon.pngRe: [無言] 關於小包衛生紙
icon.png[開箱] E5-2683V3 RX480Strix 快睿C1 簡單測試
icon.png[心得] 蒼の海賊龍 地獄 執行者16PT
icon.png[售車] 1999年Virage iO 1.8EXi
icon.png[心得] 挑戰33 LV10 獅子座pt solo
icon.png[閒聊] 手把手教你不被桶之新手主購教學
icon.png[分享] Civic Type R 量產版官方照無預警流出
icon.png[售車] Golf 4 2.0 銀色 自排
icon.png[出售] Graco提籃汽座(有底座)2000元誠可議
icon.png[問題] 請問補牙材質掉了還能再補嗎?(台中半年內
icon.png[問題] 44th 單曲 生寫竟然都給重複的啊啊!
icon.png[心得] 華南紅卡/icash 核卡
icon.png[問題] 拔牙矯正這樣正常嗎
icon.png[贈送] 老莫高業 初業 102年版
icon.png[情報] 三大行動支付 本季掀戰火
icon.png[寶寶] 博客來Amos水蠟筆5/1特價五折
icon.pngRe: [心得] 新鮮人一些面試分享
icon.png[心得] 蒼の海賊龍 地獄 麒麟25PT
icon.pngRe: [閒聊] (君の名は。雷慎入) 君名二創漫畫翻譯
icon.pngRe: [閒聊] OGN中場影片:失蹤人口局 (英文字幕)
icon.png[問題] 台灣大哥大4G訊號差
icon.png[出售] [全國]全新千尋侘草LED燈, 水草

請輸入看板名稱,例如:BuyTogether 或 站內搜尋

TOP