---
# System prepended metadata

title: "\U0001F3C5 JS 任務 Day7 - if 流程判斷 III"
tags: [軟體工程師體驗營 - 2024]

---

---
tags: 軟體工程師體驗營 - 2024
---

# 🏅 JS 任務 Day7 - 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/
:::

:::info
【討論串】
https://discord.com/channels/801807326054055996/1236263999218126888
:::


## 回報流程

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

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


回報區
---

| 報數 | Discord 名字 |                                Codepen／其他回饋                                 |                |
|:----:|:------------:|:--------------------------------------------------------------------------------:| :--------------: |
|  01  |    Camila    |                [Codepen](https://codepen.io/camilalo/pen/qBwGKOG)                | 同學你偷跑阿XD |
|  02  |     白白     |           [Codepen](https://codepen.io/YuBai/pen/yLrWWQQ?editors=0011)           |                |
|  03  |    詹姆士    |          [Codepen](https://codepen.io/z111048/pen/PogrmEb?editors=1111)          |                |
|  04  |     tim      |         [Codepen](https://codepen.io/jskrtivy-the-animator/pen/RwOzVVW)          |                |
|  05  |    Larry     |        [Codepen](https://codepen.io/larrylinr5/pen/abxgWjr?editors=0011)         |（希望沒有bug)<br>同學你的介面好讚               |
|  06  |     小米     | [Codepen](https://codepen.io/hlgudwue-the-typescripter/pen/JjVQNmP?editors=0012) |  BOSS 打不過    |
|  07  |    jerry     |               [Codepen](https://codepen.io/sony791210/pen/GRLbmPr)               |                |
|  08  |    yuan!     |                [Codepen](https://codepen.io/townyuan/pen/KKYjmbe)                |                |
|  08  |      萴      |         [Codepen](https://codepen.io/SZL741023/pen/bGJPWOY?editors=0010)         |                |
|  09  |     JUN_     |           [Codepen](https://codepen.io/Jun-L/pen/rNbEweX?editors=0011)           |                |
|  10  |   LiLiLiLi   |        [Codepen](https://codepen.io/jungang0414/pen/XWQLgpW?editors=1011)        |                |
|  11  | Lauren | [Codepen](https://codepen.io/Lauren8/pen/mdgZwxX?editors=1112) |
|  12  | 阿若 | [Codepen](https://codepen.io/skar5268/pen/jORjwRg) |
|  13  | yicheng | [Codepen](https://codepen.io/YiChengCHANG/pen/vYMqJXz?editors=1111) |
|  14  | Tough life | [Codepen](https://codepen.io/hakuei0115/pen/NWmZgaE) |
|  15  | macihuang | [Codepen](https://codepen.io/macy1215/pen/mdgZwLX) |
|16|Michelle0417|[Codepen](https://codepen.io/michelle0417/pen/jORjwbe)
|  17  | WEIWEI | [Codepen](https://codepen.io/weiwei93/pen/WNWqEmG?editors=0010) |
|  18  | Aya | [Codepen](https://codepen.io/NoNameNote/pen/gOyNWdg)、[參考解答ㄉ BOSS](https://codepen.io/NoNameNote/pen/bGJXbPY) | 初版 BOSS 採用十分位、千分位補字進去，沒處理到很多零的狀況，後來參考解答ㄌ |
|  19  | Ana |[Codepen](https://codepen.io/Ana-Wu/pen/vYMqJQM?editors=0010)|
|  20  | Yuwen | [Codepen](https://codepen.io/Yuwen-the-reactor/pen/jORjGPm?editors=0012) |
|  21  | boin | [Codepen](https://codepen.io/boinji/pen/wvZLqvZ) |
|  22  | easonpan | [Codepen](https://codepen.io/easonpan0904/pen/qBwzXgJ) |
|  23  | Emma | [Codepen](https://codepen.io/huang_L/pen/abxgLRg) |
| 24 | zaoannihao  | [Codepen](https://codepen.io/ckhwdvrx-the-solid/pen/ExJBbQP)| 
|  25  | Chia Pin | [Codepen](https://codepen.io/joker-cat/pen/MWRMree) |
|  26  | kawa | [Codepen](https://codepen.io/z83xji6/pen/qBwzVJr?editors=0011) |
|  27  | LGJason | [Codepen](https://codepen.io/j811108/pen/yLrdpPa) | boss undone
| 29 | Six | [Codepen](https://codepen.io/Max-kuo/pen/oNOrpMa?editors=0010) |
| 30  | Ariel | [Codepen](https://codepen.io/ariel0510/pen/WNWqEPx?editors=0012) |
| 31  | anderson666 | [Codepen](https://codepen.io/goodmanbuild/pen/dyLBdgo) |
| 32  | MY | [Codepen](https://codepen.io/ahmomoz/pen/rNbEJgR?editors=1112) |Boss題待補|
|  33  | Toung | [Codepen](https://codepen.io/Toung/pen/jORjzxR) | 需補Boss |
|  34  | KUN. | [Codepen](https://codepen.io/barry91205/pen/abxgGBy?editors=1111) | Boss再補 |
| 35  | Ellie | [Codepen](https://codepen.io/Ellie-Chiang/pen/VwNJvmb?editors=0111) |
| 36  | leo.chang | [Codepen](https://codepen.io/s16777216/pen/QWPXrNW) |
| 37  | Amy(咂摳) | [Codepen](https://codepen.io/nnxucgmc-the-builder/pen/YzMovpK?editors=0012) |等級不足Boss打不過|
| 38  | Mionne | [Codepen](https://codepen.io/neohyntw/pen/VwNJddL) |Boss待補|
| 39  | s870012 | [Codepen](https://codepen.io/idzrvbnl-the-bashful/pen/BaEgPmV?editors=0111) ||
| 40 | yuling | [Codepen](https://codepen.io/igzdflpu/pen/wvZLdLp) |BOSS 待補|
| 41 | yunyouob | [Codepen](https://codepen.io/ozkkvlsu-the-animator/pen/LYvKBwj?editors=1111)|
| 42 | hongru-LyNn | [Codepen](https://codepen.io/LyNnYWu/pen/dyLBgJb) |
|  43  | Zander | [Codepen](https://codepen.io/chuangmaster/pen/NWmZOrd) |
|  44  | Daphne | [Codepen](https://codepen.io/DaphneShen/pen/ExJBrdM?editors=0011) |
|  45  | BBB | [Codepen](https://codepen.io/bryan-hsaio/pen/ExJBrBB?editors=1112) |
| 46 | mike_2049 | [Codepen](https://codepen.io/mike2049/pen/WNWqmbJ) |魔王太強了|
|  47  | oyll | [Codepen](https://codepen.io/dizzydog-rgb/pen/zYXVXpd) |
|  48  | 達達 | [Codepen](https://codepen.io/Adam-Tsai/pen/gOyNyQN?editors=1111) |
|  49  | ninii傳教士 | [Codepen](https://codepen.io/niiniiii/pen/RwOzBRV?editors=0011) |
|50|Ran|[Codepen](https://codepen.io/Ran-Ran-the-typescripter/pen/XWQLwgB?editors=1111)||
|51|Jiahe|[Codepen](https://codepen.io/Andywang-95/pen/ZEZdRrj)|攻克Boss！求幫助Debug|
|  52  | MDFK | [Codepen](https://codepen.io/aqcrrhwb/pen/BaEggeG?editors=0012)|BOSS 待補|
|  53  | Joey一針 | [Codepen](https://codepen.io/joeychou/pen/OJGeKqJ) |BOSS 待補|
| 54  | 快樂小豬 | [Codepen](https://codepen.io/rtjowfyf-the-lessful/pen/zYXVgmP?editors=1111) |Boss你不要過來啊|
|  55  | JY | [Codepen](https://codepen.io/jylee0805/pen/RwOzZgE?editors=0011) |有微小bug |
|  56  | han | [Codepen](https://codepen.io/Han-Chen-the-flexboxer/pen/ZEZdooK?editors=0011) | 16位數以上無法處理 |
|  57  | Antonio | [Codepen](https://codepen.io/gwhvusel-the-builder/pen/bGJPzde) |  |
| 58 | liugod3824🔥 |[Codepen](https://codepen.io/kjssvtkr-the-animator/pen/YzMmzjx?editors=0012)✔|
|  59  | oldan | [Codepen](https://codepen.io/Enix-Chien-/pen/yLrmyYy) |魔王題候補|
| 60 | Maca | [CodePen](https://codepen.io/uimaca/pen/GRLbawj?editors=0010) |
| 61 | yu.t_liu | [CodePen](https://codepen.io/YuT200053/pen/OJGKPqL?editors=1011) |
| 62 | Sammy | [CodePen](https://codepen.io/fsczdlla-the-bold/pen/dyLBVJy?editors=0011) |魔王題不知有無bug|
| 63 | Bruno | [CodePen](https://codepen.io/bruno-yu/pen/yLrmJyx) ||
| 64 | Eden |[Codepen](https://codepen.io/iseden/pen/RwOzQNb)|Boss題待補|
|  65  | Andy_12 | [Codepen](https://codepen.io/lifann/pen/LYvwZvW?editors=0011) |
|  66  | sweewei | [Codepen](https://codepen.io/sweewei-Law/pen/jORgymv?editors=1112) |
| 67 | 小趴 | [Codepen](https://codepen.io/papa2415/pen/XWQvzXQ?editors=1111)|魔王還在除bug,待補|
| 68 | tzhengliin |[Codepen](https://codepen.io/tzhengliin/pen/JjVgMNy)|被BOSS KO 投胎再補|
| 69 | damon0323 |[Codepen](https://codepen.io/pen/?editors=1011)
| 70 | 黛西 |[Codepen](https://codepen.io/pen/?editors=1011)
| 71 | ss585801 |[Codepen](https://codepen.io/ss585801/pen/BaEXmPx)
| 72 | asabulu_von_f |[Codepen](https://codepen.io/asabulu/pen/WNWVKOJ?editors=0011)|勇者默默升級~level up|
| 73 | fantuan0695 |[Codepen](https://codepen.io/iqtzhkrw-the-vuer/pen/KKYLrxP?editors=1010)|我只寫了魔王題XD|
| 74 | 知夜 |[Codepen](https://codepen.io/XiaoXiaTian2/pen/dyEbbwx?editors=1111)|undone 魔王題|
| 75 | Eileen |[Codepen](https://codepen.io/Eileen-io/pen/ZENzzRr)|undone 魔王題|
|76|maru3096|[Codepen](https://codepen.io/deamru/pen/JjqPKdq)|
| 77 | Casey | [Codepen](https://codepen.io/Caseyyyyyyyyyyyyyy/pen/mdgZvgO) |
|  78  | 杰_jie | [Codepen](https://codepen.io/hmj8805/pen/PovYdxX?editors=1111) |
|  79  | Winnie | [Codepen](https://codepen.io/codepen-io-winnie/pen/eYoqMgX?editors=0011) |魔王題待研究|
| 80 | kevinwen2014 | [Codepen](https://codepen.io/wenwoo/pen/GRaKVmQ?editors=0011) | 魔王題花了四小時 卻發現有bug 又修了一小時完成...... |
| 80 | .zack_p | [Codepen](https://codepen.io/Designer-PH/pen/QWRWyyZ?editors=0012) |
| 81 | discat3119 | [Codepen](https://codepen.io/dizzysoup/pen/KKLKXPK) |
| 82 |yo0x0oy|[Codepen](https://codepen.io/Dayton-Hsieh/pen/dyEymZb)|魔王題待研究|
| 83 | PoWei#8484 | [Codepen](https://codepen.io/Po-Wei-Lai/pen/LYoYqbe?editors=0011) |
| 84 | wan_ju| [Codepen](https://codepen.io/Laura21/pen/mdYdvLo?editors=1111) |
| 85 | jerry_66983 | [Codepen](https://codepen.io/Barry-C/pen/gOJpwKx?editors=0010) |BOSS打不過..先PASS
| 86 | Sonia | [Codepen](https://codepen.io/YUJOU/pen/YzbXLmZ?editors=0111) |魔王題待補
| 87 | l.shua_228 | [Codepen](https://codepen.io/Shan-Hua-Lin-LIN-HUA/pen/wvbKoWX) |
| 88 | jami_37521 | [Codepen](https://codepen.io/jamiHexo/pen/RwmaZON) |魔王題待補
| 89 | Shen | [Codepen](https://codepen.io/yan-Shen-the-decoder/pen/gOJMYrr) |魔王題待補
|  90  | 邵 | [Codepen](https://codepen.io/ukscrlno-the-typescripter/pen/Povzmxm?editors=0011) |
|  91  | hao jing | [Codepen](https://codepen.io/hjxu/pen/bGypKKL) | 有緣再做魔王題|
| 92 | n913239 | [Codepen](https://codepen.io/n913239/pen/XWwMrXN?editors=1010) ||
| 93 | 艾洛 | [Codepen](https://codepen.io/Ironance/pen/pomJjRe) ||
|  94  | maruko1105 | [Codepen](https://codepen.io/marukox1105/pen/vYwxvyX?editors=0112) |
| 95 | Shiny | [Codepen](https://codepen.io/shinychen/pen/dyEZOxX) | 還打不過魔王  |
| 96 | ChrisLin | [Codepen](https://codepen.io/vllzfzco-the-reactor/pen/rNgJEYP) |
| 97 | Lang | [Codepen](https://codepen.io/Hsiflow-Lang/pen/rNEaoNO) |練強一點再來打魔王|
<!--【快速複製】    
|  num  | user | [Codepen]() |
-- >