I'm starting to learn how to code and I created a simple program to rate tests.
The problem is that I have to change four arguments for each "test" to make the code work properly. What can I change so that I only need to change two?
I hope I explained myself, English isn't my first language. And sorry for the undescriptive title but I didn't know how to phrase it.
function score (pointsObt, pointsTest) {
return 100 / pointsTest * pointsObt;
};
function verdict (pointsObt, pointsTest){
if (score (pointsObt, pointsTest) >= 75) {
return 'Yay, you did it'
}
else {
return "You did it! But bad."
}
};
console.log (verdict(50, 50));
console.log ('Your score: ' + score(50, 50));