From 099179b16d8e634ee138313c5f91b4660d9a5d36 Mon Sep 17 00:00:00 2001 From: Andrej Rasevic <andrej@rasevicengineering.com> Date: Sat, 8 Jan 2022 21:02:12 -0500 Subject: [PATCH] adding exercise 1 --- exercises/exercise1/Exercise1_Description.md | 28 ++++++++++++++++++++ exercises/exercise1/calculator.js | 9 +++++++ exercises/exercise1/functions.js | 0 3 files changed, 37 insertions(+) create mode 100644 exercises/exercise1/Exercise1_Description.md create mode 100644 exercises/exercise1/calculator.js create mode 100644 exercises/exercise1/functions.js diff --git a/exercises/exercise1/Exercise1_Description.md b/exercises/exercise1/Exercise1_Description.md new file mode 100644 index 0000000..638d6e9 --- /dev/null +++ b/exercises/exercise1/Exercise1_Description.md @@ -0,0 +1,28 @@ +# Exercise 1: + +## Due Date: Tuesday, January 11, 2022 11:59 PM +## Objectives: To get familiar with writing basic node modules and gain practice with our git workflow for distributiing course materials and submitting projects. + +## Specifications/Requirements +1. You are given 2 files: __functions.js__ and __calculator.js__. You need to implement the 4 basic arithmetic operations: add, multipply, divide and subtract. In the __functions.js__ file you need to create a node module that will export 4 functions with the following signatures: +* function add(num1, num2) +* function subtract(num1, num2) +* function multiply(num1, num2) +* function divide(num1, num2) + +2. In __calculator.js__ you will need to use the funtions you export from your newly created node module and use them inside of the main function you have been given. To run the script you will just execute: +```javascript +node calculator.js +``` +Inside of main you will need to call each one of your functions and display the result using `console.log()`. The expected output from a run of your script using the values 12 and 3 for num1 and num2 respectively would be: +```javascript +% node calculator.js +running script +15 +9 +36 +4 +done running scipt +``` +To deliver your submission you will need to commit your changes locally and push to your repo on the university gitlab server. + diff --git a/exercises/exercise1/calculator.js b/exercises/exercise1/calculator.js new file mode 100644 index 0000000..3d45833 --- /dev/null +++ b/exercises/exercise1/calculator.js @@ -0,0 +1,9 @@ + +function main() { + console.log('runing script......') + // call your functions here + + console.log('ending script......') +} + +main() \ No newline at end of file diff --git a/exercises/exercise1/functions.js b/exercises/exercise1/functions.js new file mode 100644 index 0000000..e69de29 -- GitLab