---
# System prepended metadata

title: "\U0001F3C5 5/4(三) 每日 JS 刷題任務 - 數字處理"
tags: [公益程式體驗營 - 2022]

---

---
tags: 公益程式體驗營 - 2022
---

# 🏅 5/4(三) 每日 JS 刷題任務 - 數字處理
## 提示
1. [JavaScript 數字方法](https://www.w3school.com.cn/js/js_number_methods.asp)

### 題目一：平方計算
``` =JavaScript
// input 輸入
square(3)
square(9)
square(20)
// output 輸出
9
81
400
```
### 題目二：數學邏輯題
``` =JavaScript
// input 輸入
calculate(5,7,3)
calculate(9,8,7)
calculate(5,2,0)
calculate(9,9,33)

// output 輸出
9
10
7
-15
```

### 題目三：四捨五入題
``` =JavaScript
// input 輸入
rounding(3.9988)
rounding(3984.222)
rounding(77.777)

// output 輸出
4.00
3984.22
77.78
```

### 題目四：字串轉數字

``` =JavaScript
// input 輸入
parseNumber("2.33")
parseNumber("Hello!!")
parseNumber("30000")

// output 輸出
2.33
NaN
30000
```

### 題目五：被二整除
:::spoiler  #### 提示
 可以用 % 取餘數
:::
``` =JavaScript
// input 輸入
divisible(2)
divisible(3)
divisible(77)
divisible(88)

// output 輸出
0
1
1
0
```


## 回報流程

1. 將答案貼在 Codepen 並複製 Codepen 連結貼至「回報區」回報
（也可以將答案直接貼至「回報區」）

![](https://i.imgur.com/vftL5i0.png)

<!-- 解答：  -->


回報區
---

<!-- 0. Bingbingboom（回報範例，請使用註解回報）
答案：（可直接撰寫答案）
Codepen：https://codepen.io/Bingbingboom/pen/jOBZVWq
-->


<!-- 1. 洧杰
答案：（可直接撰寫答案）
Codepen：https://codepen.io/hexschool/pen/wvyvQqZ?editors=0011
-->

<!-- 2. Wendy
答案：
Codepen：https://codepen.io/wendy03/pen/dydywxy
-->

<!-- 3. KuoMin
答案：
Codepen：https://codepen.io/KuoMin/pen/vYdYMGM
-->

<!-- 4. Bruno Yu
答案：
Codepen：https://codepen.io/bruno-yu/pen/ZErEwbq?editors=0010
-->

<!-- 5. Rex Chu
答案：
Codepen：https://codepen.io/rex_chu/pen/WNMvbOQ
-->

<!-- 6. Alphacostankion#8475
答案：
codepen: https://codepen.io/alphapolo/pen/eYVNmvW
-->

<!-- 7. Art
答案：
codepen: https://codepen.io/ss97202tw/pen/rNJVaGz?editors=0011
-->

<!-- 8. Josh Chen#4552
答案：
codepen: https://codepen.io/hiphop825/pen/KKQpwoN?editors=0010
-->

<!-- 9. Gimmy#6354
答案 CodePen：
https://codepen.io/TingKan/pen/gOvpbzY
 -->
 
 <!-- 10. bonnieli1414#4906
答案 CodePen：
https://codepen.io/bonnieli1414/pen/abqOzaK
 -->
 
  <!-- 11. Lemon
答案 CodePen：
https://codepen.io/shumhoyin/pen/MWQwYLE
 -->
 
<!-- 12.IreneLee
答案 CodePen:
https://codepen.io/ntjtcxpt-the-animator/pen/zYRGGrm?editors=0012
-->

<!-- 13. CloThEs
答案：
Codepen：https://codepen.io/bogwdnxx-the-sans/pen/bGLddBW
-->

<!-- 14.Martin
答案 CodePen:
https://codepen.io/chihsuanbjjh/pen/RwQPPVr?editors=1111
-->

<!-- 15. yunyun
CodePen:
https://codepen.io/yun_yunni/pen/ExQjjmr
-->

<!-- 16. pipi#0852
CodePen:
https://codepen.io/pipiyy13/pen/eYVNNWL
-->

<!-- 17. Jia-Hong Chen#3863
CodePen:
https://codepen.io/iloveleon19/pen/NWyqqRg?editors=0010
-->

<!-- 18. rejennylo
CodePen:
https://codepen.io/reJennylo/pen/RwQPPxR
-->

<!-- 19. su#7798
https://codepen.io/wc-su/pen/RwQPPgr
-->

<!-- 20  color color#4378
CodePen:https://codepen.io/color0602/pen/LYQVVzP?editors=1111
-->

<!-- 21 Patti Chiu Patti#7774
CodePen:
https://codepen.io/peiru-qiu/pen/MWQwwyV?editors=0011
-->

<!-- 22 shijia https://codepen.io/shijia22/pen/vYdOOJL?editors=0011 -->

<!-- 23 小鹿Kerwin#5730 https://codepen.io/tkoleo84119/pen/vYdOOzX?editors=0012 -->

<!-- 24. Mylène
Codepen：https://codepen.io/hamajibashi/pen/PoQqqEp
-->

<!-- 25. Noy
https://codepen.io/MochiCodingPen/pen/RwQPPvK
-->

<!-- 26. shujhen#7734
Codepen：https://codepen.io/shujhen/pen/zYRGGMV
-->

<!-- 27. Leo Song
Codepen : https://codepen.io/sunnylaba/pen/gOvppVG?editors=0010
-->

<!-- 28. JustinLiu
Codepen: https://codepen.io/justin0227/pen/vYdOOox?editors=0010
-->

<!-- 29. hw#0715
Codepen: https://codepen.io/Lhwei/pen/xxYGGWv
-->

<!-- 30. 隔壁小王
Codepen: 
https://codepen.io/stevetanus/pen/jOZPbOe
-->

<!-- 31. Peng
https://codepen.io/peng-027/pen/RwQPPBG?editors=0010
 -->
 
 <!-- 32. BeanHuang
https://codepen.io/Beanhuang/pen/KKQpdVJ?editors=0011
 -->

<!-- 33. Murmurline#6969
答案：
```=
function square(num){
  console.log (num * num);
}
square(3);
square(9);
square(20);

function calculate(num1, num2, num3){
  console.log (num1 + num2 - num3);
}
calculate(5,7,3)
calculate(9,8,7)
calculate(5,2,0)
calculate(9,9,33)

function rounding(num){
  var floor = Math.round(num * 100) / 100;
  var decimals = floor.toFixed(2);
  console.log (decimals);
}
rounding(3.9988);
rounding(3984.222);
rounding(77.777);

function parseNumber(str){
  console.log(Number(str));
}
parseNumber("2.33");
parseNumber("Hello!!");
parseNumber("30000");

function parseNumber(str){
  console.log(Number(str));
}
parseNumber("2.33");
parseNumber("Hello!!");
parseNumber("30000");

function divisible(num){ 
  console.log(Math.floor(num%2));
}
divisible(2);
divisible(3);
divisible(77);
divisible(88);
```
Codepen：https://codepen.io/murmurline/pen/MWQwaeM
 -->
 
<!-- 34. Chi
Codepen: https://codepen.io/YoChi84/pen/ZErGbOg
  -->

<!-- 35. Jim
Codepen: https://codepen.io/jim255060/pen/bGLdVxZ
  -->
  
<!-- 36. ChaoChao
Codepen: https://codepen.io/EmiiilyJ/pen/OJQVyaa
  -->
  
  
  <!-- 37. Greta
Codepen: https://codepen.io/gretali/pen/GRQJpVw
  -->
  <!-- 38. Aaron 
Codepen: https://codepen.io/narrowd4c/pen/GRQJoJP-->

<!--  39. Eric.S
Codepen:
https://codepen.io/Eric_Shen/pen/oNEXjOp
-->

<!-- 40. Tuhacrt#0008
Codepen:
https://codepen.io/Tuhacrt/pen/dydoGNj
-->

<!-- 41. Jasn Chen
Codepen:
https://codepen.io/jason60810/pen/ZErGQGp
-->

<!-- 42. _伊凡Evan 
codepen:https://codepen.io/Evan_9837/pen/ZErGQwa
-->

<!-- 43. danny123
  codepen: https://codepen.io/binlandz123/pen/eYVNJKG?editors=0010
-->

<!-- 44. choo
  codepen: https://codepen.io/chooku/pen/WNMvrmo?editors=0012
-->

<!-- 45. Knn#0492
  codepen: https://codepen.io/Knn_84/pen/eYVNZEP
-->

<!-- 46.  Xiang#5313
  codepen: https://codepen.io/snorlaxxu/pen/RwQPavK
-->
<!-- 47.  Vader_yen維德#6563
  codepen: https://codepen.io/Vaderyen/pen/zYRGqXg?editors=0011
-->

<!-- 48.  andersonshen#4675
  codepen: https://codepen.io/luxyenni-the-bold/pen/poaJyOZ
-->

<!-- 49.  JessieCho
  codepen: https://codepen.io/jessieCho/pen/YzeXWwZ
-->

<!-- 50.  Cheng-Yu
  codepen: https://codepen.io/ball77111/pen/YzeXWNQ?editors=0011
-->

<!-- 51. SASIMI #5099
Codepen:
https://codepen.io/sashimi1327/pen/JjpdKRX
-->

<!-- 52. 楓之聲#6945
Codepen:
https://codepen.io/sshane258/pen/vYdOKrd 
-->

<!-- 53. 安安你好你是誰#7416
Codepen:
https://codepen.io/leave3310-the-looper/pen/oNEXzpP
-->

<!-- 54. lyle#8123
Codepen:
https://codepen.io/tomys/pen/ZErGpNv
-->

<!-- 54.deveryone#8090
Codepen:
https://codepen.io/raycheng/pen/PoQqbpG
-->

<!-- 55. Mojito#6002
 codepen: https://codepen.io/vu3xk41997/pen/NWyqbQM
-->

<!-- 56. Jenniya#7490 
codepen:
https://codepen.io/nopjb43u7bskq8x/pen/MWQwJmM?editors=0011
-->

<!-- 57. 湯米#7945 
codepen:
https://codepen.io/Tommy310/pen/PoQqWoO?editors=0012
-->

<!-- 58. 𝔼.𝕎#4742
codepen:
https://codepen.io/kidult316/pen/bGLdqVX
-->

<!-- 59.Lian Chen
codepen:
https://codepen.io/CCL1007/pen/gOvpWBm?editors=1111 -->

<!-- 59.鉦勝 #8333
codepen:
https://codepen.io/atckmax823/pen/MWQwmGq?editors=1011 -->

<!-- 60.Lam#0344
codepen:https://codepen.io/manshun-lam/pen/oNEXwvx -->

<!-- 61.Arista
codepen:
https://codepen.io/arista-hsieh/pen/KKQpmJB -->

<!-- 62.Bear Wang
codepen:
https://codepen.io/adaibear/pen/YzeXPYB -->

<!-- 63.Morris
codepen:
https://codepen.io/morrisss/pen/JjpdJdY?editors=1111 -->

<!-- 64.Vito#7797
https://codepen.io/Vito_Yang/pen/yLvNbRx?editors=0012
-->

<!-- 65.DoubleZ#2361
https://codepen.io/lazywyatt/pen/RwQPgMx
-->

<!-- 66.一隻阿貓#2726
https://codepen.io/chenchaoyen/pen/VwQLWPp
-->

<!-- 67. Tao Doris #5230
答案：
Codepen：https://codepen.io/peetaoting/pen/VwQLYdg
-->

<!-- 68. Triple
 https://codepen.io/riku30/pen/MWQwmgO -->
 
<!-- 69. Lina Chen
https://codepen.io/LinaChen/pen/KKQpXPq
-->

<!-- 70. Charlotte Lee
https://codepen.io/charlotte-lee/pen/GRQJMKg?editors=0012
-->

<!-- 71. Stanley#3825
https://codepen.io/sean_1215/pen/ExQjwmG?editors=1111
-->

<!-- 72. 米金#1399 
https://codepen.io/ihrowjtq-the-vuer/pen/dydoZpO?editors=0011
-->

<!-- 73. Chaco#2993
https://codepen.io/chaco-wang/pen/RwQPjqM?editors=0012 
-->

<!-- 74. 白狐
Codepen：https://codepen.io/baihu7851/pen/GRQJOzB
-->

<!-- 75. Vera#5592
Codepen：https://codepen.io/skvera/pen/yLvNPPd?editors=0010
-->
<!-- 76 qtrp#5635
codepen:
https://codepen.io/alicewu1991/pen/rNJVpbp?editors=0011
-->

<!--77. bakiii#2652
https://codepen.io/aki168/pen/rNJVJyr?editors=0011
-->

<!-- 78. AllenLi#6756
codepen:https://codepen.io/knsybndf-the-animator/pen/dydoZVW -->

<!-- 79. Cheng#3012
codepen:https://codepen.io/XiBinCheng/pen/poaJaxK?editors=1112
-->

<!-- 80. Easton#3863
codepen:https://codepen.io/EastonIsCodingNow/pen/MWQwPNz
-->

<!-- 81. Sweet
codepen:https://codepen.io/Pei-Ying/pen/MWQwzOM?editors=1011
-->

<!-- 82. Stella/UIUX/台北#7394
codepen:https://codepen.io/ting-juan-huang/pen/MWQwzdY?editors=1111
-->

<!-- 83. yuyu#6310
codepen:https://codepen.io/yuyu0905/pen/qBxdLOP
-->
<!-- 84. 翁來
codepen:https://codepen.io/wguo8320/pen/XWZbGEb
-->

<!-- 85. zzuhann #2786
codepen: https://codepen.io/zzuhann/pen/gOvpyRE
-->

<!-- 86. Roceil #5501
codepen: https://codepen.io/Roceil/pen/RwQPOqO?editors=1111
-->

<!-- 87.
 codepen: Joyce#3790
https://codepen.io/joycehuang/pen/abqOmga
-->

<!-- 88.
 codepen: Ryan Lu
https://codepen.io/ryanlu1125/pen/VwQvYdE?editors=0012
-->

<!-- 89. 炎炎#0777 
codepen: https://codepen.io/kimyen260/pen/vYdOwOq?editors=1011
-->

<!-- 90. Vivi#5766
codepen:
https://codepen.io/hyxfish27/pen/qBxdyPa
-->

<!-- 91.Tsuei#9284
https://codepen.io/AlbertoLL/pen/xxYwVQN?editors=0011
-->

<!-- 92.教練#6451
https://codepen.io/monkeybear721/pen/bGLVEBy
-->

<!-- 93.小不點#1793
https://codepen.io/fwmfmgkx-the-flexboxer/pen/GRQpqjE?editors=1112
-->

<!-- 94.hsiuhsiu#7412
https://codepen.io/hsiuhsiu/pen/XWZmaKj?editors=1010
-->

<!-- 95.Katie
https://codepen.io/Katie24/pen/bGLVrJd?editors=0011
-->

<!-- 96. Yuhung#1391
codepen: https://codepen.io/Yu__hung/pen/GRQpQOJ
-->


<!-- 97. Abel
codepen: https://codepen.io/lun_chi/pen/abqvKZK?editors=0010
-->

<!-- 98. 肉桂卷#0625
codepen: https://codepen.io/ginnlee/pen/abqOLYx?editors=0011
-->

<!-- 99. WilliamChou#7375
codepen: https://codepen.io/williampo78/pen/NWyGepV
-->

<!-- 100. sheep#4352
codepen: https://codepen.io/chingyeeee/pen/vYdLYMJ?editors=0010
-->

<!-- 101. Sussu#4211
codepen:
https://codepen.io/yatiti84/pen/dydGNbb?editors=1111
-->

<!-- 102. 靜宜#6866
codepen:（可直接撰寫答案）
https://codepen.io/jamie18/pen/LYQGWRy
-->

<!-- 103. JumpBow#8940
codepen:
https://codepen.io/jump-bow/pen/jOZWByo
-->

<!-- 104. will0708#7730
https://codepen.io/ncrdpepc-the-lessful/pen/KKQVmBq?editors=0010
-->


<!-- 105. Bao#4997
https://codepen.io/baoh/pen/xxYGxxw?editors=0011
-->

<!-- 106. karakamin#3416
Codepen: https://codepen.io/pen/?editors=0011 
-->

<!-- 107. RayChen#6088
https://codepen.io/raychen1996/pen/GRQodoQ
-->

<!-- 108. Jie Du
Codepen: https://codepen.io/qgqonost-the-flexboxer/pen/ZErQGKX?editors=0011
-->

<!-- 109. Amberhh#2465
Codepen: https://codepen.io/Amberhh/pen/gOvrYVa?editors=0011
-->

<!-- 110. mei#8421
Codepen: https://codepen.io/Shila-Chen/pen/LYQNRpZ
-->

<!-- 111. Pearlie#3536
 Codepen: https://codepen.io/PPcode/pen/JjpXbLZ
-->
<!-- 111. han#9347
 Codepen: https://codepen.io/qnrxylcw-the-reactor/pen/JjpXvyK
-->

<!-- 112. Becky#1461
 Codepen:
https://codepen.io/bearbecky/pen/GRQZbLr?editors=1111
-->


<!-- 113. littlesun#9469
 Codepen:
https://codepen.io/littlesun10111/pen/wvyWwVK
-->


<!-- 115. 101010#8077
 Codepen: https://codepen.io/im1010ioio/pen/JjpXgPj?editors=0012
-->

<!-- 116. EllieLo#9809
 Codepen: https://codepen.io/ellie-lo/pen/qBxNdYo?editors=0111
-->

<!-- 117. Jill#5577
Repl.it: https://replit.com/@Jillkate/Hex-daliy-22-05-04#index.js 
-->

<!-- 118. cyndi#8308
codepen: https://codepen.io/swi963/pen/MWQyXWa
-->

<!-- 119. Wilson#8687
codepen: https://codepen.io/foolwilson/pen/QWQEVBJ
-->

<!-- 119. Susan8402#5854
codepen: https://codepen.io/Susan8402/pen/yLvaOVB
-->

<!-- 120. Kiwi#9804
codepen: https://codepen.io/kiwi1113/pen/NWyRJbq
-->

<!-- 121. YANSzero#5436
codepen: https://codepen.io/yanszero/pen/mdXOgOy
-->

<!-- 122. Chaoci#2460
codepen:https://codepen.io/gmailchao/pen/jOZyrWN?editors=0010
-->

<!-- 123. 黑白兔#0684
codepen:https://codepen.io/johnny329/pen/abqWzZV?editors=1111
-->

<!-- 124. zera#6060
codepen: https://codepen.io/zera-tseng/pen/zYRwdZd?editors=1011
-->

<!-- 125.Mitour#0672
codepen: https://codepen.io/mitour/pen/eYVRWwQ
-->

<!-- 126.ewen#8354
codepen: https://codepen.io/ewen0808/pen/RwQgZmO
-->

<!-- 127.家洋#6999
https://codepen.io/yang940648/pen/bGLrywN
-->

<!-- 128.yolala#7070
https://codepen.io/chiakilalala/pen/oNEpqmR?editors=1111
-->

<!-- 129. 艾芮絲#6060
codepen: https://codepen.io/wangyingju/pen/PoQQPWr?editors=0010
-->

<!-- 130. How#5806
codepen: https://codepen.io/howtobefine/pen/jOZZgLG?editors=0010
-->

<!-- 131. 小金#3256
codepen: https://codepen.io/AmoGH357/pen/JjpBZmV
-->

<!-- 132. 眠瀾#8857
CodePen: https://codepen.io/laron9486/pen/jOZKgqO
-->

<!-- 133. xuan#0808
 codepen：https://codepen.io/xuan0915/pen/bGvRdvm?editors=0011-->
<!-- 134. anby#7112
 codepen：https://codepen.io/andy-ch-bo-an/pen/ZExyoGX?editors=1111
-->

<!-- 135. WangShuan(雅萱)#0947
const square = function (num) {
  return  parseInt(num)**2;
}

const calculate = function (num1, num2, num3) {
  return parseInt(num1) + parseInt(num2) - parseInt(num3);
}

const rounding = function (num) {
  return Math.round((num + Number.EPSILON) * 100) / 100
}

const parseNumber = function (str) {
  return Number(str)
}

const divisible = function (num) {
  return num % 2
}
-->

<!-- 136. Leone#0851
CodePen: https://codepen.io/Leoneboy/pen/rNdzjLx?editors=0011
-->
<!-- 137. Ayre#0016
CodePen: https://codepen.io/yichunlin09/pen/oNqeByq?editors=0011
-->
<!-- 138. Ada
CodePen: https://codepen.io/zggsoagv-the-scripter/pen/RwMZpwd
-->
<!-- 139. SHIN#6075
CodePen: https://codepen.io/shin9626/pen/abYyJPP
-->

<!-- 140.Yanyan#3555
CodePen: https://codepen.io/wei-yi-lee/pen/zYWdzdo
-->

<!-- 141.Nyanwu#7129
CodePen: https://codepen.io/a07401234/pen/vYRJepg
-->

<!-- 142.React-慧茹(拉拉醬)
CodePen: https://codepen.io/lala-lee-jobs/pen/gOexXZE?editors=0011
-->

<!-- 143. Claire#2116
 codepen：https://codepen.io/claire-chang-the-bashful/pen/wvmqpYo -->

<!-- 144. SunnyCheng#4113
 codepen：https://codepen.io/Sunny0509/pen/eYMGGWP?editors=0011 -->
 
 <!-- 145: huch09#1426
 codepen:https://codepen.io/subarashii-huch09/pen/mdxqZQq?editors=1111 -->
 
 <!-- 145: DaleHsu#0355
 codepen:https://codepen.io/dale_hsu/pen/QWmapwo -->
 
  <!-- 147: John21429
 codepen:https://codepen.io/john21429/pen/JjLLMVE
 
 codepen:https://codepen.io/john21429/pen/rNddJNe -->
 
<!-- 148: JOU#6876
codepen:https://codepen.io/joujoujou924/pen/ExERQqm -->

<!-- 149: Harmonia#3139
codepen:https://codepen.io/joujoujou924/pen/ExERQqm -->

<!-- 150: Sophia19#4005
codepen:https://codepen.io/sophia019/pen/bGMNjpo -->

<!-- 151 小白#2406
codePen: https://codepen.io/gracewhite/pen/abGYLjr -->




