├── 1 Free Drinks.js ├── 2 BMI_Calculator.js ├── 3 Grade_Calculator.js ├── 4 nested-friend.js ├── 5 ternary-number.js └── 6 bus fare calculator.js /1 Free Drinks.js: -------------------------------------------------------------------------------- 1 | /*** 2 | 3 | Free Drinks 4 | - Burger more than 500tk: free Coke 5 | - Else Coke: 30tk 6 | */ 7 | -------------------------------------------------------------------------------- /2 BMI_Calculator.js: -------------------------------------------------------------------------------- 1 | /*** 2 | 3 | BMI Calculator and Health Category 4 | 5 | Create a JavaScript program that calculates the Body Mass Index (BMI) and assigns a health category based on the BMI value. Use nested if-else statements to determine the health category. 6 | 7 | - Calculate BMI using the formula: BMI = weight (kg) / (height (m))^2 8 | - BMI < 18.5, you are underweight. 9 | - BMI >= 18.5 and BMI <=24.9, you are normal. 10 | - BMI >=25 and BMI <= 29.9, you are overweight. 11 | - Otherwise, you are obese. 12 | 13 | */ 14 | -------------------------------------------------------------------------------- /3 Grade_Calculator.js: -------------------------------------------------------------------------------- 1 | /*** 2 | 3 | Grade Calculator 4 | 5 | Create a simple JavaScript program that takes a student's score as input and returns their corresponding grade based on the following grading scale: 6 | 7 | A: 90-100 8 | B: 80-89 9 | C: 70-79 10 | D: 60-69 11 | F: 0-59 12 | 13 | ***/ 14 | -------------------------------------------------------------------------------- /4 nested-friend.js: -------------------------------------------------------------------------------- 1 | /*** 2 | 3 | if you get more then 80 then inside your friend score. 4 | If your friend get more than 80. then go for a lunch. 5 | if your friend get below 80 but greater than or equal 60 then tell your friend, good luck next time. 6 | if your friend get less than 60 but more than or equal to 40 then, keep your friend's message unseen. 7 | if your friend get less than 40, block your friend 8 | if you get less than 80 go to home and sleep and act sad 9 | 10 | Note: 11 | use nested if-else-if-else 12 | */ 13 | -------------------------------------------------------------------------------- /5 ternary-number.js: -------------------------------------------------------------------------------- 1 | /*** 2 | 3 | you have two numbers in two variables, called: num1, num2 4 | 5 | now declare a variable called result. 6 | if num1 is bigger than num2 then result will be double of num1. if not, then the value of the variable result will be the sum of num1 and num2. 7 | 8 | write a simple if-else. 9 | 10 | also, write it using ternary operator. 11 | 12 | */ 13 | -------------------------------------------------------------------------------- /6 bus fare calculator.js: -------------------------------------------------------------------------------- 1 | /*** 2 | 3 | Ticket fare Calculator 4 | - Children (age < 10): free 5 | - Students get a 50% discount 6 | - Senior citizens (age >= 60) gets a 15% Discount 7 | - Otherwise Regular ticket fare 800 tk 8 | */ 9 | --------------------------------------------------------------------------------