Ad

our goal here is to build, piece by piece, to a formula that will accept multiple points.
after this, the goal will be to define the visible area of the graph based on the min/max in the parameters.

function drawGraph(position) {
  const width = 5;
  const height = 5;
  const arr = [];

  for (let i = 0; i < height; i++) {
    arr[i] = [];
  };

  arr.forEach((row, idx) => {
    for (let i = 0; i < width; i++) {
      row.push(" ");
    }
    (idx < width -1) ?
      row[0] = "|" :
      row[0] = "+";
    })

  let count = +1;

  while (count < width) {
    arr[width - 1][count] = "-";
    count++;
  }

  arr[height - position.y - 1][position.x] = "*";

  return arr;
}

return the cumulative letter grade based on the average of the student's percent scores.

60 => "F"
70 => "D"
80 => "C"
90 => "B"
=90 => "A"

function getGrade (s1, s2, s3) {
  let avg = (s1 + s2 + s3) / 3;
  if (avg >= 90) {
    return "A"
  }
  else if (avg >= 80) {
    return "B"
  }
  else if (avg >= 70) {
    return "C"
  }
  else if (avg >= 60) {
    return "D"
  }
  else {return "F"}
}

our first test of icodethis Kumite for pro members.

given a string (str), you should begin by removing the symbols.

Example:
"y&%ou sho!!!uld! no@t e@at yell==ow sn**ow" =>
"you should not eat yellow snow"

function removeSymbols(str) {
  const regEx = /[&%!@=\*£]/g;
  const newStr = str.replaceAll(regEx, "");
  return (newStr);
}