Add README.md
This commit is contained in:
66
README.md
Normal file
66
README.md
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
Week 2 Day 4 – Smart Number Analyzer
|
||||||
|
|
||||||
|
Project Overview
|
||||||
|
|
||||||
|
This project is an advanced version of the Number Analyzer app. It uses **functions and event handling** to create a modular and maintainable JavaScript application.
|
||||||
|
|
||||||
|
Features
|
||||||
|
|
||||||
|
* Modular code using functions
|
||||||
|
* Even, Odd, and Prime detection
|
||||||
|
* Dynamic UI update
|
||||||
|
* Clean and reusable logic
|
||||||
|
|
||||||
|
Tech Stack
|
||||||
|
|
||||||
|
* HTML5
|
||||||
|
* CSS3
|
||||||
|
* JavaScript
|
||||||
|
|
||||||
|
How It Works
|
||||||
|
|
||||||
|
1. User enters a number
|
||||||
|
2. Clicks Analyze
|
||||||
|
3. `handleAnalyze()` triggers
|
||||||
|
4. `generateAnalysis()` runs loop
|
||||||
|
5. Helper functions:
|
||||||
|
|
||||||
|
* `isEven()`
|
||||||
|
* `isPrime()`
|
||||||
|
6. Output displayed on UI
|
||||||
|
|
||||||
|
Key Concepts Used
|
||||||
|
|
||||||
|
* Functions
|
||||||
|
* Parameters & return values
|
||||||
|
* Event handling
|
||||||
|
* Code modularization
|
||||||
|
* Nested logic
|
||||||
|
|
||||||
|
Output Example
|
||||||
|
|
||||||
|
Input: 5
|
||||||
|
|
||||||
|
1 - Odd
|
||||||
|
2 - Even | Prime
|
||||||
|
3 - Odd | Prime
|
||||||
|
4 - Even
|
||||||
|
5 - Odd | Prime
|
||||||
|
|
||||||
|
Total Even Numbers: 2
|
||||||
|
Total Odd Numbers: 3
|
||||||
|
Total Prime Numbers: 3
|
||||||
|
|
||||||
|
Future Improvements
|
||||||
|
|
||||||
|
* Optimize prime logic (√n)
|
||||||
|
* Add UI enhancements
|
||||||
|
* Add reset button
|
||||||
|
* Add animations
|
||||||
|
|
||||||
|
Learning Outcome
|
||||||
|
|
||||||
|
* Writing clean, structured code
|
||||||
|
* Breaking problems into functions
|
||||||
|
* Understanding event-driven programming
|
||||||
|
|
||||||
Reference in New Issue
Block a user