Created
September 17, 2022 09:33
-
-
Save QuocCao-dev/a41e4a54f4e031dded7b72c2734294c5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function kiemtra(mon1, mon2, mon3, khuVuc, doiTuong, diemChuan) { | |
| if (mon1 * mon1 * mon3 === 0) return "Rớt"; | |
| let tongDiem = mon1 + mon2 + mon3; | |
| const diemCongThemKhuVuc = { | |
| A: 2, | |
| B: 1, | |
| C: 0.5, | |
| }[khuVuc]; | |
| tongDiem += diemCongThemKhuVuc; | |
| const diemCongThemDoiTuong = { | |
| 1: 2.5, | |
| 2: 1.5, | |
| 3: 1, | |
| }[doiTuong]; | |
| tongDiem += diemCongThemDoiTuong; | |
| return tongDiem >= diemChuan ? "Đậu" : "Rớt"; | |
| } | |
| kiemtra(4, 5, 10, "C", 2, 15); |
Author
QuocCao-dev
commented
Sep 17, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment