Test Scores Processor is a Node.js application designed to process test scores entered via command-line arguments. The script calculates the average score and displays all provided scores in a formatted manner. This lightweight application is ideal for quick score analysis without needing external dependencies.
Developed as part of a professional portfolio, this project highlights command-line processing, input validation, and JavaScript array operations.
- π Processes test scores entered as command-line arguments.
- π’ Calculates the average score based on user input.
- π₯οΈ Command-line execution, making it lightweight and efficient.
- β Error handling to validate input and prevent invalid operations.
- Node.js β JavaScript runtime environment.
- JavaScript (ES6+) β Implements functions using modern JS syntax.
This project demonstrates:
- β Processing command-line arguments in Node.js.
- β Performing calculations and array operations in JavaScript.
- β Validating user input and handling errors effectively.
- β Building lightweight CLI tools for automation and data processing.
π test_scores
βββ π index.js # Main Node.js script
Before running the script, ensure Node.js is installed. Verify with:
node -v
1οΈβ£ Open a terminal and navigate to the project folder:
cd test_scores
2οΈβ£ Run the script by providing test scores as arguments:
node index.js 89 100 92 93
If executed with:
node index.js 89 100 92 93
The console output will be:
All scores: 89, 100, 92, 93
Average score: 93.5
- If no scores are provided, the script will display:
Error:
Please enter at least one score.
- If a non-numeric value is entered, the script will display:
Error:
All scores must be numbers.
Invalid score detected: <invalid_value>
- π Median and Mode Calculation β Extend functionality to calculate more statistics.
- π Export Results β Save results to a file instead of just displaying them.
- π€ Integration with Databases β Store and retrieve test scores from a database.
- π Graphical Output β Display scores in a visual format using a graphing library.
This project is licensed under the MIT License.
π€ Juan Jacobo Florez Monroy
π Portfolio: jjacobo95.com
π GitHub: github.com/jjacoboflorez95