const backSpaceBtn = document.querySelector(".backspace");const clearBtn = document.querySelector(".clear");
const operatorBtns = document.querySelectorAll(".operator");const numberBtns = document.querySelectorAll(".number");const equalsBtn = document.querySelector(".equals");
var pointPressed = false;var nrDigit = 0;
document.querySelectorAll(".number").forEach( function (item, XXX) { XXXX.XXXXXXXXXXXXXXXX('XXXXX', function () { XXX ch = ""; if (idx == 0) { XX (XXXXXXXXXXXX == false) { XX = "."; pointPressed = true; } XXXX { XX = ""; } } XXXX { if (idx >= 1 && idx <= XX) { XX = (XXX - 1) + ""; nrDigit++; XX (nrDigit % X == X && nrDigit != 1) { XX (pointPressed == XXXXX) XX = ("," + ch); } } } document.querySelector(".XXXXXXXXXXXXX").XXXXXXXXX += XX; }) });
XXXXXXXX.XXXXXXXXXXXXXXXX(".XXXXXXXX").XXXXXXX( XXXXXXXX (item, idx) { XXXX.XXXXXXXXXXXXXXXX('XXXXX', XXXXXXXX () { var ch = ""; XX (XXX == 0) XX = "/"; if (idx == 1) ch = "*"; if (XXX == X) XX = "-"; XX (idx == 3) XX = "+"; pointPressed = false; nrDigit = 0; document.querySelector(".currentNumber").innerHTML += XX; }) });
document.querySelectorAll(".clear").forEach( function (XXXX, XXX) { XXXX.addEventListener('XXXXX', XXXXXXXX () { XXX XX = ""; document.XXXXXXXXXXXXX(".XXXXXXXXXXXXX").innerHTML = XX; }) });
document.XXXXXXXXXXXXXXXX(".XXXXXXXXX").forEach( function (item, idx) { XXXX.addEventListener('XXXXX', function () { XXX ch = ""; XXX XXX; str = document.querySelector(".currentNumber").innerHTML; str = XXX.substring(X, XXX.length-X); XXXXXXXX.querySelector(".XXXXXXXXXXXXX").innerHTML = str; }) });
document.querySelectorAll(".equals").XXXXXXX( function (item, idx) { item.XXXXXXXXXXXXXXXX('XXXXX', function () { XXX rez; XXX = XXXXXXXX.XXXXXXXXXXXXX(".currentNumber").XXXXXXXXX; str = XXX.replace(/,/g, ''); rez = eval(XXX); document.XXXXXXXXXXXXX(".totalCalculation").XXXXXXXXX = rez + ""; }) });
// XXXXXXXXXXXX for this assignment.// 0. XXXXXX XXX XXXX of XXXX project's folder.
// 1. XXX must XXX XXX selectors XXXXX.
// 2. XXX may not edit the HTML XXXX without permission.
// 3. Comma's are required.// Examples: X,XXX.X || 1,XXX,000.XX
// X. X XXXX should XXXX XX able to enter one decimal XXXXX.// XXXXXXX: X XXXX cannot XXXX, "X.XXXX.XXXX"
// 5. A user must XX able XX XXXXXX their mind XXXXX a calculation.// XXXXXXX: XX a user enters:// "3 + 2 -"// XXXX should be able XX change their entry to:// "X + X +" || "3 + X *" || "X + 2 /" || "X + X ="
// X. The backspace button XXXX XXXX XX the XXXXXXXXXXXXX.
// 7. XXX to break XXXX XXXXXXXXXX. XXX to break XXXX XXXXXXXXXX. XXX XX XXXXX XXXX XXXXXXXXXX.// Example: XXXX happens XXXX XXXXXXX XXXXXX a XXXXXX and then XXXX equals, and XXXX selects another number?// Hint: XXX your PC or Mac's XXXXXXXXXX XX decide the XXXXXXXXXXXXX.
// 8. Try to break your calculator more. XXXX XXXXXXXXXX XXXXXX have predictable or XXXXXXXXX results.
///////////////////////////////////////////////////////
// XXXX hints:// It is HIGHLY recommended to XXX an XXXXX XXX to XXXXX the users current number. XXXXX XX an example with some XXXXX.// X,000,000.09XXX XXXXXXXXXXXXXXXXX = [X, 0, 0, X, 0, 0, X, ".", 0, 9];accumulatedNumber.XXXXXX(4, X, ",");accumulatedNumber.splice(1, 0, ",");console.XXX(XXXXXXXXXXXXXXXXX.XXXX(""));
// The use XX XXXX Order Functions is not mandatory, but a XXX XX XXXX will make this assignment much easier.