Skip to content

Commit

Permalink
Expermiental problem solving
Browse files Browse the repository at this point in the history
  • Loading branch information
Compositr committed Jul 29, 2021
1 parent bf8c285 commit ff96002
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions database/ps.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/** @format */

"use strict";
/** Problem solving worksheet handler/generator */
/**
* This file handles math problem generation and handles other math-y stuff.
*/

/**
* @class
* Mathamatical Expression object class
*/
class Expression {
/**
* Generate a new Expression
* @param {String} expr An expression
* @param {Number} answer Answer to the expression
* @param {Number} first First number
* @param {Number} last Last number
* @param {String} type Type of question
*/
constructor(expr, answer, first, last, type) {
this.expr = expr;
this.answer = answer;
this.first = first;
this.last = last;
this.type = type;
}
evalutate() {
return eval(expr);
}
}

0 comments on commit ff96002

Please sign in to comment.