---
# System prepended metadata

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

---

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

# 🏅 5/11(三) 每日 JS 刷題任務 - if 流程判斷 III

### 題目一：有沒有打折
某廠商大甩賣，折扣表如下：

* 未滿 2000 無折扣
* 2000~2999 9折
* 3000~3999 8折
* 高於 4000 7折

``` =JavaScript
// input 輸入
sale(5000)
sale(2500)
sale(3300)
sale(200)
// output 輸出
3500
2250
2640
200
```
### 題目二：西元轉民國
**台灣/建立時間：1912 年 1 月 1 日**
``` =JavaScript
// input 輸入
CEtoChinese(1977)
CEtoChinese(2022)
CEtoChinese(1666)

// output 輸出
"民國66年"
"民國111年"
"尚未建國"
```

### 題目三：年薪計算機
以下是梅添良軟體公司的計薪方式
* 每個月固定支薪，不幫員工保勞健保
* 三節沒禮金，也沒任何獎金
* 只有月薪、年終
#### 年終計算
* 未滿一年，不會有年終
* 待超過一年的員工，年終會有 1 個月
* 待超過五年的員工，年終會有 1.3 個月
``` =JavaScript
// input 輸入 
// annualSalary(月薪,年資)
annualSalary(10000,0.8)
annualSalary(12000,1.5)
annualSalary(20000,10)
// output 輸出
"120000"
"156000"
"266000"
```

## 魔王題，請不要輕易接觸，會花上 8hr 時間
### 梅添良薪水數字大小寫轉換
* 老闆開發票時，很不擅長數字小寫轉大寫，請幫助他這個金魚腦
``` =JavaScript
// input 輸入
changeCapital(35000)
changeCapital(9876543210)
changeCapital(-33)
changeCapital("安安")
changeCapital("033")
// output 輸出
"參萬伍仟元整"
"玖拾捌億柒仟陸佰伍拾肆萬參仟貳佰壹拾元整"
"格式錯誤"
"格式錯誤"
"參拾參元整"
```

:::spoiler 提示
http://tax.0123456789.tw/
:::



## 回報流程

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

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

<!-- 解答：  -->


回報區
---

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

<!-- 1. Bruno Yu 
答案：（可直接撰寫答案）
Codepen：https://codepen.io/bruno-yu/pen/xxYwyPQ
-->

<!-- 2. yunyun 
答案：
Codepen：https://codepen.io/yun_yunni/pen/dydXNZB
-->

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

<!-- 4. pipi
答案：
Codepen：https://codepen.io/pipiyy13/pen/ExQjjPO
-->

<!-- 3. Stanley#3825
答案：
Codepen：https://codepen.io/sean_1215/pen/mdXERBJ
-->

<!-- 5. JackC
Codepen?:https://codepen.io/key0329/pen/jOZrByv 
-->

<!-- 6. Aaron
Codepen : https://codepen.io/narrowd4c/pen/GRQJoJP?editors=0012
-->

<!-- 7. Amberhh#2465
Codepen : https://codepen.io/Amberhh/pen/QWQEpVz?editors=0010
-->

<!-- 8. TaoDoris#5230
Codepen : 
https://codepen.io/peetaoting/pen/oNELZvX?editors=0012
-->

<!-- 9. 安安你好你是誰#7416
Codepen : 
https://codepen.io/leave3310-the-looper/pen/MWQepMW?editors=0010
-->

<!-- 10. Noy
https://codepen.io/MochiCodingPen/pen/YzeWZoE
-->

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


<!-- 12. Xiang#5313
Codepen：https://codepen.io/snorlaxxu/pen/ZErOKyO?editors=0010
-->

<!-- 13. Peng
https://codepen.io/peng-027/pen/MWQemya
 -->

<!-- 14. Rex Chu
https://codepen.io/rex_chu/pen/abqZJPN
 -->
 
 <!-- 15. 𝔼.𝕎#4742
https://codepen.io/kidult316/pen/dydXWwq
 -->

<!-- 16.IreneLee
codepen:https://codepen.io/ntjtcxpt-the-animator/pen/wvyWeBK?editors=0011
 -->

 <!-- 17.Josh Chen#4552
https://codepen.io/hiphop825/pen/wvyWeMM?editors=0010
 -->
 
<!-- 18.Chi
Codepen: https://codepen.io/YoChi84/pen/bGLeRYg  
-->

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

<!-- 20. AllenLi#6756
CodePen:https://codepen.io/knsybndf-the-animator/pen/qBxNjdJ?editors=1111 -->

<!-- 21. Tuhacrt#0008 //魔王題輸入不明
Codepen: https://codepen.io/Tuhacrt/pen/KKQMmGz?editors=0011
-->

<!-- 22. yuyu#6310
Codepen: https://codepen.io/yuyu0905/pen/oNELwzm?editors=0012
-->

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

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

<!-- 25. Vera#5592
Codepen: https://codepen.io/skvera/pen/ZErOKwK
-->

<!-- 26. bakiii#5652
 https://codepen.io/aki168/pen/dydXVde-->
 
<!-- 27. Jia-Hong Chen#3863
Codepen: https://codepen.io/iloveleon19/pen/dydXzyY?editors=0010
-->

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

<!-- 29. andersonshen#4675
Codepen:
https://codepen.io/luxyenni-the-bold/pen/BaYzmoN
-->

<!-- 30. RyanLu#3642
Codepen:
https://codepen.io/ryanlu1125/pen/GRQqOmg?editors=0011
-->

<!-- 31. Jason Chen
Codepen:
https://codepen.io/jason60810/pen/JjpKyRo
-->

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

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

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

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

<!-- 36. deveryone#8090
codepen:https://codepen.io/raycheng/pen/jOZrYGe?editors=0010
-->

<!-- 37.hsiuhsiu
codepen:https://codepen.io/hsiuhsiu/pen/BaYzYzv?editors=0012
-->

<!-- 38. Murmurline#6969
沒做魔王關，推薦2 樓 yunyun 的
codepen:https://codepen.io/murmurline/pen/oNELwrg
-->

<!-- 39.Katie
codepen:https://codepen.io/Katie24/pen/NWyrpKX
-->

<!-- 40.lyle#8123 
codepen:https://codepen.io/tomys/pen/qBxNoXg?editors=0010
-->

<!-- 41. bonnieli1414#4906
codepen:https://codepen.io/bonnieli1414/pen/poabxzX?editors=0010
-->

<!-- 42. Lina Chen
codepen: https://codepen.io/LinaChen/pen/ZErOarx
-->

<!-- 43. Stella/UIUX/台北#7394
codepen: https://codepen.io/ting-juan-huang/pen/VwQjVeg?editors=0012 
-->

<!-- 44. will0708#7730
https://codepen.io/pen/?editors=0010
-->

<!-- 45. ChaoChao
https://codepen.io/EmiiilyJ/pen/GRQqPKj
-->

<!-- 46. Raymond Lam#0344
https://codepen.io/manshun-lam/pen/WNMxPJe?editors=1010
-->

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

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

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

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

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

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

<!-- 53. 教練#6451
Codepen:
https://codepen.io/monkeybear721/pen/OJQRaZV
-->

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

<!-- 55. Sussu#4211
Codepen:
https://codepen.io/yatiti84/pen/NWybjrL?editors=1111
-->

<!-- 56. Arista
Codepen:
https://codepen.io/arista-hsieh/pen/dydORGe
-->

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

<!-- 56. danny123
codepen:https://codepen.io/binlandz123/pen/xxYRXXO
-->

<!-- 57. Wilson#8687
codepen: https://codepen.io/foolwilson/pen/LYQbdrJ
-->

<!-- 58. 隔壁小王喔
Codepen:
https://codepen.io/stevetanus/pen/YzepaMM
-->

<!-- 59. cyndi#8308
codepen:
https://codepen.io/swi963/pen/MWQyXWa
-->
<!-- 60. Meri#0052 
Codepen:
https://codepen.io/Bboy_Meri/pen/JjpEPvR?editors=0012
-->

<!-- 6１. 小鹿Kerwin#5730 
Codepen:
https://codepen.io/tkoleo84119/pen/VwQPYeO?editors=0012
-->



<!-- 6１. RayChen#6088 
Codepen:
https://codepen.io/raychen1996/pen/abqpLEO
-->

<!-- 62. Mojito#6002
 codepen: https://codepen.io/vu3xk41997/pen/RwQKEWm
-->

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

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

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

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

<!-- 67.Mitour#0672
沒做魔王題╮（╯＿╰）╭
 https://codepen.io/mitour/pen/wvyqvyy-->
 
<!-- 68.小金#3256 (changeCapital(033)八進制問題，解不出來TT)
 codepen: https://codepen.io/AmoGH357/pen/MWQBPQQ
-->

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

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

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

<!--72. xuan#0808
  codepen：https://codepen.io/xuan0915/pen/vYReeXO?editors=0011-->
  
<!--73. Claire#2116
codepen：https://codepen.io/claire-chang-the-bashful/pen/RwMLPdV -->

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

<!-- 74: 黑白兔#0684
codepen: https://codepen.io/johnny329/pen/xxWjKEd -->

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

<!-- 76: Neuf#3083 
codepen: https://codepen.io/yifanneuf/pen/ExEBbME?editors=1111-->

