---
# System prepended metadata

title: "\U0001F3C5 5/9(一) 每日 JS 刷題任務 - if 流程判斷 I"
tags: [公益程式體驗營 - 2022]

---

---
tags: 公益程式體驗營 - 2022
---
 
# 🏅 5/9(一) 每日 JS 刷題任務 - if 流程判斷 I
## 提示

### 題目一：成年計算機

``` =JavaScript
// input 輸入
checkAdult(20)
checkAdult(12)
checkAdult(33)
checkAdult(18)
// output 輸出
"成年"
"未成年"
"成年"
"未成年"
```
### 題目二：法定性行為年紀計算機(16歲)

``` =JavaScript
// input 輸入
canSex(16,"male")
canSex(14,"female")
canSex(20,"female")
// output 輸出
"可以色色"
"你還不行哦~"
"可以色色"
```

### 題目三：滿 300 即可符合優惠條件，能使用 50 元折價券

``` =JavaScript
// input 輸入
buy(450)
buy(299)
buy(0)
buy(-30)
buy(300)
buy(1000)

// output 輸出
"符合優惠券資格，費用是 400"
"不優惠券資格，費用是 299"
"...你來亂的嗎？"
"再鬧我就生氣了哦~"
"剛好符合資格，費用是 250"
"符合優惠券資格，費用是 950"
```

## 進階題，不適合新手
### 是否為質數
``` =JavaScript
// input 輸入
isPrime(29)
isPrime(17)
isPrime(-3)
isPrime(288)
isPrime(97)
isPrime(6)
// output 輸出
"是質數"
"是質數"
"無法判別"
"我只能算 100 以內的質數計算，原諒我QQ"
"是質數"
"不是質數"
```



## 回報流程

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

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

<!-- 解答：  -->


回報區
---

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

<!-- 1. Wendy
答案：（可直接撰寫答案）
Codepen：https://codepen.io/wendy03/pen/jOZbxaE
-->

<!-- 2. Bruno Yu
答案：（可直接撰寫答案）
Codepen：https://codepen.io/bruno-yu/pen/KKQdBJE?editors=0010
-->

<!-- 3. yunyun
答案：（可直接撰寫答案）
Codepen：https://codepen.io/yun_yunni/pen/OJQMGdd
-->

<!-- 4. Art
答案：（可直接撰寫答案） 1 不是質數喔^^
Codepen：https://codepen.io/ss97202tw/pen/poagmjy?editors=0011
-->

<!-- 5. Jason Chen
Codepen：https://codepen.io/jason60810/pen/oNEbRLy
-->


<!-- 6. shijia
答案：https://codepen.io/shijia22/pen/rNJOvdj
-->

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

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

<!-- 9.Xiang#5313
答案：
Codepen：https://codepen.io/snorlaxxu/pen/gOvPJKO?editors=0111
-->

<!-- 10. hw#0715
Codepen： https://codepen.io/Lhwei/pen/qBxbGmK 
-->

<!-- 11. Aaron
Codepen: https://codepen.io/narrowd4c/pen/GRQJoJP
-->

<!-- 12. Joyce#3790
Codepen : https://codepen.io/joycehuang/pen/Yzewoyz?editors=0011
-->

<!-- 13. Chaco#2993
Codepen : https://codepen.io/chaco-wang/pen/bGLEyxp?editors=0011
-->

<!-- 14. Eric.S
 Codepen：https://codepen.io/Eric_Shen/pen/VwQeJmY
-->

<!-- 15. Noy
https://codepen.io/MochiCodingPen/pen/WNMrqwE
-->

<!-- 16. Knn#0492
Codepen : https://codepen.io/Knn_84/pen/bGLEPRr?editors=0010
-->

<!-- 17. bonnieli1414#4906
Codepen : https://codepen.io/bonnieli1414/pen/KKQVjoe?editors=0011
-->

<!-- 18. su#7798
codepen: https://codepen.io/wc-su/pen/rNJxbre
-->

<!-- 19. 楓之聲#6945
codepen: https://codepen.io/sshane258/pen/abqdgBM  
-->

<!-- 19. han#9437
codepen:  https://codepen.io/qnrxylcw-the-reactor/pen/KKQVjGx
-->

<!-- 20. Yuhung#1391
codepen: https://codepen.io/Yu__hung/pen/rNJxEpP?editors=0012
-->

<!-- 21. Lemon
codepen: https://codepen.io/shumhoyin/pen/NWyxZEY
-->

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

<!-- 23. Tuhacrt#0008
Codepen: https://codepen.io/Tuhacrt/pen/LYQGKgp?editors=0012
-->

<!-- 24. KuoMin#4931
Codepen: https://codepen.io/KuoMin/pen/GRQoawR
-->

<!-- 25. Josh Chen#4552
Codepen: https://codepen.io/hiphop825/pen/poagMRm?editors=0010
-->

<!-- 26. Katie
Codepen: https://codepen.io/Katie24/pen/VwQeORO?editors=0012
-->

<!-- 27. Wanyu#5878
Codepen: https://codepen.io/syong668/pen/RwQrXPZ?editors=0112
-->

<!-- 28. rejennylo
Codepen:
https://codepen.io/reJennylo/pen/PoQZMJB
-->

<!-- 29.IreneLee
CodePen:
 https://codepen.io/ntjtcxpt-the-animator/pen/jOZWgLR?editors=0012
-->

<!-- 30.andersonshen#4675
CodePen:
 https://codepen.io/luxyenni-the-bold/pen/zYRrgKG
-->

<!-- 31. 炎炎#0777
Codepen: https://codepen.io/kimyen260/pen/yLvedVj?editors=0012 -->

<!-- 32. BeanHuang
Codepen: https://codepen.io/Beanhuang/pen/XWZXvBK?editors=0011-->

<!-- 33. Peng
https://codepen.io/peng-027/pen/wvyMVOZ?editors=0010
 -->
 
 <!-- 33. 翁來
https://codepen.io/wguo8320/pen/yLvOBLO
 -->

<!-- 34. yuyu#6310
Codepen: https://codepen.io/yuyu0905/pen/ExQPBqx
-->
 
<!-- 35. Vera#5592
Codepen: https://codepen.io/skvera/pen/VwQeogX
-->

<!-- 36. Cheng-Yu#1813
Codepen: https://codepen.io/ball77111/pen/JjpGgVy?editors=0011
-->

<!-- 37. Greta#0837
Codepen:
https://codepen.io/gretali/pen/vYdGBdM
-->

<!-- 38. Charlotte Lee
Codepen:
https://codepen.io/charlotte-lee/pen/NWyxQmZ?editors=0012
-->

<!-- 39. 肉桂卷#0625
Codepen: https://codepen.io/ginnlee/pen/XWZdWao?editors=0011

-->

<!-- 40. Alphacostankion#8475
Codepen: https://codepen.io/alphapolo/pen/yLvOyLw
-->

<!-- 41. Ryan Lu#3642
Codepen: https://codepen.io/ryanlu1125/pen/wvyGazw?editors=0012
-->

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

<!-- 43. JustinLiu
Codepen: https://codepen.io/justin0227/pen/mdXPbKN?editors=0011
-->

<!-- 44 Patti Chiu Patti#7774
Codepen: https://codepen.io/peiru-qiu/pen/LYQNYWw?editors=0011
-->

<!-- 45. Chi
Codepen: https://codepen.io/YoChi84/pen/MWQyaLZ 
-->

<!-- 46. bakiii#2652
https://codepen.io/aki168/pen/KKQzdEx
-->

<!-- 46. lyle#8123
https://codepen.io/tomys/pen/RwQaWqo
-->

<!-- 47. hsiuhsiu#7412
https://codepen.io/hsiuhsiu/pen/eYVZpQX?editors=0012
-->



<!-- 48. RayChen#6088
https://codepen.io/raychen1996/pen/poayyzj
-->

<!-- 49. Van.CS #2067
 codepen: https://codepen.io/fbacojji-the-selector/pen/PoQZryK?editors=0012
-->


<!-- 50. Murmurline#6969
 codepen: https://codepen.io/murmurline/pen/mdXPbRo
-->

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

<!-- 52. deveryone#8090
codepen:https://codepen.io/raycheng/pen/JjpXXrv?editors=0010
Advanced:https://codepen.io/raycheng/pen/zYRqBeV?editors=0010
-->

<!-- 52. WilliamChou#7375
codepen:https://codepen.io/williampo78/pen/KKQzVZj
-->

<!-- 53. Arista
codepen:https://codepen.io/arista-hsieh/pen/vYdGKwg
-->

<!-- 54. Jim
codepen:https://codepen.io/jim255060/pen/LYQNRYN
-->

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

<!-- 56. Mylène
codepen:https://codepen.io/hamajibashi/pen/GRQZqWZ
-->

<!-- 57.Line Chen
codepen: https://codepen.io/LinaChen/pen/ZErWpOd
-->

<!-- 58. Triple
 https://codepen.io/riku30/pen/QWQNEjg -->
 
 <!-- 59. 安安你好你是誰#7416
codepen: https://codepen.io/leave3310-the-looper/pen/abqNBLq
-->

 <!-- 60. mei#8421
codepen: https://codepen.io/Shila-Chen/pen/rNJeWqp
-->

<!-- 61. TaoDoris#5230
codepen: https://codepen.io/peetaoting/pen/qBxZREg
-->

<!-- 62. Sussu#4211
codepen: https://codepen.io/yatiti84/pen/QWQNddq
-->

<!-- 63. 米金#1399
https://codepen.io/ihrowjtq-the-vuer/pen/zYRqNOL
-->

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

<!-- 65. ChaoChao
https://codepen.io/EmiiilyJ/pen/dydMvXN
-->

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

<!-- 67. _Evan伊凡
Codepen：https://codepen.io/Evan_9837/pen/jOZqBoN
-->

<!-- 68. Raymond Lam#0344
Codepen：https://codepen.io/manshun-lam/pen/ZErWKzW?editors=0012
-->

<!-- 69. 小不點#1793
Codepen：https://codepen.io/fwmfmgkx-the-flexboxer/pen/vYdGdEr?editors=1111
-->

<!-- 70. Bao#4997
Codepen：https://codepen.io/baoh/pen/VwQeNEQ?editors=0011
-->

<!-- 71. Easton#3863
Codepen: https://codepen.io/EastonIsCodingNow/pen/mdXPxBV
-->

<!-- 72. Stanley#3825
Codepen: https://codepen.io/sean_1215/pen/rNJedoP?editors=0111
-->

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

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

<!-- 74. Amberhh#2465
codepen: https://codepen.io/Amberhh/pen/ZErWRWO?editors=0010
-->

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

<!-- 76. AllenLi#6756
CodePen:
https://codepen.io/knsybndf-the-animator/pen/poayVOM?editors=0012 -->

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

<!-- 78. Jia-Hong Chen#3863
Codepen:
https://codepen.io/iloveleon19/pen/poabeqm?editors=0010
-->

<!-- 79. EllieLo #9809
Codepen:
https://codepen.io/ellie-lo/pen/vYdKeyj?editors=0011
-->

<!-- 80. Stella/UIUX/台北#7394
Codepen:https://codepen.io/ting-juan-huang/pen/PoQNrzP
-->

<!-- 81. Wilson#8687
Codepen: https://codepen.io/foolwilson/pen/zYRKwGv
-->

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

<!-- 82. Mojito#6002
 codepen: https://codepen.io/vu3xk41997/pen/BaYLgQB
-->

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

<!-- 84. 亞芽#1185 
codepen: https://codepen.io/sanahsu/pen/dydObdV?editors=0011
-->

<!-- 85. littlesun#9469
codepen:https://codepen.io/littlesun10111/pen/rNJWwBM
-->

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

<!-- 87. carrieT#9628
codepen: https://codepen.io/echocarriet/pen/jOZWZmM
-->

<!-- 88. 靜宜#6866
codepen: https://codepen.io/jamie18/pen/dydOdaZ

嘗試代入isPrime(95) 會顯示是質數
-->

<!-- 89. Kiwi#9804
codepen: https://codepen.io/kiwi1113/pen/BaYppgy
-->

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

<!-- 91. Susan8402#5854
codepen: https://codepen.io/Susan8402/pen/PoQWgqY?editors=0012
-->

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

<!-- 93.Mitour#0672
codepen: https://codepen.io/mitour/pen/bGLRzaB 
-->

<!-- 94.Choo.Ku
codepen: https://codepen.io/chooku/pen/LYQjZgZ?editors=0012
-->

<!-- 94.JessieCho
codepen: https://codepen.io/jessieCho/pen/LYQexbg
-->

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

<!-- 96. 眠瀾#8857
CodePen: https://codepen.io/laron9486/pen/YzemVxb?editors=0010
-->

<!-- 97. Ayre#0016
CodePen: https://codepen.io/yichunlin09/pen/wvmqJzK?editors=0010
-->

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

<!-- 99. Ada
CodePen: https://codepen.io/zggsoagv-the-scripter/pen/dymzQVZ
-->

<!-- 100. Claire#2116
 codepen：https://codepen.io/claire-chang-the-bashful/pen/abYyqGb -->
 
 <!-- 101. leoneboy#0851
 codepen：https://codepen.io/claire-chang-the-bashful/pen/abYyqGb -->
 
<!-- 102. xuan#0808
 codepen：https://codepen.io/xuan0915/pen/PoRKvbW?editors=0011-->
<!-- 103. SunnyCheng#4113
 codepen：https://codepen.io/Sunny0509/pen/yLKzprz>

<!-- 103: huch09#1426
codepen: https://codepen.io/subarashii-huch09/pen/mdxqZQq?editors=1112 -->

<!--104: 家洋#6999
codepen:https://codepen.io/aa235553756/pen/qBopOxb -->


<!-- 105: DaleHsu#0355
codepen: https://codepen.io/dale_hsu/pen/LYdejXd -->

<!-- 106: Harmonia#3139
codepen: https://codepen.io/corly74/pen/qBogdew?editors=0011 -->

<!-- 107: Neuf#3083
codepen: https://codepen.io/yifanneuf/pen/LYdKOGO-->