DEV Community

A K I L A N
A K I L A N

Posted on

JS TASK

The task is to get 5 subjects where to find avg & grade and total if the student had fail in one subject no no grade .


let eng = 80;
let tamil = 90;
let maths = 95;
let sci = 70;
let ss = 88;

let total = eng+tamil+maths+sci+ss;

let avg = total/5;

if(eng<=35||tamil<=35||maths<=35||sci<=35||ss<=35){

    console.log("NO grade");

}
else if(avg>=90){
    console.log("o")
    console.log(avg)
    console.log(total)
}
else if(avg<90 && avg >=70) {

    console.log("A")
     console.log(avg)
     console.log(total)

}

else if(avg < 70 && avg >= 50){

    console.log("b")
    console.log(avg)
    console.log(total)
}
else if (avg < 50 && avg >= 40){

    console.log("c")
    console.log(avg)
    console.log(total)
}



Enter fullscreen mode Exit fullscreen mode

OUTPUT

Top comments (0)