From c39aa9e957ca150a55d593c6b3df8746e6c9c68f Mon Sep 17 00:00:00 2001 From: sweatshirt0 Date: Mon, 23 Jan 2023 15:47:14 -0500 Subject: [PATCH] beginning to calc app --- calculator.js | 14 ++++++++++++++ node_modules/.package-lock.json | 2 +- package-lock.json | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 calculator.js diff --git a/calculator.js b/calculator.js new file mode 100644 index 0000000..661bc4d --- /dev/null +++ b/calculator.js @@ -0,0 +1,14 @@ +const prompt = require("prompt-sync")({sigint: true}); + +function add(a, b) { + let e = a + b; + return e; +} + +let c = prompt("Num 1: "); +let d = prompt("Num2: "); +let op = prompt("What operation? "); + +if (op == "+") { + console.log(Number(c) + Number(d)); +} diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json index 86d5128..0537ed6 100644 --- a/node_modules/.package-lock.json +++ b/node_modules/.package-lock.json @@ -1,5 +1,5 @@ { - "name": "javascript-sandbox", + "name": "sandbox-js", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/package-lock.json b/package-lock.json index 0d1f9f7..d575272 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "javascript-sandbox", + "name": "sandbox-js", "lockfileVersion": 2, "requires": true, "packages": {