JavaScript implementation
Student Grade Calculator in JavaScript
Build a console application that calculates totals, averages, grades, and pass or fail results.
Setup instructions
This project uses modern ECMAScript Modules (ESM) and runs in Node.js.
1. Ensure you have Node.js (v16 or newer) installed.
2. Extract the downloaded ZIP file.
3. Open your terminal and navigate to the project directory.
4. Run `npm install` to ensure everything is set up.
5. Run the application using: `npm start`
Project files
Solution explanation
- `src/domain/`: Contains classes using private fields (`#name`) and `Object.freeze()` for immutability.
- `src/services/grade-calculator.js`: Core calculation logic using functional array methods like `.reduce()`.
- `src/io/console-input.js`: Handles asynchronous terminal input via Node's `readline` module.
- `src/app.js`: The main entry point tying the components together.