原書 Exercise 1 要求在 patients.xlsx 新增 Length of Stay,再依住院天數建立 Severity 分級,並指定用 GPT for Excel Word 完成。
Severity 規則:0–3 days=Mild;4–10 days=Moderate;11+ days=Severe。
| Length of Stay | Severity |
|---|---|
| 0–3 | Mild |
| 4–10 | Moderate |
| 11+ | Severe |
先從兩個日期欄建立 Length of Stay,再依上述 threshold 建 Severity。實作時應先確認日期型別與日數定義(是否含入/出院日);A 檔 Exercise 本身沒有在正文指定唯一公式。
A 檔正文沒有印出 Exercise 1 的 row-by-row 結果,solution 指向外部 11/exercise1_solution.txt。本頁不從外部 solution 補答案。
Threshold classification 最容易在邊界出錯,因此 3/4/10/11 天應做 unit tests。若 Length of Stay 的日數定義改變,Severity 也會跟著變。
請新增 Length of Stay 與 Severity。Severity 必須嚴格使用 0–3=Mild、4–10=Moderate、11+=Severe;先用 3、4、10、11 四個測試值證明邊界條件正確,再套用全表。
**問題:**Length of Stay=10 應屬哪一類?11 呢?