Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

習題 5 -- 請完成下列 JavaScript 習題 #19

Open
ccckmit opened this issue Apr 15, 2022 · 36 comments
Open

習題 5 -- 請完成下列 JavaScript 習題 #19

ccckmit opened this issue Apr 15, 2022 · 36 comments

Comments

@ccckmit
Copy link
Contributor

ccckmit commented Apr 15, 2022

  1. 請寫一個程式印出九九乘法表。
  2. 請寫一個函數計算 n! ,例如 10! 就是 10*9*8*....*1
  3. 請寫一個函數檢查某數是否為質數?
    • 範例: isPrime(17) => true
    • 範例: isPrime(21) => false
  4. 請將 a 到 b 之間無法被 3, 5, 7 整除的數字放到陣列中?
    • 範例: filter357(5,10) = [8]
    • 範例: filter357(5,15) = [8,11,13]
  5. 請算出某陣列的平均值?
    • 範例: mean([1,2,3,4,5]) => 3
  6. 寫一個程式做因數分解。
    • 範例:factor(45) => [3, 3, 5]
  7. 寫一個程式把矩陣轉置。
    • 範例:transpose([[1,2,3], [3,2,1]]) => [[1,3], [2,2], [3,1]]
  8. 請寫一個函數計算兩矩陣相加?
    • 範例: add([[1,2],[3,4]], [[1,1],[1,1]]) => [[2,3], [4,5]]
  9. 請用遞迴寫一個函數印出費氏數列的第 n 個
  10. (函數參數 callback) 請寫一個函數可以做任意函數的定積分
    • 範例: integral((x)=>x*x, 0, 1) => 0.333...
  11. (物件導向) 請寫一個有理數物件,包含 toString() 函數
    • 範例: var r1 = new Ratio(1,3); console.log(r1.toString()); 會印出 1/3
  12. (物件導向) 請擴充上一題,加入 add, sub 兩個函數
    • 範例: var r1 = new Ratio(1,3), r2 = new Ratio(2,4); var r3 = r1.add(r2); console.log(r3.toString()); 會印出 10/12
  13. (物件導向) 請擴充上一題,加入 mul, div 兩個函數
    • 範例: var r1 = new Ratio(1,3), r2 = new Ratio(2,4); var r3 = r1.mul(r2); console.log(r3.toString()); 會印出 2/12
  14. (物件導向) 請擴充上一題,加入 reduce 函數 (約分)
    • 範例: var r1 = new Ratio(6,9); console.log(r1.toString()); 會印出 2/3
@LeeYi-user
Copy link

@weixiang0470
Copy link

黃偉祥 111010550
Homework5_JavaScript

@victor881212
Copy link

@dallas145
Copy link

@123456789203
Copy link

@linWeiX
Copy link

linWeiX commented May 6, 2022

林維新 111010506
https://github.com/linWeiX/wp110b/tree/master/hwk

@weichen11011
Copy link

顏瑋成 111010529
https://github.com/weichen11011/wp110b/tree/master/hw5

@siyu0927
Copy link

@markerpen92
Copy link

markerpen92 commented May 23, 2022

@RogerChen530
Copy link

@jiajianong
Copy link

@Bojun6667
Copy link

111010520 黃柏鈞
https://github.com/Bojun6667/wp110b/tree/master/js/H5

@peiyun328
Copy link

@byby9527
Copy link

@jackuio440
Copy link

@Ellinaa
Copy link

Ellinaa commented Jun 11, 2022

110910558陳玟卉

@yagmai0409
Copy link

111010562 陳俊呈
https://github.com/yagmai0409/wp110b/tree/master/HW/JS

@Jung217
Copy link

Jung217 commented Jun 12, 2022

111010501簡志融
Code

@leeeeeeeeeeeeeeeeeeeeeee

@samue02l
Copy link

@weilunh7
Copy link

111010514 黃威綸
https://github.com/weilunh7/wp110b/tree/master/HW5

@KimLinTW
Copy link

@Chieh0622
Copy link

111010515 林弘杰
code

@yuzi0521
Copy link

@wei-annn
Copy link

110910504趙唯安
https://github.com/wei-annn/wp110b/wiki/hw.md

@WeiXiao0511
Copy link

@samlin911227
Copy link

111010533 林達城
code

@st950344
Copy link

111010565黃品慈
程式碼:https://github.com/st950344/wp110b/tree/master/homework/html/HW5

@rossen1020
Copy link

@dd24336048
Copy link

@MitanEXE
Copy link

@nelson023
Copy link

@Tzuan1020
Copy link

111010517 蘇子安
https://github.com/Tzuan1020/wp110b/tree/master/hw5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests