From d20c7238766aa36ebb3e4d3a29a64721cd61205c Mon Sep 17 00:00:00 2001 From: Tim Glasgow Date: Sat, 6 Aug 2022 17:37:13 -0500 Subject: [PATCH] score calculator --- squarenotsquare/src/libs/CalculateScore.js | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 squarenotsquare/src/libs/CalculateScore.js diff --git a/squarenotsquare/src/libs/CalculateScore.js b/squarenotsquare/src/libs/CalculateScore.js new file mode 100644 index 0000000..8918179 --- /dev/null +++ b/squarenotsquare/src/libs/CalculateScore.js @@ -0,0 +1,6 @@ +export function calculateSquareScore (answers, finalTime) { + let timeScore = (60 - finalTime) * 1000; + let answerScore = answers * 1000; + let finalScore = timeScore + answerScore; + return finalScore; +} \ No newline at end of file