Skip to content

Commit 28d5712

Browse files
problem 36 solved
1 parent 0b33e23 commit 28d5712

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed

problem36/problem.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
কেউ ১০০ এর মধ্যে কত মার্ক্স্ পেয়েছে সেটা তোমাকে বলে দিবে। তুমি একটা ফাংশন দিয়ে বলে দিবে সে এ+ পাবে নাকি অন্য কোন গ্রেড পাবে।

problem36/problem36.js

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/* কেউ ১০০ এর মধ্যে কত মার্ক্স্ পেয়েছে সেটা তোমাকে বলে দিবে। তুমি একটা ফাংশন দিয়ে বলে দিবে সে এ+ পাবে নাকি অন্য কোন গ্রেড পাবে। */
2+
3+
4+
5+
6+
function gpa(num){
7+
8+
if( num >= 0 && num <= 100){
9+
10+
if((num >= 0) && ( num < 33)){
11+
const massage = "Your number is " + num + " so your GPA is 'F' means you failed in the exam ";
12+
return massage;
13+
}
14+
15+
else if((num >= 33) && ( num < 40)){
16+
const massage = "Your number is " + num + " so your GPA is 'D' ";
17+
return massage;
18+
}
19+
20+
else if((num >= 40) && ( num < 50)){
21+
const massage = "Your number is " + num + " so your GPA is 'C' ";
22+
return massage;
23+
}
24+
25+
else if ((num >= 50) && (num < 60)){
26+
const massage = "Your number is " + num + " so your GPA is 'B' ";
27+
return massage;
28+
}
29+
else if ( (num >= 60) && (num < 70)){
30+
const massage = "Your number is " + num + " so your GPA is 'A-' ";
31+
return massage;
32+
}
33+
34+
else if ((num >= 70) && (num < 80)){
35+
const massage = "Your number is " + num + " so your GPA is 'A' ";
36+
return massage;
37+
}
38+
else{
39+
const massage = "Congratulations💐💐 !! Your number is " + num + " so your GPA is 'A+' ";
40+
return massage;
41+
}
42+
}
43+
44+
else{
45+
const warningMassage = "⚠️⚠️You input an invalid number. Please input number between 0 to 100.";
46+
return warningMassage;
47+
}
48+
};
49+
50+
51+
52+
const result = 79;
53+
const resultInGrade = gpa(result);
54+
console.log(resultInGrade);

0 commit comments

Comments
 (0)