This is a brief logic problem solving using JavaScript as a programming language. The questions came from my period of learning studies as a specialist in programming for mobile devices in graduate school at the Institute of Education, Science and Technology of Piauí (IFPI).
You can run the following commands to install Node.js and NPM, respectively:
First to update the ubuntu, run:
sudo apt update
And then:
sudo apt install nodejs
sudo apt install npm
To be sure if the node and npm are installed you can see the version of them through the commands bellow:
node -v
npm -v
Since the goal is to exercise logic programming, the scripts show the result in the terminal, some require user input to show the output and others already have the value defined.
To run the script q01.js, you just need to run:
node q01.js
There are several ways to get the result for the same problem, these are just one way I found to build them. So feel free to test and improve these files in your own way.