From 77762731362321a14f393d1c9cb9003a250bdf53 Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Sat, 17 May 2025 12:56:56 +0530 Subject: [PATCH 01/63] Add Example.html with cookie handling functionality and Bootstrap styling --- Example/Cookies/Example.html | 61 ++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 Example/Cookies/Example.html diff --git a/Example/Cookies/Example.html b/Example/Cookies/Example.html new file mode 100644 index 0000000..3d4e6dd --- /dev/null +++ b/Example/Cookies/Example.html @@ -0,0 +1,61 @@ + + + + + + Document + + + + + + + + + +
+
+
+
+ + + +
+
+ + + +
+ +
+ +
+
+
+
+ +
+
+
+ +
+
+
+ + + \ No newline at end of file From ff17e9a527133a982b8b5cdb0cae6e67d5d68f05 Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Mon, 19 May 2025 13:34:25 +0530 Subject: [PATCH 02/63] Add Basic.html and Variable.html with initial JavaScript examples and structure --- Example/01 Lecture_Example/Basic/Basic.html | 21 ++++++++++ .../01 Lecture_Example/Basic/Variable.html | 42 +++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 Example/01 Lecture_Example/Basic/Basic.html create mode 100644 Example/01 Lecture_Example/Basic/Variable.html diff --git a/Example/01 Lecture_Example/Basic/Basic.html b/Example/01 Lecture_Example/Basic/Basic.html new file mode 100644 index 0000000..e13f21a --- /dev/null +++ b/Example/01 Lecture_Example/Basic/Basic.html @@ -0,0 +1,21 @@ + + + + + + Document + + + + + + + + \ No newline at end of file diff --git a/Example/01 Lecture_Example/Basic/Variable.html b/Example/01 Lecture_Example/Basic/Variable.html new file mode 100644 index 0000000..8c8cb32 --- /dev/null +++ b/Example/01 Lecture_Example/Basic/Variable.html @@ -0,0 +1,42 @@ + + + + + + Document + + + + + + \ No newline at end of file From e591a11de2f4efaace55a7b476e2ea4ea66e06ab Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Mon, 19 May 2025 13:40:03 +0530 Subject: [PATCH 03/63] Add Operator.html with examples of arithmetic, assignment, comparison, and logical operators in JavaScript --- .../01 Lecture_Example/Basic/Operator.html | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 Example/01 Lecture_Example/Basic/Operator.html diff --git a/Example/01 Lecture_Example/Basic/Operator.html b/Example/01 Lecture_Example/Basic/Operator.html new file mode 100644 index 0000000..858af64 --- /dev/null +++ b/Example/01 Lecture_Example/Basic/Operator.html @@ -0,0 +1,99 @@ + + + + + + Document + + + + + \ No newline at end of file From 00d8d251e15637f78b5815d68bf110525ebc496e Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Tue, 20 May 2025 14:29:35 +0530 Subject: [PATCH 04/63] Add if_else.html with user input for number comparison and result display --- Example/01 Lecture_Example/Basic/if_else.html | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 Example/01 Lecture_Example/Basic/if_else.html diff --git a/Example/01 Lecture_Example/Basic/if_else.html b/Example/01 Lecture_Example/Basic/if_else.html new file mode 100644 index 0000000..1f491af --- /dev/null +++ b/Example/01 Lecture_Example/Basic/if_else.html @@ -0,0 +1,75 @@ + + + + + + Document + + + + + + + + +
+ +
+
+
+
+ + +
+
+ + +
+
+ +
+
+
+
+ + + +
+ +
+ +
+
+
+
+ + +
+
+
+
+
+ + + + + \ No newline at end of file From a18a906567ac6f9d0cb923a0f5bb2c7a98906607 Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Wed, 21 May 2025 13:50:59 +0530 Subject: [PATCH 05/63] Add Login.html and Welcome.html with login form and success message functionality --- .../Example_login/Login.html | 39 +++++++++++++++++++ .../Example_login/Welcome.html | 14 +++++++ .../01 Lecture_Example/Example_login/login.js | 20 ++++++++++ 3 files changed, 73 insertions(+) create mode 100644 Example/01 Lecture_Example/Example_login/Login.html create mode 100644 Example/01 Lecture_Example/Example_login/Welcome.html create mode 100644 Example/01 Lecture_Example/Example_login/login.js diff --git a/Example/01 Lecture_Example/Example_login/Login.html b/Example/01 Lecture_Example/Example_login/Login.html new file mode 100644 index 0000000..a8c04f8 --- /dev/null +++ b/Example/01 Lecture_Example/Example_login/Login.html @@ -0,0 +1,39 @@ + + + + + + Document + + + + + + + + +
+
+
+
+
+
Login
+
+
+ + +
+
+ + +
+ +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/Example/01 Lecture_Example/Example_login/Welcome.html b/Example/01 Lecture_Example/Example_login/Welcome.html new file mode 100644 index 0000000..5205d34 --- /dev/null +++ b/Example/01 Lecture_Example/Example_login/Welcome.html @@ -0,0 +1,14 @@ + + + + + + Document + + + + +

Welcome to home page

+

Welcome to the home page. You have successfully logged in.

+ + \ No newline at end of file diff --git a/Example/01 Lecture_Example/Example_login/login.js b/Example/01 Lecture_Example/Example_login/login.js new file mode 100644 index 0000000..19eec46 --- /dev/null +++ b/Example/01 Lecture_Example/Example_login/login.js @@ -0,0 +1,20 @@ +function login_hub(){ + + user_name = document.getElementById("username").value; + user_password = document.getElementById("password").value; + + user = "admin@cwpc.in"; + password = "admin@123"; + + if(user_name == user && user_password == password){ + alert("Login Successful"); + window.open("Welcome.html"); + }else{ + alert("Login Failed"); + document.getElementById("username").value = ""; + document.getElementById("password").value = ""; + } + + + +} \ No newline at end of file From 7b772b445c5e53300524d3cba78bfe5885f74970 Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Thu, 22 May 2025 13:51:40 +0530 Subject: [PATCH 06/63] Add Loop.html with interactive loop functionality and styled output --- Example/01 Lecture_Example/Basic/Loop.html | 53 ++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 Example/01 Lecture_Example/Basic/Loop.html diff --git a/Example/01 Lecture_Example/Basic/Loop.html b/Example/01 Lecture_Example/Basic/Loop.html new file mode 100644 index 0000000..00a54c6 --- /dev/null +++ b/Example/01 Lecture_Example/Basic/Loop.html @@ -0,0 +1,53 @@ + + + + + + Document + + + + + + + + + +

Loop

+ +
    + +
+ + + \ No newline at end of file From f7015a4174225054085372dfffda5d9258f3c710 Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Thu, 22 May 2025 13:53:13 +0530 Subject: [PATCH 07/63] Refactor loop structure in Loop.html for improved readability --- Example/01 Lecture_Example/Basic/Loop.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Example/01 Lecture_Example/Basic/Loop.html b/Example/01 Lecture_Example/Basic/Loop.html index 00a54c6..79ccbd7 100644 --- a/Example/01 Lecture_Example/Basic/Loop.html +++ b/Example/01 Lecture_Example/Basic/Loop.html @@ -27,8 +27,7 @@ //} function clickme(){ - for(let i = 0; i <= 100; i++){ - + for(let i = 0; i <= 100; i++){ document.getElementById("print").innerHTML += "
  • " + i + "
  • "; From 2856e12b0e6215bc8edf992bfce277d27e4223f1 Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Wed, 28 May 2025 14:07:26 +0530 Subject: [PATCH 08/63] Enhance Employee Salary Management System and Student Marksheet Application - Refactored Employee class to include creativity features, performance tracking, and career growth recommendations. - Updated student marksheet assignment documentation to clarify requirements and functionalities. - Improved StudentMarksheet class with comprehensive validation, performance reporting, and JSON export capabilities. - Added examples demonstrating break and continue statements in JavaScript. - Introduced arrow function examples for cleaner syntax and better readability. --- 02. JavaScript Variables.md | 440 ++++++------- Example/01 Lecture_Example/Basic/Basic.html | 40 +- Example/01 Lecture_Example/Basic/Break.html | 42 ++ Example/01 Lecture_Example/Basic/Loop.html | 102 +-- .../01 Lecture_Example/Basic/Operator.html | 196 +++--- .../01 Lecture_Example/Basic/Variable.html | 82 +-- .../Basic/arrow_function.html | 34 + .../01 Lecture_Example/Basic/function.html | 0 Example/01 Lecture_Example/Basic/if_else.html | 148 ++--- .../Example_login/Login.html | 76 +-- .../Example_login/Welcome.html | 26 +- .../01 Lecture_Example/Example_login/login.js | 38 +- Example/Array/Array01.html | 96 +-- Example/Array/Example.html | 224 +++---- Example/Array/ExampleOf_Array.html | 86 +-- Example/Array/Food.html | 48 +- Example/Array/Food_List.html | 76 +-- Example/Array/JavaScriptArray.js | 122 ++-- Example/Array/userInput_prompt.html | 82 +-- Example/Arrow/ArrowFunction.html | 76 +-- Example/Basic/index.html | 42 +- Example/Cookies/Example.html | 120 ++-- Example/Function/Arrow functions/Arrow.js | 44 +- Example/Function/Arrow functions/index.html | 22 +- Example/Function/Basic Function/function.js | 92 +-- Example/Function/Basic Function/index.html | 22 +- Example/If Else/if_else.html | 54 +- Example/If Else/if_else1.html | 54 +- Example/JSObjects/index.html | 20 +- Example/JSObjects/index.js | 78 +-- Example/JSObjects/objects.html | 114 ++-- Example/Loader/index.html | 66 +- Example/Loader/welcome.html | 20 +- Example/Login System/css/style.css | 124 ++-- Example/Login System/index.html | 82 +-- Example/Login System/js/login.js | 32 +- Example/Login System/welcome.html | 20 +- Example/Loop/Color.html | 122 ++-- Example/Loop/WhileLoop/WhileLoop.html | 40 +- Example/Loop/for_loop.html | 82 +-- Example/Loop/index.html | 114 ++-- Example/Loop/select_box_color.html | 140 ++-- Example/Objects/Class_and_object.js | 40 +- Example/README.md | 2 +- Example/String/Example.html | 94 +-- Example/UserInput/user_input.html | 112 ++-- Example/Variable/Variable3.html | 72 +-- Example/preloader/css/style.css | 52 +- Example/preloader/index.html | 44 +- Example/preloader/js/p4n.js | 18 +- .../Array Transformation Project/index.html | 410 ++++++------ .../Personal Finance Tracker/index.html | 480 +++++++------- .../Shopping Cart Calculator/index.html | 412 ++++++------ .../String Manipulation Challenge/index.html | 414 ++++++------ .../Temperature Converter/index.html | 240 +++---- Other_Example/fix_header/index.html | 234 +++---- README.md | 58 +- Task/SalarySystem.md | 2 +- Task/employee salary part one.js | 72 +-- Task/employee salary system complete code.js | 612 +++++++++--------- .../employee salary with creative features.js | 254 ++++---- Task/student Market assignment.md | 244 +++---- .../student mark sheet assignment question.js | 482 +++++++------- 63 files changed, 3981 insertions(+), 3905 deletions(-) create mode 100644 Example/01 Lecture_Example/Basic/Break.html create mode 100644 Example/01 Lecture_Example/Basic/arrow_function.html create mode 100644 Example/01 Lecture_Example/Basic/function.html diff --git a/02. JavaScript Variables.md b/02. JavaScript Variables.md index 74aa4ab..d715e74 100644 --- a/02. JavaScript Variables.md +++ b/02. JavaScript Variables.md @@ -1,221 +1,221 @@ -# JavaScript Variables - -## 1. Introduction to Variables - -### Definition -- A variable is a named storage location in computer memory -- Used to store and manage data during program execution -- Acts as a container that holds a specific value which can be modified or referenced - -### Key Characteristics -- Provides a way to label and store data -- Enables dynamic data manipulation -- Supports various data types and scopes - -## 2. Variable Declaration Methods - -### 1. `var` (Legacy Declaration) -```javascript -var oldStyleVariable = "I'm an old school variable"; -``` -#### Characteristics -- Function-scoped or globally-scoped -- Can be re-declared and updated -- Hoisted to the top of its scope -- Less predictable behavior -- **Not Recommended in Modern JavaScript** - -#### Example of Hoisting -```javascript -console.log(x); // Outputs: undefined (not an error) -var x = 5; -``` - -### 2. `let` (Modern Block-Scoped Declaration) -```javascript -let modernVariable = "I'm a block-scoped variable"; -``` -#### Characteristics -- Block-scoped (limited to {} block) -- Can be updated but not re-declared in same scope -- More predictable behavior -- Prevents unintended global variable creation -- **Recommended for Mutable Variables** - -#### Scope Demonstration -```javascript -{ - let blockVariable = "I exist only in this block"; -} -// blockVariable is not accessible outside the block -``` - -### 3. `const` (Constant Declaration) -```javascript -const unchangeableValue = "I cannot be reassigned"; -``` -#### Characteristics -- Block-scoped -- Cannot be reassigned after initial value -- Prevents accidental variable reassignment -- **Recommended as Default Declaration** - -#### Nuanced Behavior with Objects and Arrays -```javascript -const person = { name: "Pankaj" }; -person.name = "Updated Name"; // Allowed -// person = {}; // This would cause an error -``` - -## 3. Naming Conventions and Rules - -### Valid Variable Names -- Must start with a letter, underscore (_), or dollar sign ($) -- Can contain letters, numbers, underscores, dollar signs -- Case-sensitive (`age` and `Age` are different variables) -- No spaces or special characters allowed - -### Recommended Practices -- Use camelCase for variable names -- Choose descriptive and meaningful names -- Avoid single-letter names (except in specific contexts like loops) - -#### Good Examples -```javascript -let firstName = "Pankaj"; -let totalStudentCount = 100; -let isLoggedIn = true; -``` - -#### Bad Examples -```javascript -let 2name = "Invalid"; // Starts with number -let user-name = "Not Good"; // Contains hyphen -let class = "Reserved word"; // Reserved keyword -``` - -## 4. Data Types in Variables - -### Primitive Types -1. **String**: Text data - ```javascript - let greeting = "Hello, World!"; - ``` - -2. **Number**: Numeric values - ```javascript - let age = 30; - let temperature = 98.6; - ``` - -3. **Boolean**: True/False values - ```javascript - let isStudent = true; - ``` - -4. **Undefined**: Declared but not assigned - ```javascript - let undefinedVar; - ``` - -5. **Null**: Intentional absence of any object value - ```javascript - let emptyValue = null; - ``` - -6. **Symbol**: Unique identifier (ES6) - ```javascript - let uniqueKey = Symbol('description'); - ``` - -7. **BigInt**: For very large integers - ```javascript - let bigNumber = 1234567890123456789012345678901234567890n; - ``` - -### Reference Types -1. **Object**: Key-value collections - ```javascript - let person = { - name: "Pankaj", - age: 30, - skills: ["JavaScript", "React"] - }; - ``` - -2. **Array**: Ordered list of values - ```javascript - let fruits = ["Apple", "Banana", "Cherry"]; - ``` - -## 5. Variable Scope - -### Global Scope -- Variables declared outside any function -- Accessible everywhere in the code - -### Function Scope -- Variables declared inside a function -- Accessible only within that function - -### Block Scope -- Variables declared inside {} blocks -- Limited accessibility - -#### Scope Example -```javascript -let globalVar = "Global"; - -function exampleScope() { - let functionVar = "Function Scope"; - - if (true) { - let blockVar = "Block Scope"; - console.log(globalVar); // Accessible - console.log(functionVar); // Accessible - console.log(blockVar); // Accessible - } - - // console.log(blockVar); // Would cause an error -} -``` - -## 6. Best Practices - -### Declaration Recommendations -1. Use `const` by default -2. Use `let` when value will change -3. Avoid `var` in modern JavaScript -4. Initialize variables when declaring -5. Group related declarations together - -### Performance and Memory -- Declare variables as close to usage as possible -- Release references when no longer needed -- Be mindful of variable lifetime - -## 7. Type Conversion - -### Implicit Conversion -```javascript -let result = "5" + 3; // Becomes "53" (string concatenation) -let math = "5" - 3; // Becomes 2 (numeric subtraction) -``` - -### Explicit Conversion -```javascript -let stringNum = "100"; -let number = Number(stringNum); // Converts to number -let string = String(number); // Converts to string -let boolean = Boolean(stringNum); // Converts to boolean -``` - -## Conclusion -Understanding variables is fundamental to JavaScript programming. Practice and consistent use will make these concepts second nature. - -### Quick Reference -- `const`: Unchanging values -- `let`: Changing values -- `var`: Avoid in modern code - +# JavaScript Variables + +## 1. Introduction to Variables + +### Definition +- A variable is a named storage location in computer memory +- Used to store and manage data during program execution +- Acts as a container that holds a specific value which can be modified or referenced + +### Key Characteristics +- Provides a way to label and store data +- Enables dynamic data manipulation +- Supports various data types and scopes + +## 2. Variable Declaration Methods + +### 1. `var` (Legacy Declaration) +```javascript +var oldStyleVariable = "I'm an old school variable"; +``` +#### Characteristics +- Function-scoped or globally-scoped +- Can be re-declared and updated +- Hoisted to the top of its scope +- Less predictable behavior +- **Not Recommended in Modern JavaScript** + +#### Example of Hoisting +```javascript +console.log(x); // Outputs: undefined (not an error) +var x = 5; +``` + +### 2. `let` (Modern Block-Scoped Declaration) +```javascript +let modernVariable = "I'm a block-scoped variable"; +``` +#### Characteristics +- Block-scoped (limited to {} block) +- Can be updated but not re-declared in same scope +- More predictable behavior +- Prevents unintended global variable creation +- **Recommended for Mutable Variables** + +#### Scope Demonstration +```javascript +{ + let blockVariable = "I exist only in this block"; +} +// blockVariable is not accessible outside the block +``` + +### 3. `const` (Constant Declaration) +```javascript +const unchangeableValue = "I cannot be reassigned"; +``` +#### Characteristics +- Block-scoped +- Cannot be reassigned after initial value +- Prevents accidental variable reassignment +- **Recommended as Default Declaration** + +#### Nuanced Behavior with Objects and Arrays +```javascript +const person = { name: "Pankaj" }; +person.name = "Updated Name"; // Allowed +// person = {}; // This would cause an error +``` + +## 3. Naming Conventions and Rules + +### Valid Variable Names +- Must start with a letter, underscore (_), or dollar sign ($) +- Can contain letters, numbers, underscores, dollar signs +- Case-sensitive (`age` and `Age` are different variables) +- No spaces or special characters allowed + +### Recommended Practices +- Use camelCase for variable names +- Choose descriptive and meaningful names +- Avoid single-letter names (except in specific contexts like loops) + +#### Good Examples +```javascript +let firstName = "Pankaj"; +let totalStudentCount = 100; +let isLoggedIn = true; +``` + +#### Bad Examples +```javascript +let 2name = "Invalid"; // Starts with number +let user-name = "Not Good"; // Contains hyphen +let class = "Reserved word"; // Reserved keyword +``` + +## 4. Data Types in Variables + +### Primitive Types +1. **String**: Text data + ```javascript + let greeting = "Hello, World!"; + ``` + +2. **Number**: Numeric values + ```javascript + let age = 30; + let temperature = 98.6; + ``` + +3. **Boolean**: True/False values + ```javascript + let isStudent = true; + ``` + +4. **Undefined**: Declared but not assigned + ```javascript + let undefinedVar; + ``` + +5. **Null**: Intentional absence of any object value + ```javascript + let emptyValue = null; + ``` + +6. **Symbol**: Unique identifier (ES6) + ```javascript + let uniqueKey = Symbol('description'); + ``` + +7. **BigInt**: For very large integers + ```javascript + let bigNumber = 1234567890123456789012345678901234567890n; + ``` + +### Reference Types +1. **Object**: Key-value collections + ```javascript + let person = { + name: "Pankaj", + age: 30, + skills: ["JavaScript", "React"] + }; + ``` + +2. **Array**: Ordered list of values + ```javascript + let fruits = ["Apple", "Banana", "Cherry"]; + ``` + +## 5. Variable Scope + +### Global Scope +- Variables declared outside any function +- Accessible everywhere in the code + +### Function Scope +- Variables declared inside a function +- Accessible only within that function + +### Block Scope +- Variables declared inside {} blocks +- Limited accessibility + +#### Scope Example +```javascript +let globalVar = "Global"; + +function exampleScope() { + let functionVar = "Function Scope"; + + if (true) { + let blockVar = "Block Scope"; + console.log(globalVar); // Accessible + console.log(functionVar); // Accessible + console.log(blockVar); // Accessible + } + + // console.log(blockVar); // Would cause an error +} +``` + +## 6. Best Practices + +### Declaration Recommendations +1. Use `const` by default +2. Use `let` when value will change +3. Avoid `var` in modern JavaScript +4. Initialize variables when declaring +5. Group related declarations together + +### Performance and Memory +- Declare variables as close to usage as possible +- Release references when no longer needed +- Be mindful of variable lifetime + +## 7. Type Conversion + +### Implicit Conversion +```javascript +let result = "5" + 3; // Becomes "53" (string concatenation) +let math = "5" - 3; // Becomes 2 (numeric subtraction) +``` + +### Explicit Conversion +```javascript +let stringNum = "100"; +let number = Number(stringNum); // Converts to number +let string = String(number); // Converts to string +let boolean = Boolean(stringNum); // Converts to boolean +``` + +## Conclusion +Understanding variables is fundamental to JavaScript programming. Practice and consistent use will make these concepts second nature. + +### Quick Reference +- `const`: Unchanging values +- `let`: Changing values +- `var`: Avoid in modern code + **Happy Coding!** 🚀👨‍💻 \ No newline at end of file diff --git a/Example/01 Lecture_Example/Basic/Basic.html b/Example/01 Lecture_Example/Basic/Basic.html index e13f21a..db4751a 100644 --- a/Example/01 Lecture_Example/Basic/Basic.html +++ b/Example/01 Lecture_Example/Basic/Basic.html @@ -1,21 +1,21 @@ - - - - - - Document - - - - - - - + + + + + + Document + + + + + + + \ No newline at end of file diff --git a/Example/01 Lecture_Example/Basic/Break.html b/Example/01 Lecture_Example/Basic/Break.html new file mode 100644 index 0000000..0502dc0 --- /dev/null +++ b/Example/01 Lecture_Example/Basic/Break.html @@ -0,0 +1,42 @@ + + + + + + Document + + + + + + + + \ No newline at end of file diff --git a/Example/01 Lecture_Example/Basic/Loop.html b/Example/01 Lecture_Example/Basic/Loop.html index 79ccbd7..3668af4 100644 --- a/Example/01 Lecture_Example/Basic/Loop.html +++ b/Example/01 Lecture_Example/Basic/Loop.html @@ -1,52 +1,52 @@ - - - - - - Document - - - - - - - - - -

    Loop

    - -
      - -
    - - + + + + + + Document + + + + + + + + + +

    Loop

    + +
      + +
    + + \ No newline at end of file diff --git a/Example/01 Lecture_Example/Basic/Operator.html b/Example/01 Lecture_Example/Basic/Operator.html index 858af64..372b5b3 100644 --- a/Example/01 Lecture_Example/Basic/Operator.html +++ b/Example/01 Lecture_Example/Basic/Operator.html @@ -1,99 +1,99 @@ - - - - - - Document - - - - + + + + + + Document + + + + \ No newline at end of file diff --git a/Example/01 Lecture_Example/Basic/Variable.html b/Example/01 Lecture_Example/Basic/Variable.html index 8c8cb32..b5aafab 100644 --- a/Example/01 Lecture_Example/Basic/Variable.html +++ b/Example/01 Lecture_Example/Basic/Variable.html @@ -1,42 +1,42 @@ - - - - - - Document - - - - - + + + + + + Document + + + + + \ No newline at end of file diff --git a/Example/01 Lecture_Example/Basic/arrow_function.html b/Example/01 Lecture_Example/Basic/arrow_function.html new file mode 100644 index 0000000..2b9c738 --- /dev/null +++ b/Example/01 Lecture_Example/Basic/arrow_function.html @@ -0,0 +1,34 @@ + + + + + + Document + + + + + + + \ No newline at end of file diff --git a/Example/01 Lecture_Example/Basic/function.html b/Example/01 Lecture_Example/Basic/function.html new file mode 100644 index 0000000..e69de29 diff --git a/Example/01 Lecture_Example/Basic/if_else.html b/Example/01 Lecture_Example/Basic/if_else.html index 1f491af..7d55bfd 100644 --- a/Example/01 Lecture_Example/Basic/if_else.html +++ b/Example/01 Lecture_Example/Basic/if_else.html @@ -1,75 +1,75 @@ - - - - - - Document - - - - - - - - -
    - -
    -
    -
    -
    - - -
    -
    - - -
    -
    - -
    -
    -
    -
    - - - -
    - -
    - -
    -
    -
    -
    - - -
    -
    -
    -
    -
    - - - - + + + + + + Document + + + + + + + + +
    + +
    +
    +
    +
    + + +
    +
    + + +
    +
    + +
    +
    +
    +
    + + + +
    + +
    + +
    +
    +
    +
    + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/Example/01 Lecture_Example/Example_login/Login.html b/Example/01 Lecture_Example/Example_login/Login.html index a8c04f8..770e297 100644 --- a/Example/01 Lecture_Example/Example_login/Login.html +++ b/Example/01 Lecture_Example/Example_login/Login.html @@ -1,39 +1,39 @@ - - - - - - Document - - - - - - - - -
    -
    -
    -
    -
    -
    Login
    -
    -
    - - -
    -
    - - -
    - -
    -
    -
    -
    -
    - - - + + + + + + Document + + + + + + + + +
    +
    +
    +
    +
    +
    Login
    +
    +
    + + +
    +
    + + +
    + +
    +
    +
    +
    +
    + + + \ No newline at end of file diff --git a/Example/01 Lecture_Example/Example_login/Welcome.html b/Example/01 Lecture_Example/Example_login/Welcome.html index 5205d34..15361a4 100644 --- a/Example/01 Lecture_Example/Example_login/Welcome.html +++ b/Example/01 Lecture_Example/Example_login/Welcome.html @@ -1,14 +1,14 @@ - - - - - - Document - - - - -

    Welcome to home page

    -

    Welcome to the home page. You have successfully logged in.

    - + + + + + + Document + + + + +

    Welcome to home page

    +

    Welcome to the home page. You have successfully logged in.

    + \ No newline at end of file diff --git a/Example/01 Lecture_Example/Example_login/login.js b/Example/01 Lecture_Example/Example_login/login.js index 19eec46..8ca79f6 100644 --- a/Example/01 Lecture_Example/Example_login/login.js +++ b/Example/01 Lecture_Example/Example_login/login.js @@ -1,20 +1,20 @@ -function login_hub(){ - - user_name = document.getElementById("username").value; - user_password = document.getElementById("password").value; - - user = "admin@cwpc.in"; - password = "admin@123"; - - if(user_name == user && user_password == password){ - alert("Login Successful"); - window.open("Welcome.html"); - }else{ - alert("Login Failed"); - document.getElementById("username").value = ""; - document.getElementById("password").value = ""; - } - - - +function login_hub(){ + + user_name = document.getElementById("username").value; + user_password = document.getElementById("password").value; + + user = "admin@cwpc.in"; + password = "admin@123"; + + if(user_name == user && user_password == password){ + alert("Login Successful"); + window.open("Welcome.html"); + }else{ + alert("Login Failed"); + document.getElementById("username").value = ""; + document.getElementById("password").value = ""; + } + + + } \ No newline at end of file diff --git a/Example/Array/Array01.html b/Example/Array/Array01.html index b2fadb9..0f42146 100644 --- a/Example/Array/Array01.html +++ b/Example/Array/Array01.html @@ -1,48 +1,48 @@ - - - - - - Document - - - - - - - - + + + + + + Document + + + + + + + + diff --git a/Example/Array/Example.html b/Example/Array/Example.html index 0b353d1..d6ff555 100644 --- a/Example/Array/Example.html +++ b/Example/Array/Example.html @@ -1,113 +1,113 @@ - - - - - - Document - - - - - - + + + + + + Document + + + + + + \ No newline at end of file diff --git a/Example/Array/ExampleOf_Array.html b/Example/Array/ExampleOf_Array.html index 3c08b3a..062fd42 100644 --- a/Example/Array/ExampleOf_Array.html +++ b/Example/Array/ExampleOf_Array.html @@ -1,44 +1,44 @@ - - - - - - Document - - - - - - - - -
      -
    - + + + + + + Document + + + + + + + + +
      +
    + \ No newline at end of file diff --git a/Example/Array/Food.html b/Example/Array/Food.html index 5e0dd19..86d2a31 100644 --- a/Example/Array/Food.html +++ b/Example/Array/Food.html @@ -1,25 +1,25 @@ - - - - - - Document - - - - - + + + + + + Document + + + + + \ No newline at end of file diff --git a/Example/Array/Food_List.html b/Example/Array/Food_List.html index c3a4f3b..4cdd505 100644 --- a/Example/Array/Food_List.html +++ b/Example/Array/Food_List.html @@ -1,39 +1,39 @@ - - - - - - Document - - - - - - - \ No newline at end of file diff --git a/Example/Array/JavaScriptArray.js b/Example/Array/JavaScriptArray.js index bed2f0d..988fc94 100644 --- a/Example/Array/JavaScriptArray.js +++ b/Example/Array/JavaScriptArray.js @@ -1,61 +1,61 @@ -const fruits = ["apple", "banana", "cherry"]; - - -// Array Constructor - -const colors = new Array("red", "green", "blue"); - -// Array Elements -const mixedArray = [1, "apple", { name: "John" }, [2, 3, 4]]; - - - -const firstFruit = fruits[0]; // "apple" -const secondFruit = fruits[1]; // "banana" - -console.log(firstFruit); -console.log(secondFruit); - -fruits[2] = "grape"; - -console.log(fruits); - -fruits.push("orange"); // adds element to the end of array - -console.log(fruits); - -fruits.pop(); // removes last element from array - -console.log(fruits); - -fruits.shift(); //removes first element from array - -console.log(fruits) - -fruits.unshift("kiwi"); //adds an element to the beginning of the array - -console.log(fruits); - -// Accessing elements with index -const myArray = [5,6,7,8,9]; - -let x = myArray[1]; // - -// Using for loop -for (let i=0; i - - - - - Document - - - - - - - - - + + + + + + Document + + + + + + + + + diff --git a/Example/Arrow/ArrowFunction.html b/Example/Arrow/ArrowFunction.html index 526e550..05d3013 100644 --- a/Example/Arrow/ArrowFunction.html +++ b/Example/Arrow/ArrowFunction.html @@ -1,39 +1,39 @@ - - - - - - Document - - - - - + + + + + + Document + + + + + \ No newline at end of file diff --git a/Example/Basic/index.html b/Example/Basic/index.html index 157b323..a67c026 100644 --- a/Example/Basic/index.html +++ b/Example/Basic/index.html @@ -1,22 +1,22 @@ - - - - - - Document - - - - - - - - - - - + + + + + + Document + + + + + + + + + + + \ No newline at end of file diff --git a/Example/Cookies/Example.html b/Example/Cookies/Example.html index 3d4e6dd..7e74af5 100644 --- a/Example/Cookies/Example.html +++ b/Example/Cookies/Example.html @@ -1,61 +1,61 @@ - - - - - - Document - - - - - - - - - -
    -
    -
    -
    - - - -
    -
    - - - -
    - -
    - -
    -
    -
    -
    - -
    -
    -
    - -
    -
    -
    - - + + + + + + Document + + + + + + + + + +
    +
    +
    +
    + + + +
    +
    + + + +
    + +
    + +
    +
    +
    +
    + +
    +
    +
    + +
    +
    +
    + + \ No newline at end of file diff --git a/Example/Function/Arrow functions/Arrow.js b/Example/Function/Arrow functions/Arrow.js index 46bd369..a9155c3 100644 --- a/Example/Function/Arrow functions/Arrow.js +++ b/Example/Function/Arrow functions/Arrow.js @@ -1,22 +1,22 @@ -// basic Arrow funciton - -const greet = () => console.log("Good Morning"); - -greet(); - -// use arg.. - -const info = (Name,Age) => { - console.log(`My name is ${Name} and age is ${Age}`); -} - -info("Nishant",12); - -// return type + arg. - -let addNumbers = (a, b) => { - let result = a + b; - return result; -} -let sum = addNumbers(5, 8); -console.log("The sum is " + sum); +// basic Arrow funciton + +const greet = () => console.log("Good Morning"); + +greet(); + +// use arg.. + +const info = (Name,Age) => { + console.log(`My name is ${Name} and age is ${Age}`); +} + +info("Nishant",12); + +// return type + arg. + +let addNumbers = (a, b) => { + let result = a + b; + return result; +} +let sum = addNumbers(5, 8); +console.log("The sum is " + sum); diff --git a/Example/Function/Arrow functions/index.html b/Example/Function/Arrow functions/index.html index 4612c22..71df3cc 100644 --- a/Example/Function/Arrow functions/index.html +++ b/Example/Function/Arrow functions/index.html @@ -1,12 +1,12 @@ - - - - - - Document - - - - - + + + + + + Document + + + + + \ No newline at end of file diff --git a/Example/Function/Basic Function/function.js b/Example/Function/Basic Function/function.js index 7beb8f8..b2693e8 100644 --- a/Example/Function/Basic Function/function.js +++ b/Example/Function/Basic Function/function.js @@ -1,46 +1,46 @@ - -function info(){ - console.log("welcome to codeswithpankaj.com"); -} - -// calling function - -info(); - -// Function With Parameters - -function UserInfo(Name,age,height){ - console.log(`My Name is ${Name} and I am ${age} years old and my Height ${height}`); -} - -// calling function - -UserInfo("Nishant",12,4.5); - -// return type - -function set_tax(){ - return 250; -} - -values = set_tax() -console.log(` this is tax ${values} `); - -// Function with Default Parameters - -function greet(name = "Guest") { - console.log("Hello, " + name + "!"); -} - -greet("Nishant"); // Outputs: Hello, Nishant! -greet(); // Outputs: Hello, Guest! - -// Function Expressions - -multiply = function(a, b) { - return a * b; -}; - -result = multiply(4, 3); -console.log("The result is: " + result); - + +function info(){ + console.log("welcome to codeswithpankaj.com"); +} + +// calling function + +info(); + +// Function With Parameters + +function UserInfo(Name,age,height){ + console.log(`My Name is ${Name} and I am ${age} years old and my Height ${height}`); +} + +// calling function + +UserInfo("Nishant",12,4.5); + +// return type + +function set_tax(){ + return 250; +} + +values = set_tax() +console.log(` this is tax ${values} `); + +// Function with Default Parameters + +function greet(name = "Guest") { + console.log("Hello, " + name + "!"); +} + +greet("Nishant"); // Outputs: Hello, Nishant! +greet(); // Outputs: Hello, Guest! + +// Function Expressions + +multiply = function(a, b) { + return a * b; +}; + +result = multiply(4, 3); +console.log("The result is: " + result); + diff --git a/Example/Function/Basic Function/index.html b/Example/Function/Basic Function/index.html index 28ea971..a60ea38 100644 --- a/Example/Function/Basic Function/index.html +++ b/Example/Function/Basic Function/index.html @@ -1,12 +1,12 @@ - - - - - - Document - - - - - + + + + + + Document + + + + + \ No newline at end of file diff --git a/Example/If Else/if_else.html b/Example/If Else/if_else.html index 57a3e77..e3515c5 100644 --- a/Example/If Else/if_else.html +++ b/Example/If Else/if_else.html @@ -1,28 +1,28 @@ - - - - - - Document - - - - + + + + + + Document + + + + \ No newline at end of file diff --git a/Example/If Else/if_else1.html b/Example/If Else/if_else1.html index d6a3dd2..e9e26d9 100644 --- a/Example/If Else/if_else1.html +++ b/Example/If Else/if_else1.html @@ -1,28 +1,28 @@ - - - - - - Document - - - - + + + + + + Document + + + + \ No newline at end of file diff --git a/Example/JSObjects/index.html b/Example/JSObjects/index.html index 1dd42ef..7c63d44 100644 --- a/Example/JSObjects/index.html +++ b/Example/JSObjects/index.html @@ -1,11 +1,11 @@ - - - - - - Document - - - - + + + + + + Document + + + + \ No newline at end of file diff --git a/Example/JSObjects/index.js b/Example/JSObjects/index.js index 47c670f..8aec69f 100644 --- a/Example/JSObjects/index.js +++ b/Example/JSObjects/index.js @@ -1,39 +1,39 @@ -info = { - 'name': 'joy', - 'age' : 12, - 'city': 'Beijing' -} - -console.log(info.city) -console.log(info['age']) - -for (let key in info) { - console.log(key +' '+ info[key]); -} - -class Person{ - - intro() { - - console.log('welcome to js...') - } - -} - -person = new Person(); -person.intro(); - - -const calculator = { - add: function(a, b) { - return a + b; - }, - subtract: function(a, b) { - return a - b; - } -}; - -console.log(calculator.add(5, 3)); // 8 -console.log(calculator.subtract(8, 2)); // 6 - - +info = { + 'name': 'joy', + 'age' : 12, + 'city': 'Beijing' +} + +console.log(info.city) +console.log(info['age']) + +for (let key in info) { + console.log(key +' '+ info[key]); +} + +class Person{ + + intro() { + + console.log('welcome to js...') + } + +} + +person = new Person(); +person.intro(); + + +const calculator = { + add: function(a, b) { + return a + b; + }, + subtract: function(a, b) { + return a - b; + } +}; + +console.log(calculator.add(5, 3)); // 8 +console.log(calculator.subtract(8, 2)); // 6 + + diff --git a/Example/JSObjects/objects.html b/Example/JSObjects/objects.html index c7d4ba8..6502c31 100644 --- a/Example/JSObjects/objects.html +++ b/Example/JSObjects/objects.html @@ -1,58 +1,58 @@ - - - - - - Document - - - - - + + + + + + Document + + + + + \ No newline at end of file diff --git a/Example/Loader/index.html b/Example/Loader/index.html index 0170c76..d0cf813 100644 --- a/Example/Loader/index.html +++ b/Example/Loader/index.html @@ -1,34 +1,34 @@ - - - - - - Document - - - - - - -
    - -
    - - + + + + + + Document + + + + + + +
    + +
    + + \ No newline at end of file diff --git a/Example/Loader/welcome.html b/Example/Loader/welcome.html index 3164183..8f79e5d 100644 --- a/Example/Loader/welcome.html +++ b/Example/Loader/welcome.html @@ -1,11 +1,11 @@ - - - - - - Document - - -

    Welcome - to codeswithpankaj.com

    - + + + + + + Document + + +

    Welcome - to codeswithpankaj.com

    + \ No newline at end of file diff --git a/Example/Login System/css/style.css b/Example/Login System/css/style.css index 180b4ee..3fa2eb8 100644 --- a/Example/Login System/css/style.css +++ b/Example/Login System/css/style.css @@ -1,62 +1,62 @@ - -body {font-family: Arial, Helvetica, sans-serif;} -form {border: 3px solid #f1f1f1;} - -input[type=text], input[type=password] { - width: 100%; - padding: 12px 20px; - margin: 8px 0; - display: inline-block; - border: 1px solid #ccc; - box-sizing: border-box; -} - -button { - background-color: #f90c04; - color: white; - padding: 14px 20px; - margin: 8px 0; - border: none; - cursor: pointer; - width: 100%; -} - -button:hover { - opacity: 0.8; -} - -.cancelbtn { - width: auto; - padding: 10px 18px; - background-color: #f44336; -} - -.imgcontainer { - text-align: center; - margin: 24px 0 12px 0; -} - -img.avatar { - width: 40%; - border-radius: 50%; -} - -.container { - padding: 16px; -} - -span.psw { - float: right; - padding-top: 16px; -} - -/* Change styles for span and cancel button on extra small screens */ -@media screen and (max-width: 300px) { - span.psw { - display: block; - float: none; - } - .cancelbtn { - width: 100%; - } -} + +body {font-family: Arial, Helvetica, sans-serif;} +form {border: 3px solid #f1f1f1;} + +input[type=text], input[type=password] { + width: 100%; + padding: 12px 20px; + margin: 8px 0; + display: inline-block; + border: 1px solid #ccc; + box-sizing: border-box; +} + +button { + background-color: #f90c04; + color: white; + padding: 14px 20px; + margin: 8px 0; + border: none; + cursor: pointer; + width: 100%; +} + +button:hover { + opacity: 0.8; +} + +.cancelbtn { + width: auto; + padding: 10px 18px; + background-color: #f44336; +} + +.imgcontainer { + text-align: center; + margin: 24px 0 12px 0; +} + +img.avatar { + width: 40%; + border-radius: 50%; +} + +.container { + padding: 16px; +} + +span.psw { + float: right; + padding-top: 16px; +} + +/* Change styles for span and cancel button on extra small screens */ +@media screen and (max-width: 300px) { + span.psw { + display: block; + float: none; + } + .cancelbtn { + width: 100%; + } +} diff --git a/Example/Login System/index.html b/Example/Login System/index.html index 2649261..7625b60 100644 --- a/Example/Login System/index.html +++ b/Example/Login System/index.html @@ -1,41 +1,41 @@ - - - - - - - - - - - -
    -
    -
    -
    -
    - -

    ! Login !

    -
    - -
    - - - - - - - - -
    - - -
    -
    -
    -
    - - - + + + + + + + + + + + +
    +
    +
    +
    +
    + +

    ! Login !

    +
    + +
    + + + + + + + + +
    + + +
    +
    +
    +
    + + + diff --git a/Example/Login System/js/login.js b/Example/Login System/js/login.js index 8a14af9..2eb85c8 100644 --- a/Example/Login System/js/login.js +++ b/Example/Login System/js/login.js @@ -1,17 +1,17 @@ -function logincode(){ - - u_name = document.getElementById("username").value; - u_pwd = document.getElementById("password").value; - - if(u_name == "admin@p4n.in" && u_pwd == "admin"){ - - window.open("welcome.html") - - }else - { - - alert("Check Password And Login Again...") - } - - +function logincode(){ + + u_name = document.getElementById("username").value; + u_pwd = document.getElementById("password").value; + + if(u_name == "admin@p4n.in" && u_pwd == "admin"){ + + window.open("welcome.html") + + }else + { + + alert("Check Password And Login Again...") + } + + } \ No newline at end of file diff --git a/Example/Login System/welcome.html b/Example/Login System/welcome.html index 23134bb..d1bd212 100644 --- a/Example/Login System/welcome.html +++ b/Example/Login System/welcome.html @@ -1,11 +1,11 @@ - - - - - - Document - - -

    Welcome to home page .....

    - + + + + + + Document + + +

    Welcome to home page .....

    + \ No newline at end of file diff --git a/Example/Loop/Color.html b/Example/Loop/Color.html index ed20628..5dca8d1 100644 --- a/Example/Loop/Color.html +++ b/Example/Loop/Color.html @@ -1,61 +1,61 @@ - - - - - - - @codeswithpankaj.com How to change background color randomly in a javascript function - - - - - - - - - - - -
      -
    - - - - - - + + + + + + + @codeswithpankaj.com How to change background color randomly in a javascript function + + + + + + + + + + + +
      +
    + + + + + + diff --git a/Example/Loop/WhileLoop/WhileLoop.html b/Example/Loop/WhileLoop/WhileLoop.html index 0e1b67f..b1554d9 100644 --- a/Example/Loop/WhileLoop/WhileLoop.html +++ b/Example/Loop/WhileLoop/WhileLoop.html @@ -1,21 +1,21 @@ - - - - - - Document - - - - - + + + + + + Document + + + + + \ No newline at end of file diff --git a/Example/Loop/for_loop.html b/Example/Loop/for_loop.html index a468aef..fe6a5d9 100644 --- a/Example/Loop/for_loop.html +++ b/Example/Loop/for_loop.html @@ -1,42 +1,42 @@ - - - - - - Document - - - - -
      - -
    - + + + + + + Document + + + + +
      + +
    + \ No newline at end of file diff --git a/Example/Loop/index.html b/Example/Loop/index.html index 4c2e6dd..3bcb238 100644 --- a/Example/Loop/index.html +++ b/Example/Loop/index.html @@ -1,58 +1,58 @@ - - - - - - Document - - - - - - - - Enter Number : - - - -
      - -
    - - - - - - + + + + + + Document + + + + + + + + Enter Number : + + + +
      + +
    + + + + + + \ No newline at end of file diff --git a/Example/Loop/select_box_color.html b/Example/Loop/select_box_color.html index 18ee7d8..2632e1b 100644 --- a/Example/Loop/select_box_color.html +++ b/Example/Loop/select_box_color.html @@ -1,70 +1,70 @@ - - - - - - - the boxes based on a selection from a dropdown menu - - - - - - - - - - - - - - -
      -
    - - - - - - + + + + + + + the boxes based on a selection from a dropdown menu + + + + + + + + + + + + + + +
      +
    + + + + + + diff --git a/Example/Objects/Class_and_object.js b/Example/Objects/Class_and_object.js index 290e7db..69cdfc7 100644 --- a/Example/Objects/Class_and_object.js +++ b/Example/Objects/Class_and_object.js @@ -1,21 +1,21 @@ -// create a Employee Class - -class Employee{ - - info() { - console.log("Employee Name : Rohan") - } - - - Salary(Emp_Salary){ - console.log("This is Salary : ",Emp_Salary) - } - -} - -// function calling -// create a object -emp = new Employee(); - -emp.info(); +// create a Employee Class + +class Employee{ + + info() { + console.log("Employee Name : Rohan") + } + + + Salary(Emp_Salary){ + console.log("This is Salary : ",Emp_Salary) + } + +} + +// function calling +// create a object +emp = new Employee(); + +emp.info(); emp.Salary(4500); \ No newline at end of file diff --git a/Example/README.md b/Example/README.md index 8b13789..d3f5a12 100644 --- a/Example/README.md +++ b/Example/README.md @@ -1 +1 @@ - + diff --git a/Example/String/Example.html b/Example/String/Example.html index b280aab..4b0f72d 100644 --- a/Example/String/Example.html +++ b/Example/String/Example.html @@ -1,48 +1,48 @@ - - - - - - Document - - - - - - - - - - - - - + + + + + + Document + + + + + + + + + + + + + \ No newline at end of file diff --git a/Example/UserInput/user_input.html b/Example/UserInput/user_input.html index 78e66ab..c5a777d 100644 --- a/Example/UserInput/user_input.html +++ b/Example/UserInput/user_input.html @@ -1,57 +1,57 @@ - - - - - - Document - - - - - - - - - - - - - - - - - - - -
    Name - -
    Age - -
    Height - -
    - + + + + + + Document + + + + + + + + + + + + + + + + + + + +
    Name + +
    Age + +
    Height + +
    + \ No newline at end of file diff --git a/Example/Variable/Variable3.html b/Example/Variable/Variable3.html index 10e2af4..3e939df 100644 --- a/Example/Variable/Variable3.html +++ b/Example/Variable/Variable3.html @@ -1,37 +1,37 @@ - - - - - - Document - - - - - - - - - - + + + + + + Document + + + + + + + + + + \ No newline at end of file diff --git a/Example/preloader/css/style.css b/Example/preloader/css/style.css index 1e92f14..08e3d29 100644 --- a/Example/preloader/css/style.css +++ b/Example/preloader/css/style.css @@ -1,27 +1,27 @@ -#preloader { - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - background-color: #f5f5f5; - z-index: 9999; -} - -.spinner { - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - border: 4px solid #ccc; - border-top-color: #3498db; - border-radius: 50%; - width: 40px; - height: 40px; - animation: spin 1s linear infinite; -} - -@keyframes spin { - 0% { transform: rotate(0deg); } - 100% { transform: rotate(360deg); } +#preloader { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: #f5f5f5; + z-index: 9999; +} + +.spinner { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + border: 4px solid #ccc; + border-top-color: #3498db; + border-radius: 50%; + width: 40px; + height: 40px; + animation: spin 1s linear infinite; +} + +@keyframes spin { + 0% { transform: rotate(0deg); } + 100% { transform: rotate(360deg); } } \ No newline at end of file diff --git a/Example/preloader/index.html b/Example/preloader/index.html index a58a9dc..36a7621 100644 --- a/Example/preloader/index.html +++ b/Example/preloader/index.html @@ -1,22 +1,22 @@ - - - - - - Preloader Example - - - -
    -
    -
    - - - - - - + + + + + + Preloader Example + + + +
    +
    +
    + + + + + + diff --git a/Example/preloader/js/p4n.js b/Example/preloader/js/p4n.js index 801aa82..bd5aca2 100644 --- a/Example/preloader/js/p4n.js +++ b/Example/preloader/js/p4n.js @@ -1,10 +1,10 @@ -document.addEventListener('DOMContentLoaded', function() { - var preloader = document.getElementById('preloader'); - var content = document.getElementById('content'); - - // Hide the preloader and show the main content after 2 seconds - setTimeout(function() { - preloader.style.display = 'none'; - content.style.display = 'block'; - }, 2000); +document.addEventListener('DOMContentLoaded', function() { + var preloader = document.getElementById('preloader'); + var content = document.getElementById('content'); + + // Hide the preloader and show the main content after 2 seconds + setTimeout(function() { + preloader.style.display = 'none'; + content.style.display = 'block'; + }, 2000); }); \ No newline at end of file diff --git a/Other_Example/Assignment Exercises/Array Transformation Project/index.html b/Other_Example/Assignment Exercises/Array Transformation Project/index.html index 83e56b2..609b31c 100644 --- a/Other_Example/Assignment Exercises/Array Transformation Project/index.html +++ b/Other_Example/Assignment Exercises/Array Transformation Project/index.html @@ -1,205 +1,205 @@ - - - - - @codeswithpankaj.com Array Transformation Utility - - - -
    -

    Array Transformation Utility

    -

    @codeswithpankaj.com

    - -
    - - -
    - - -
    - - - - + + + + + @codeswithpankaj.com Array Transformation Utility + + + +
    +

    Array Transformation Utility

    +

    @codeswithpankaj.com

    + +
    + + +
    + + +
    + + + + diff --git a/Other_Example/Assignment Exercises/Personal Finance Tracker/index.html b/Other_Example/Assignment Exercises/Personal Finance Tracker/index.html index 13bbaab..41d2668 100644 --- a/Other_Example/Assignment Exercises/Personal Finance Tracker/index.html +++ b/Other_Example/Assignment Exercises/Personal Finance Tracker/index.html @@ -1,240 +1,240 @@ - - - - - Codes With Pankaj Personal Finance Tracker - - - -
    -

    Personal Finance Tracker

    -

    @codeswithpankaj.com

    - -
    - - - - -
    - -
    -

    Monthly Financial Summary

    -

    Total Income: $0.00

    -

    Total Expenses: $0.00

    -

    Savings: $0.00

    -

    Savings Percentage: 0.00%

    -
    - -
    - - - - - - - - - - - -
    TypeNameAmountActions
    -
    - - - - + + + + + Codes With Pankaj Personal Finance Tracker + + + +
    +

    Personal Finance Tracker

    +

    @codeswithpankaj.com

    + +
    + + + + +
    + +
    +

    Monthly Financial Summary

    +

    Total Income: $0.00

    +

    Total Expenses: $0.00

    +

    Savings: $0.00

    +

    Savings Percentage: 0.00%

    +
    + +
    + + + + + + + + + + + +
    TypeNameAmountActions
    +
    + + + + diff --git a/Other_Example/Assignment Exercises/Shopping Cart Calculator/index.html b/Other_Example/Assignment Exercises/Shopping Cart Calculator/index.html index 80559ae..2131656 100644 --- a/Other_Example/Assignment Exercises/Shopping Cart Calculator/index.html +++ b/Other_Example/Assignment Exercises/Shopping Cart Calculator/index.html @@ -1,206 +1,206 @@ - - - - - @CodesWithPankaj Shopping Cart Calculator - - - -
    -

    Shopping Cart Calculator

    -

    @codeswithpankaj.com

    - -
    - - - - -
    - - - - - - - - - - - - -
    Product NamePriceQuantityTotalActions
    - -
    -

    Cart Summary

    -

    Subtotal: $0.00

    -

    Discount: $0.00

    -

    Tax (10%): $0.00

    -

    Shipping: $0.00

    -

    Total: $0.00

    -
    -
    - - - - + + + + + @CodesWithPankaj Shopping Cart Calculator + + + +
    +

    Shopping Cart Calculator

    +

    @codeswithpankaj.com

    + +
    + + + + +
    + + + + + + + + + + + + +
    Product NamePriceQuantityTotalActions
    + +
    +

    Cart Summary

    +

    Subtotal: $0.00

    +

    Discount: $0.00

    +

    Tax (10%): $0.00

    +

    Shipping: $0.00

    +

    Total: $0.00

    +
    +
    + + + + diff --git a/Other_Example/Assignment Exercises/String Manipulation Challenge/index.html b/Other_Example/Assignment Exercises/String Manipulation Challenge/index.html index c34f3a5..e7b2f6d 100644 --- a/Other_Example/Assignment Exercises/String Manipulation Challenge/index.html +++ b/Other_Example/Assignment Exercises/String Manipulation Challenge/index.html @@ -1,207 +1,207 @@ - - - - - @codeswithpankaj Analysis Utility - - - -
    -

    Text Analysis Utility

    -

    @codeswithpankaj

    - - - - - -
    - - - - + + + + + @codeswithpankaj Analysis Utility + + + +
    +

    Text Analysis Utility

    +

    @codeswithpankaj

    + + + + + +
    + + + + diff --git a/Other_Example/Assignment Exercises/Temperature Converter/index.html b/Other_Example/Assignment Exercises/Temperature Converter/index.html index 9a67f5c..aa1198b 100644 --- a/Other_Example/Assignment Exercises/Temperature Converter/index.html +++ b/Other_Example/Assignment Exercises/Temperature Converter/index.html @@ -1,120 +1,120 @@ - - - - - Temperature Converter - - - -
    -

    Temperature Converter

    - - - - -
    -
    - - - - + + + + + Temperature Converter + + + +
    +

    Temperature Converter

    + + + + +
    +
    + + + + diff --git a/Other_Example/fix_header/index.html b/Other_Example/fix_header/index.html index 2c0bf56..6434f5a 100644 --- a/Other_Example/fix_header/index.html +++ b/Other_Example/fix_header/index.html @@ -1,117 +1,117 @@ - - - - - - Document - - - - - - -
    -

    joy samosa point

    -
    - - -
    -

    - Lorem ipsum dolor sit amet consectetur adipisicing elit. At, placeat! Cupiditate cumque distinctio, tempore deleniti aliquam quisquam reiciendis magni eos beatae reprehenderit voluptates eaque nobis officia iusto harum! Excepturi, obcaecati. -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    JoyJoyJoyJoyJoy
    JoyJoyJoyJoyJoy
    JoyJoyJoyJoyJoy
    JoyJoyJoyJoyJoy
    JoyJoyJoyJoyJoy
    JoyJoyJoyJoyJoy
    JoyJoyJoyJoyJoy
    -
    - - - - - + + + + + + Document + + + + + + +
    +

    joy samosa point

    +
    + + +
    +

    + Lorem ipsum dolor sit amet consectetur adipisicing elit. At, placeat! Cupiditate cumque distinctio, tempore deleniti aliquam quisquam reiciendis magni eos beatae reprehenderit voluptates eaque nobis officia iusto harum! Excepturi, obcaecati. +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    JoyJoyJoyJoyJoy
    JoyJoyJoyJoyJoy
    JoyJoyJoyJoyJoy
    JoyJoyJoyJoyJoy
    JoyJoyJoyJoyJoy
    JoyJoyJoyJoyJoy
    JoyJoyJoyJoyJoy
    +
    + + + + + diff --git a/README.md b/README.md index f2e5282..6a0a055 100644 --- a/README.md +++ b/README.md @@ -1,29 +1,29 @@ -# JavaScript-Tutorial -Learn JavaScript with Pankaj in this concise and practical tutorial series, covering basics and advanced topics for web development - - -| No. | Topic Name | -|------|-----------------------------------------| -| 01. | Introduction | -| 02. | Variables | -| 03. | Take Input | -| 04. | Comments | -| 05. | Operators | -| 08. | Basic Type Conversion | -| 09. | if-else Statement | -| 10. | Switch Statement | -| 11. | Ternary Operator | -| 12. | for Loop | -| 13. | while Loop | -| 14. | break and continue | -| 15. | Arrow Functions | -| 16. | Functions | -| 17. | Global and Local Scope | -| 18. | Objects | -| 19. | Strings | -| 20. | String Methods and Properties You Must Know | -| 21. | Array Methods You Must Know | -| 22. | Arrays | -| 23. | for...in and for...of Loop | -| 24. | map, filter, reduce | -| 25. | Numbers | +# JavaScript-Tutorial +Learn JavaScript with Pankaj in this concise and practical tutorial series, covering basics and advanced topics for web development + + +| No. | Topic Name | +|------|-----------------------------------------| +| 01. | Introduction | +| 02. | Variables | +| 03. | Take Input | +| 04. | Comments | +| 05. | Operators | +| 08. | Basic Type Conversion | +| 09. | if-else Statement | +| 10. | Switch Statement | +| 11. | Ternary Operator | +| 12. | for Loop | +| 13. | while Loop | +| 14. | break and continue | +| 15. | Arrow Functions | +| 16. | Functions | +| 17. | Global and Local Scope | +| 18. | Objects | +| 19. | Strings | +| 20. | String Methods and Properties You Must Know | +| 21. | Array Methods You Must Know | +| 22. | Arrays | +| 23. | for...in and for...of Loop | +| 24. | map, filter, reduce | +| 25. | Numbers | diff --git a/Task/SalarySystem.md b/Task/SalarySystem.md index 8797b3b..01feeaa 100644 --- a/Task/SalarySystem.md +++ b/Task/SalarySystem.md @@ -1 +1 @@ -![Salary System](https://github.com/Pankaj-Str/JavaScript-Tutorial/assets/36913690/2aec83aa-9523-4c0d-8fd8-7f1dfe69e8b2) +![Salary System](https://github.com/Pankaj-Str/JavaScript-Tutorial/assets/36913690/2aec83aa-9523-4c0d-8fd8-7f1dfe69e8b2) diff --git a/Task/employee salary part one.js b/Task/employee salary part one.js index b9fdd7c..1efa882 100644 --- a/Task/employee salary part one.js +++ b/Task/employee salary part one.js @@ -1,37 +1,37 @@ -// Employee Salary Management System - -class Employee { - constructor(id, name, position, baseSalary) { - this.id = id; - this.name = name; - this.position = position; - this.baseSalary = baseSalary; - this.benefits = []; - } - - // Calculate total salary including benefits - calculateTotalSalary() { - const benefitsTotal = this.benefits.reduce((sum, benefit) => sum + benefit.amount, 0); - return this.baseSalary + benefitsTotal; - } - - // Add a benefit to the employee - addBenefit(benefit) { - this.benefits.push(benefit); - } - - // Generate employee details - getEmployeeDetails() { - return { - id: this.id, - name: this.name, - position: this.position, - baseSalary: this.baseSalary, - totalSalary: this.calculateTotalSalary(), - benefits: this.benefits - }; - } -} - -class Benefit { +// Employee Salary Management System + +class Employee { + constructor(id, name, position, baseSalary) { + this.id = id; + this.name = name; + this.position = position; + this.baseSalary = baseSalary; + this.benefits = []; + } + + // Calculate total salary including benefits + calculateTotalSalary() { + const benefitsTotal = this.benefits.reduce((sum, benefit) => sum + benefit.amount, 0); + return this.baseSalary + benefitsTotal; + } + + // Add a benefit to the employee + addBenefit(benefit) { + this.benefits.push(benefit); + } + + // Generate employee details + getEmployeeDetails() { + return { + id: this.id, + name: this.name, + position: this.position, + baseSalary: this.baseSalary, + totalSalary: this.calculateTotalSalary(), + benefits: this.benefits + }; + } +} + +class Benefit { constructor(name, amount) { \ No newline at end of file diff --git a/Task/employee salary system complete code.js b/Task/employee salary system complete code.js index fe71f86..759a599 100644 --- a/Task/employee salary system complete code.js +++ b/Task/employee salary system complete code.js @@ -1,307 +1,307 @@ -// Comprehensive Employee Salary Management System - -// Utility Class for Validation and Helpers -class ValidationUtils { - static validateEmail(email) { - const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; - return emailRegex.test(email); - } - - static validateSalary(salary) { - return salary > 0 && salary < 1000000; - } - - static generateUniqueId() { - return 'EMP-' + Math.random().toString(36).substr(2, 9).toUpperCase(); - } -} - -// Tax Calculation Utility -class TaxCalculator { - static calculateTax(grossSalary) { - // Progressive tax brackets (simplified) - const taxBrackets = [ - { min: 0, max: 50000, rate: 0.10 }, - { min: 50001, max: 100000, rate: 0.20 }, - { min: 100001, max: 250000, rate: 0.30 }, - { min: 250001, max: Infinity, rate: 0.40 } - ]; - - let totalTax = 0; - let remainingSalary = grossSalary; - - for (let bracket of taxBrackets) { - if (remainingSalary > 0) { - const taxableAmount = Math.min(remainingSalary, bracket.max - bracket.min); - totalTax += taxableAmount * bracket.rate; - remainingSalary -= taxableAmount; - } - } - - return { - grossSalary, - totalTax, - netSalary: grossSalary - totalTax - }; - } -} - -// Benefit Management Class -class BenefitManager { - constructor() { - this.benefits = []; - } - - addBenefit(benefit) { - this.benefits.push(benefit); - } - - removeBenefit(benefitName) { - this.benefits = this.benefits.filter(b => b.name !== benefitName); - } - - calculateTotalBenefitValue() { - return this.benefits.reduce((total, benefit) => total + benefit.value, 0); - } - - getBenefitsSummary() { - return this.benefits.map(benefit => ({ - name: benefit.name, - value: benefit.value, - type: benefit.type - })); - } -} - -// Performance Evaluation Class -class PerformanceEvaluator { - constructor() { - this.performanceRecords = []; - } - - addPerformanceRecord(record) { - this.performanceRecords.push({ - date: new Date(), - ...record - }); - } - - calculatePerformanceScore() { - if (this.performanceRecords.length === 0) return 0; - - const totalScore = this.performanceRecords.reduce((sum, record) => sum + record.score, 0); - return totalScore / this.performanceRecords.length; - } - - getPerformanceTrend() { - return this.performanceRecords.map(record => ({ - date: record.date, - score: record.score, - project: record.project - })); - } -} - -// Employee Class -class Employee { - constructor(details) { - // Validate and set basic information - if (!details.name) throw new Error('Name is required'); - if (!ValidationUtils.validateEmail(details.email)) throw new Error('Invalid email'); - - this.id = details.id || ValidationUtils.generateUniqueId(); - this.name = details.name; - this.email = details.email; - this.department = details.department || 'Unassigned'; - this.position = details.position || 'Entry Level'; - this.hireDate = details.hireDate || new Date(); - this.baseSalary = details.baseSalary || 0; - this.employmentType = details.employmentType || 'Full-time'; - - // Composition for additional features - this.benefitManager = new BenefitManager(); - this.performanceEvaluator = new PerformanceEvaluator(); - } - - // Salary and Compensation Methods - calculateGrossSalary(includeBonus = true) { - let grossSalary = this.baseSalary; - - // Performance-based bonus - if (includeBonus) { - const performanceScore = this.performanceEvaluator.calculatePerformanceScore(); - const bonusMultiplier = this.calculateBonusMultiplier(performanceScore); - grossSalary += this.baseSalary * bonusMultiplier; - } - - // Add benefits value - grossSalary += this.benefitManager.calculateTotalBenefitValue(); - - return grossSalary; - } - - calculateBonusMultiplier(performanceScore) { - if (performanceScore >= 9) return 0.20; // Exceptional - if (performanceScore >= 7) return 0.15; // Excellent - if (performanceScore >= 5) return 0.10; // Good - return 0.05; // Needs improvement - } - - calculateNetSalary() { - const grossSalary = this.calculateGrossSalary(); - const taxCalculation = TaxCalculator.calculateTax(grossSalary); - return taxCalculation; - } - - // Benefit Management Delegation - addBenefit(benefit) { - this.benefitManager.addBenefit(benefit); - } - - removeBenefit(benefitName) { - this.benefitManager.removeBenefit(benefitName); - } - - // Performance Management Delegation - addPerformanceRecord(record) { - this.performanceEvaluator.addPerformanceRecord(record); - } - - // Comprehensive Employee Profile - getEmployeeProfile() { - const taxDetails = this.calculateNetSalary(); - - return { - personalInfo: { - id: this.id, - name: this.name, - email: this.email, - department: this.department, - position: this.position, - hireDate: this.hireDate, - employmentType: this.employmentType - }, - compensation: { - baseSalary: this.baseSalary, - grossSalary: taxDetails.grossSalary, - netSalary: taxDetails.netSalary, - taxDetails: { - totalTax: taxDetails.totalTax, - taxRate: (taxDetails.totalTax / taxDetails.grossSalary * 100).toFixed(2) + '%' - } - }, - benefits: this.benefitManager.getBenefitsSummary(), - performance: { - averageScore: this.performanceEvaluator.calculatePerformanceScore(), - performanceTrend: this.performanceEvaluator.getPerformanceTrend() - } - }; - } -} - -// Payroll Processing Class -class PayrollProcessor { - constructor() { - this.employees = []; - } - - addEmployee(employee) { - this.employees.push(employee); - } - - processMonthlyPayroll() { - return this.employees.map(employee => { - const profile = employee.getEmployeeProfile(); - return { - employeeId: employee.id, - employeeName: employee.name, - netSalary: profile.compensation.netSalary, - paymentMethod: 'Direct Deposit' - }; - }); - } - - generateDepartmentSalarySummary() { - const departmentSummary = {}; - - this.employees.forEach(employee => { - const { department } = employee; - if (!departmentSummary[department]) { - departmentSummary[department] = { - totalEmployees: 0, - totalSalary: 0, - averageSalary: 0 - }; - } - - const profile = employee.getEmployeeProfile(); - departmentSummary[department].totalEmployees++; - departmentSummary[department].totalSalary += profile.compensation.netSalary; - }); - - // Calculate average salaries - Object.keys(departmentSummary).forEach(dept => { - const summary = departmentSummary[dept]; - summary.averageSalary = summary.totalSalary / summary.totalEmployees; - }); - - return departmentSummary; - } -} - -// Example Usage and Demonstration -function demonstrateSalarySystem() { - // Create Payroll Processor - const payrollSystem = new PayrollProcessor(); - - // Create Employees - const john = new Employee({ - name: 'John Doe', - email: 'john.doe@company.com', - department: 'Engineering', - position: 'Senior Developer', - baseSalary: 85000, - employmentType: 'Full-time' - }); - - // Add Benefits - john.addBenefit({ - name: 'Health Insurance', - value: 5000, - type: 'Healthcare' - }); - - john.addBenefit({ - name: 'Retirement Plan', - value: 4000, - type: 'Pension' - }); - - // Add Performance Records - john.addPerformanceRecord({ - project: 'Backend Redesign', - score: 8.5, - description: 'Exceptional project delivery' - }); - - // Add Employee to Payroll - payrollSystem.addEmployee(john); - - // Generate Reports - console.log('Employee Profile:', john.getEmployeeProfile()); - console.log('Monthly Payroll:', payrollSystem.processMonthlyPayroll()); - console.log('Department Salary Summary:', payrollSystem.generateDepartmentSalarySummary()); -} - -// Run the demonstration -demonstrateSalarySystem(); - -// Export classes for potential module usage -export { - Employee, - PayrollProcessor, - TaxCalculator, - ValidationUtils, - BenefitManager, - PerformanceEvaluator +// Comprehensive Employee Salary Management System + +// Utility Class for Validation and Helpers +class ValidationUtils { + static validateEmail(email) { + const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; + return emailRegex.test(email); + } + + static validateSalary(salary) { + return salary > 0 && salary < 1000000; + } + + static generateUniqueId() { + return 'EMP-' + Math.random().toString(36).substr(2, 9).toUpperCase(); + } +} + +// Tax Calculation Utility +class TaxCalculator { + static calculateTax(grossSalary) { + // Progressive tax brackets (simplified) + const taxBrackets = [ + { min: 0, max: 50000, rate: 0.10 }, + { min: 50001, max: 100000, rate: 0.20 }, + { min: 100001, max: 250000, rate: 0.30 }, + { min: 250001, max: Infinity, rate: 0.40 } + ]; + + let totalTax = 0; + let remainingSalary = grossSalary; + + for (let bracket of taxBrackets) { + if (remainingSalary > 0) { + const taxableAmount = Math.min(remainingSalary, bracket.max - bracket.min); + totalTax += taxableAmount * bracket.rate; + remainingSalary -= taxableAmount; + } + } + + return { + grossSalary, + totalTax, + netSalary: grossSalary - totalTax + }; + } +} + +// Benefit Management Class +class BenefitManager { + constructor() { + this.benefits = []; + } + + addBenefit(benefit) { + this.benefits.push(benefit); + } + + removeBenefit(benefitName) { + this.benefits = this.benefits.filter(b => b.name !== benefitName); + } + + calculateTotalBenefitValue() { + return this.benefits.reduce((total, benefit) => total + benefit.value, 0); + } + + getBenefitsSummary() { + return this.benefits.map(benefit => ({ + name: benefit.name, + value: benefit.value, + type: benefit.type + })); + } +} + +// Performance Evaluation Class +class PerformanceEvaluator { + constructor() { + this.performanceRecords = []; + } + + addPerformanceRecord(record) { + this.performanceRecords.push({ + date: new Date(), + ...record + }); + } + + calculatePerformanceScore() { + if (this.performanceRecords.length === 0) return 0; + + const totalScore = this.performanceRecords.reduce((sum, record) => sum + record.score, 0); + return totalScore / this.performanceRecords.length; + } + + getPerformanceTrend() { + return this.performanceRecords.map(record => ({ + date: record.date, + score: record.score, + project: record.project + })); + } +} + +// Employee Class +class Employee { + constructor(details) { + // Validate and set basic information + if (!details.name) throw new Error('Name is required'); + if (!ValidationUtils.validateEmail(details.email)) throw new Error('Invalid email'); + + this.id = details.id || ValidationUtils.generateUniqueId(); + this.name = details.name; + this.email = details.email; + this.department = details.department || 'Unassigned'; + this.position = details.position || 'Entry Level'; + this.hireDate = details.hireDate || new Date(); + this.baseSalary = details.baseSalary || 0; + this.employmentType = details.employmentType || 'Full-time'; + + // Composition for additional features + this.benefitManager = new BenefitManager(); + this.performanceEvaluator = new PerformanceEvaluator(); + } + + // Salary and Compensation Methods + calculateGrossSalary(includeBonus = true) { + let grossSalary = this.baseSalary; + + // Performance-based bonus + if (includeBonus) { + const performanceScore = this.performanceEvaluator.calculatePerformanceScore(); + const bonusMultiplier = this.calculateBonusMultiplier(performanceScore); + grossSalary += this.baseSalary * bonusMultiplier; + } + + // Add benefits value + grossSalary += this.benefitManager.calculateTotalBenefitValue(); + + return grossSalary; + } + + calculateBonusMultiplier(performanceScore) { + if (performanceScore >= 9) return 0.20; // Exceptional + if (performanceScore >= 7) return 0.15; // Excellent + if (performanceScore >= 5) return 0.10; // Good + return 0.05; // Needs improvement + } + + calculateNetSalary() { + const grossSalary = this.calculateGrossSalary(); + const taxCalculation = TaxCalculator.calculateTax(grossSalary); + return taxCalculation; + } + + // Benefit Management Delegation + addBenefit(benefit) { + this.benefitManager.addBenefit(benefit); + } + + removeBenefit(benefitName) { + this.benefitManager.removeBenefit(benefitName); + } + + // Performance Management Delegation + addPerformanceRecord(record) { + this.performanceEvaluator.addPerformanceRecord(record); + } + + // Comprehensive Employee Profile + getEmployeeProfile() { + const taxDetails = this.calculateNetSalary(); + + return { + personalInfo: { + id: this.id, + name: this.name, + email: this.email, + department: this.department, + position: this.position, + hireDate: this.hireDate, + employmentType: this.employmentType + }, + compensation: { + baseSalary: this.baseSalary, + grossSalary: taxDetails.grossSalary, + netSalary: taxDetails.netSalary, + taxDetails: { + totalTax: taxDetails.totalTax, + taxRate: (taxDetails.totalTax / taxDetails.grossSalary * 100).toFixed(2) + '%' + } + }, + benefits: this.benefitManager.getBenefitsSummary(), + performance: { + averageScore: this.performanceEvaluator.calculatePerformanceScore(), + performanceTrend: this.performanceEvaluator.getPerformanceTrend() + } + }; + } +} + +// Payroll Processing Class +class PayrollProcessor { + constructor() { + this.employees = []; + } + + addEmployee(employee) { + this.employees.push(employee); + } + + processMonthlyPayroll() { + return this.employees.map(employee => { + const profile = employee.getEmployeeProfile(); + return { + employeeId: employee.id, + employeeName: employee.name, + netSalary: profile.compensation.netSalary, + paymentMethod: 'Direct Deposit' + }; + }); + } + + generateDepartmentSalarySummary() { + const departmentSummary = {}; + + this.employees.forEach(employee => { + const { department } = employee; + if (!departmentSummary[department]) { + departmentSummary[department] = { + totalEmployees: 0, + totalSalary: 0, + averageSalary: 0 + }; + } + + const profile = employee.getEmployeeProfile(); + departmentSummary[department].totalEmployees++; + departmentSummary[department].totalSalary += profile.compensation.netSalary; + }); + + // Calculate average salaries + Object.keys(departmentSummary).forEach(dept => { + const summary = departmentSummary[dept]; + summary.averageSalary = summary.totalSalary / summary.totalEmployees; + }); + + return departmentSummary; + } +} + +// Example Usage and Demonstration +function demonstrateSalarySystem() { + // Create Payroll Processor + const payrollSystem = new PayrollProcessor(); + + // Create Employees + const john = new Employee({ + name: 'John Doe', + email: 'john.doe@company.com', + department: 'Engineering', + position: 'Senior Developer', + baseSalary: 85000, + employmentType: 'Full-time' + }); + + // Add Benefits + john.addBenefit({ + name: 'Health Insurance', + value: 5000, + type: 'Healthcare' + }); + + john.addBenefit({ + name: 'Retirement Plan', + value: 4000, + type: 'Pension' + }); + + // Add Performance Records + john.addPerformanceRecord({ + project: 'Backend Redesign', + score: 8.5, + description: 'Exceptional project delivery' + }); + + // Add Employee to Payroll + payrollSystem.addEmployee(john); + + // Generate Reports + console.log('Employee Profile:', john.getEmployeeProfile()); + console.log('Monthly Payroll:', payrollSystem.processMonthlyPayroll()); + console.log('Department Salary Summary:', payrollSystem.generateDepartmentSalarySummary()); +} + +// Run the demonstration +demonstrateSalarySystem(); + +// Export classes for potential module usage +export { + Employee, + PayrollProcessor, + TaxCalculator, + ValidationUtils, + BenefitManager, + PerformanceEvaluator }; \ No newline at end of file diff --git a/Task/employee salary with creative features.js b/Task/employee salary with creative features.js index dd50f38..a793f9b 100644 --- a/Task/employee salary with creative features.js +++ b/Task/employee salary with creative features.js @@ -1,128 +1,128 @@ -// Enhanced Employee Salary Management System with Creative Features - -class Employee { - constructor(id, name, position, baseSalary) { - this.id = id; - this.name = name; - this.position = position; - this.baseSalary = baseSalary; - this.benefits = []; - this.performanceHistory = []; - this.creativityScore = 0; - this.specialTalents = []; - } - - // Innovative salary calculation method - calculateTotalSalary() { - // Base salary + benefits + creativity bonus - const benefitsTotal = this.benefits.reduce((sum, benefit) => sum + benefit.amount, 0); - const creativityBonus = this.calculateCreativityBonus(); - return this.baseSalary + benefitsTotal + creativityBonus; - } - - // Add a special talent to the employee - addSpecialTalent(talent) { - this.specialTalents.push({ - name: talent.name, - description: talent.description, - potentialImpact: talent.potentialImpact - }); - } - - // Track performance and creativity - addPerformanceRecord(record) { - this.performanceHistory.push({ - date: new Date(), - project: record.project, - rating: record.rating, - creativity: record.creativity - }); - - // Update creativity score - this.updateCreativityScore(record.creativity); - } - - // Calculate creativity bonus - calculateCreativityBonus() { - // More creative employees get higher bonuses - return this.creativityScore * 50; - } - - // Update creativity score based on performance - updateCreativityScore(creativityRating) { - this.creativityScore += creativityRating; - } - - // Generate a comprehensive employee profile - getEnhancedEmployeeProfile() { - return { - basicInfo: { - id: this.id, - name: this.name, - position: this.position - }, - compensation: { - baseSalary: this.baseSalary, - totalSalary: this.calculateTotalSalary(), - benefits: this.benefits - }, - creativity: { - creativityScore: this.creativityScore, - specialTalents: this.specialTalents - }, - performanceHistory: this.performanceHistory - }; - } - - // Recommend career growth opportunities - getCareerGrowthRecommendations() { - const recommendations = []; - - // Analyze special talents and performance - this.specialTalents.forEach(talent => { - recommendations.push({ - type: 'Talent Development', - suggestion: `Explore advanced training in ${talent.name}`, - potentialImpact: talent.potentialImpact - }); - }); - - // Check for consistent high creativity - if (this.creativityScore > 100) { - recommendations.push({ - type: 'Innovation Track', - suggestion: 'Consider moving to an innovation-focused role', - rationale: 'High creativity potential' - }); - } - - return recommendations; - } -} - -// Example Usage -const innovativeEmployee = new Employee(1, 'Alice Dreamweaver', 'Creative Strategist', 75000); - -// Add special talents -innovativeEmployee.addSpecialTalent({ - name: 'Design Thinking', - description: 'Exceptional ability to solve complex problems creatively', - potentialImpact: 'High' -}); - -// Track performance -innovativeEmployee.addPerformanceRecord({ - project: 'Radical Product Redesign', - rating: 9.5, - creativity: 9 -}); - -// Get enhanced profile -const employeeProfile = innovativeEmployee.getEnhancedEmployeeProfile(); -console.log(employeeProfile); - -// Get career growth recommendations -const growthPaths = innovativeEmployee.getCareerGrowthRecommendations(); -console.log(growthPaths); - +// Enhanced Employee Salary Management System with Creative Features + +class Employee { + constructor(id, name, position, baseSalary) { + this.id = id; + this.name = name; + this.position = position; + this.baseSalary = baseSalary; + this.benefits = []; + this.performanceHistory = []; + this.creativityScore = 0; + this.specialTalents = []; + } + + // Innovative salary calculation method + calculateTotalSalary() { + // Base salary + benefits + creativity bonus + const benefitsTotal = this.benefits.reduce((sum, benefit) => sum + benefit.amount, 0); + const creativityBonus = this.calculateCreativityBonus(); + return this.baseSalary + benefitsTotal + creativityBonus; + } + + // Add a special talent to the employee + addSpecialTalent(talent) { + this.specialTalents.push({ + name: talent.name, + description: talent.description, + potentialImpact: talent.potentialImpact + }); + } + + // Track performance and creativity + addPerformanceRecord(record) { + this.performanceHistory.push({ + date: new Date(), + project: record.project, + rating: record.rating, + creativity: record.creativity + }); + + // Update creativity score + this.updateCreativityScore(record.creativity); + } + + // Calculate creativity bonus + calculateCreativityBonus() { + // More creative employees get higher bonuses + return this.creativityScore * 50; + } + + // Update creativity score based on performance + updateCreativityScore(creativityRating) { + this.creativityScore += creativityRating; + } + + // Generate a comprehensive employee profile + getEnhancedEmployeeProfile() { + return { + basicInfo: { + id: this.id, + name: this.name, + position: this.position + }, + compensation: { + baseSalary: this.baseSalary, + totalSalary: this.calculateTotalSalary(), + benefits: this.benefits + }, + creativity: { + creativityScore: this.creativityScore, + specialTalents: this.specialTalents + }, + performanceHistory: this.performanceHistory + }; + } + + // Recommend career growth opportunities + getCareerGrowthRecommendations() { + const recommendations = []; + + // Analyze special talents and performance + this.specialTalents.forEach(talent => { + recommendations.push({ + type: 'Talent Development', + suggestion: `Explore advanced training in ${talent.name}`, + potentialImpact: talent.potentialImpact + }); + }); + + // Check for consistent high creativity + if (this.creativityScore > 100) { + recommendations.push({ + type: 'Innovation Track', + suggestion: 'Consider moving to an innovation-focused role', + rationale: 'High creativity potential' + }); + } + + return recommendations; + } +} + +// Example Usage +const innovativeEmployee = new Employee(1, 'Alice Dreamweaver', 'Creative Strategist', 75000); + +// Add special talents +innovativeEmployee.addSpecialTalent({ + name: 'Design Thinking', + description: 'Exceptional ability to solve complex problems creatively', + potentialImpact: 'High' +}); + +// Track performance +innovativeEmployee.addPerformanceRecord({ + project: 'Radical Product Redesign', + rating: 9.5, + creativity: 9 +}); + +// Get enhanced profile +const employeeProfile = innovativeEmployee.getEnhancedEmployeeProfile(); +console.log(employeeProfile); + +// Get career growth recommendations +const growthPaths = innovativeEmployee.getCareerGrowthRecommendations(); +console.log(growthPaths); + export default Employee; \ No newline at end of file diff --git a/Task/student Market assignment.md b/Task/student Market assignment.md index 2d20816..1fc8670 100644 --- a/Task/student Market assignment.md +++ b/Task/student Market assignment.md @@ -1,123 +1,123 @@ -##Assignment: Advanced Student Marksheet Application - -Objective - -Develop an advanced Student Marksheet Application using HTML, CSS, and JavaScript with extended features for data management and interactivity. - -Problem Statement - -Design a feature-rich application that allows users to: - 1. Input student details (Name, Roll Number, and Marks in three subjects). - 2. Perform advanced calculations: - • Total Marks - • Percentage - • Grade (based on a customizable grading scale). - 3. Manage data through dynamic functionalities: - • Add, edit, and delete student records. - • Sort student records by Name, Roll Number, or Percentage. - • Filter records based on grades or a specific percentage range. - -Functional Requirements - -Core Features - 1. Input Fields: - • Student Name - • Roll Number - • Marks in three subjects (e.g., Math, Science, and English). - 2. Dynamic Calculations: - • Total Marks: Sum of marks in the three subjects. - • Percentage: (Total Marks / Maximum Marks) * 100. - • Grade: - • Implement a customizable grading system (e.g., A+, A, B, C, Fail). - • Allow users to adjust grade thresholds (e.g., 90%+ = A+). - 3. Data Management: - • Add new records dynamically to a table. - • Edit existing records (e.g., update marks or student details). - • Delete specific records. - 4. Table Interactivity: - • Sort records dynamically based on: - • Student Name (Alphabetically) - • Roll Number - • Percentage (Highest to Lowest). - • Filter records by: - • Grade (e.g., Show only A+ students). - • Percentage range (e.g., 70%-90%). - -Advanced Features - 1. Search Functionality: - • Enable users to search for specific students by Name or Roll Number. - 2. Data Persistence: - • Save the student data in Local Storage so it persists across browser sessions. - 3. Bulk Upload: - • Allow users to upload student data in bulk using a CSV file. - • Validate and parse the data to add it to the table dynamically. - 4. Export Functionality: - • Provide an option to export the student records as a CSV file. - 5. Responsive Design: - • Ensure the application is fully responsive and works seamlessly across different screen sizes. - -Technical Requirements - -HTML - • Create a structured form for student input. - • Design a table to display the results with sortable and filterable columns. - -CSS - • Use advanced CSS features for a polished UI: - • Hover effects for table rows. - • Responsive layout with media queries. - • Styled buttons and modals for editing records. - -JavaScript - • Use JavaScript to: - • Perform calculations (Total, Percentage, Grade). - • Manage data (Add, Edit, Delete, Sort, Filter). - • Implement Local Storage for data persistence. - • Handle file uploads and exports. - -Assignment Deliverables - 1. A fully functional Student Marksheet Application with: - • Add, edit, delete, sort, and filter functionalities. - • Local Storage implementation. - • CSV upload and export features. - 2. Code Structure: - • Organize the code into separate files: - • index.html: For the structure. - • styles.css: For styling. - • script.js: For JavaScript logic. - 3. Code Documentation: - • Include comments in your code to explain the logic and functionality. - -Grading Criteria - -Task Marks -Proper HTML structure 10 -Advanced CSS styling 15 -JavaScript for dynamic calculations 15 -Add, Edit, Delete functionality 20 -Sort and Filter functionalities 20 -Local Storage for data persistence 10 -File Upload and Export 10 - -Example Scenarios - 1. Scenario 1: - • Add a student named “John Doe” with Roll Number “101” and marks: Math = 85, Science = 78, English = 92. - • The application calculates Total Marks = 255, Percentage = 85%, Grade = A. - 2. Scenario 2: - • Edit John Doe’s Science marks to 88. - • Total Marks and Percentage are recalculated dynamically. - 3. Scenario 3: - • Filter the table to display only students with a grade of “A+”. - 4. Scenario 4: - • Upload a CSV file with student data. - • Validate the data, calculate results, and display them in the table. - 5. Scenario 5: - • Export the current table records as a CSV file. - -Advanced Challenges (Optional) - 1. Add a Graphical Representation: - • Use a JavaScript chart library (e.g., Chart.js) to display a bar chart showing the distribution of grades. - 2. Add Authentication: - • Implement a basic login system to secure the application. - 3. Add Dark Mode: +##Assignment: Advanced Student Marksheet Application + +Objective + +Develop an advanced Student Marksheet Application using HTML, CSS, and JavaScript with extended features for data management and interactivity. + +Problem Statement + +Design a feature-rich application that allows users to: + 1. Input student details (Name, Roll Number, and Marks in three subjects). + 2. Perform advanced calculations: + • Total Marks + • Percentage + • Grade (based on a customizable grading scale). + 3. Manage data through dynamic functionalities: + • Add, edit, and delete student records. + • Sort student records by Name, Roll Number, or Percentage. + • Filter records based on grades or a specific percentage range. + +Functional Requirements + +Core Features + 1. Input Fields: + • Student Name + • Roll Number + • Marks in three subjects (e.g., Math, Science, and English). + 2. Dynamic Calculations: + • Total Marks: Sum of marks in the three subjects. + • Percentage: (Total Marks / Maximum Marks) * 100. + • Grade: + • Implement a customizable grading system (e.g., A+, A, B, C, Fail). + • Allow users to adjust grade thresholds (e.g., 90%+ = A+). + 3. Data Management: + • Add new records dynamically to a table. + • Edit existing records (e.g., update marks or student details). + • Delete specific records. + 4. Table Interactivity: + • Sort records dynamically based on: + • Student Name (Alphabetically) + • Roll Number + • Percentage (Highest to Lowest). + • Filter records by: + • Grade (e.g., Show only A+ students). + • Percentage range (e.g., 70%-90%). + +Advanced Features + 1. Search Functionality: + • Enable users to search for specific students by Name or Roll Number. + 2. Data Persistence: + • Save the student data in Local Storage so it persists across browser sessions. + 3. Bulk Upload: + • Allow users to upload student data in bulk using a CSV file. + • Validate and parse the data to add it to the table dynamically. + 4. Export Functionality: + • Provide an option to export the student records as a CSV file. + 5. Responsive Design: + • Ensure the application is fully responsive and works seamlessly across different screen sizes. + +Technical Requirements + +HTML + • Create a structured form for student input. + • Design a table to display the results with sortable and filterable columns. + +CSS + • Use advanced CSS features for a polished UI: + • Hover effects for table rows. + • Responsive layout with media queries. + • Styled buttons and modals for editing records. + +JavaScript + • Use JavaScript to: + • Perform calculations (Total, Percentage, Grade). + • Manage data (Add, Edit, Delete, Sort, Filter). + • Implement Local Storage for data persistence. + • Handle file uploads and exports. + +Assignment Deliverables + 1. A fully functional Student Marksheet Application with: + • Add, edit, delete, sort, and filter functionalities. + • Local Storage implementation. + • CSV upload and export features. + 2. Code Structure: + • Organize the code into separate files: + • index.html: For the structure. + • styles.css: For styling. + • script.js: For JavaScript logic. + 3. Code Documentation: + • Include comments in your code to explain the logic and functionality. + +Grading Criteria + +Task Marks +Proper HTML structure 10 +Advanced CSS styling 15 +JavaScript for dynamic calculations 15 +Add, Edit, Delete functionality 20 +Sort and Filter functionalities 20 +Local Storage for data persistence 10 +File Upload and Export 10 + +Example Scenarios + 1. Scenario 1: + • Add a student named “John Doe” with Roll Number “101” and marks: Math = 85, Science = 78, English = 92. + • The application calculates Total Marks = 255, Percentage = 85%, Grade = A. + 2. Scenario 2: + • Edit John Doe’s Science marks to 88. + • Total Marks and Percentage are recalculated dynamically. + 3. Scenario 3: + • Filter the table to display only students with a grade of “A+”. + 4. Scenario 4: + • Upload a CSV file with student data. + • Validate the data, calculate results, and display them in the table. + 5. Scenario 5: + • Export the current table records as a CSV file. + +Advanced Challenges (Optional) + 1. Add a Graphical Representation: + • Use a JavaScript chart library (e.g., Chart.js) to display a bar chart showing the distribution of grades. + 2. Add Authentication: + • Implement a basic login system to secure the application. + 3. Add Dark Mode: • Provide a toggle option for dark mode. \ No newline at end of file diff --git a/Task/student mark sheet assignment question.js b/Task/student mark sheet assignment question.js index 61b1ff0..e2dc878 100644 --- a/Task/student mark sheet assignment question.js +++ b/Task/student mark sheet assignment question.js @@ -1,242 +1,242 @@ -/** - * Advanced Student Marksheet Management System - * Comprehensive Implementation - */ -class StudentMarksheet { - /** - * Constructor to initialize student details - * @param {string} name - Full name of the student - * @param {number} studentId - Unique student identifier - * @param {Object} subjects - Object containing subject names and marks - */ - constructor(name, studentId, subjects) { - this.validateStudentData(name, studentId, subjects); - - this.name = name; - this.studentId = studentId; - this.subjects = subjects; - } - - /** - * Comprehensive data validation method - * @param {string} name - * @param {number} studentId - * @param {Object} subjects - * @throws {Error} For invalid input - */ - validateStudentData(name, studentId, subjects) { - // Name validation - if (typeof name !== 'string' || name.trim().split(' ').length < 2) { - throw new Error('Name must be at least two words'); - } - - // Student ID validation - if (typeof studentId !== 'number' || - !Number.isInteger(studentId) || - studentId < 100000 || - studentId > 999999) { - throw new Error('Student ID must be a 6-digit positive number'); - } - - // Subjects validation - if (!subjects || typeof subjects !== 'object' || Object.keys(subjects).length < 5) { - throw new Error('Minimum of 5 subjects required'); - } - - // Subject marks validation - for (const [subject, mark] of Object.entries(subjects)) { - if (typeof mark !== 'number' || mark < 0 || mark > 100) { - throw new Error(`Invalid mark for ${subject}. Marks must be between 0-100`); - } - } - } - - /** - * Generate comprehensive performance report - * @returns {Object} Performance analytics - */ - generatePerformanceReport() { - const subjects = this.subjects; - const totalMarks = Object.values(subjects).reduce((sum, mark) => sum + mark, 0); - const averageMarks = totalMarks / Object.keys(subjects).length; - - return { - name: this.name, - studentId: this.studentId, - totalMarks: totalMarks, - averageMarks: averageMarks.toFixed(2), - highestMark: Math.max(...Object.values(subjects)), - lowestMark: Math.min(...Object.values(subjects)), - grade: this.calculateGrade(averageMarks), - subjectPerformance: subjects - }; - } - - /** - * Calculate performance grade - * @param {number} averageMarks - * @returns {string} Grade - */ - calculateGrade(averageMarks) { - if (averageMarks >= 90) return 'A+'; - if (averageMarks >= 80) return 'A'; - if (averageMarks >= 70) return 'B'; - if (averageMarks >= 60) return 'C'; - if (averageMarks >= 50) return 'D'; - return 'F'; - } - - /** - * Calculate weighted average with subject weights - * @param {Object} weightedSubjects - Subjects with weights - * @returns {number} Weighted average score - */ - calculateWeightedAverage(weightedSubjects = {}) { - // Default weights if not provided - const defaultWeights = { - 'Mathematics': 1.2, - 'Science': 1.1, - 'English': 1.0, - 'History': 1.0, - 'Computer Science': 1.1 - }; - - const weights = { ...defaultWeights, ...weightedSubjects }; - let totalWeightedMarks = 0; - let totalWeight = 0; - - for (const [subject, mark] of Object.entries(this.subjects)) { - const weight = weights[subject] || 1.0; - totalWeightedMarks += mark * weight; - totalWeight += weight; - } - - return (totalWeightedMarks / totalWeight).toFixed(2); - } - - /** - * Generate detailed performance report - * @returns {string} Formatted report - */ - generateDetailedReport() { - const report = this.generatePerformanceReport(); - const motivationalMessage = this.getMotivationalMessage(report.grade); - - return ` -===== Student Performance Report ===== -Name: ${report.name} -Student ID: ${report.studentId} - -Performance Metrics: -- Total Marks: ${report.totalMarks} -- Average Marks: ${report.averageMarks} -- Highest Mark: ${report.highestMark} -- Lowest Mark: ${report.lowestMark} -- Overall Grade: ${report.grade} - -Subject Breakdown: -${Object.entries(this.subjects).map(([subject, mark]) => - `- ${subject}: ${mark}` -).join('\n')} - -${motivationalMessage} -==================================== - `; - } - - /** - * Generate motivational message based on grade - * @param {string} grade - * @returns {string} Motivational message - */ - getMotivationalMessage(grade) { - const messages = { - 'A+': 'Outstanding performance! Keep up the excellent work!', - 'A': 'Excellent results! You\'re on the path to success!', - 'B': 'Good job! There\'s room for improvement.', - 'C': 'You\'re making progress. Stay focused and keep studying!', - 'D': 'You can do better. Seek help and stay motivated!', - 'F': 'Don\'t be discouraged. Every setback is a chance to learn.' - }; - return messages[grade] || 'Keep working hard!'; - } - - /** - * Compare multiple students and rank them - * @param {Array} students - Array of StudentMarksheet instances - * @returns {Array} Ranked list of students - */ - static compareStudents(students) { - if (!Array.isArray(students) || students.length === 0) { - throw new Error('Invalid input. Provide an array of students.'); - } - - // Sort students by total marks in descending order - return students - .map(student => ({ - name: student.name, - studentId: student.studentId, - totalMarks: Object.values(student.subjects).reduce((sum, mark) => sum + mark, 0) - })) - .sort((a, b) => b.totalMarks - a.totalMarks) - .map((student, index) => ({ - ...student, - rank: index + 1 - })); - } - - /** - * Export marksheet to JSON - * @returns {string} JSON representation of marksheet - */ - exportToJSON() { - return JSON.stringify({ - name: this.name, - studentId: this.studentId, - subjects: this.subjects, - performanceReport: this.generatePerformanceReport() - }, null, 2); - } -} - -// Demonstration and Testing -function demonstrateMarksheetSystem() { - try { - // Create students - const student1 = new StudentMarksheet("John Doe", 123456, { - "Mathematics": 85, - "Science": 92, - "English": 78, - "History": 88, - "Computer Science": 95 - }); - - const student2 = new StudentMarksheet("Jane Smith", 654321, { - "Mathematics": 90, - "Science": 88, - "English": 85, - "History": 92, - "Computer Science": 87 - }); - - // Generate and display reports - console.log(student1.generateDetailedReport()); - console.log(student1.calculateWeightedAverage()); - - // Compare students - const rankedStudents = StudentMarksheet.compareStudents([student1, student2]); - console.log("Student Rankings:", rankedStudents); - - // Export to JSON - console.log("JSON Export:", student1.exportToJSON()); - - } catch (error) { - console.error("Marksheet System Error:", error.message); - } -} - -// Run the demonstration -demonstrateMarksheetSystem(); - -// Export the class for potential module usage +/** + * Advanced Student Marksheet Management System + * Comprehensive Implementation + */ +class StudentMarksheet { + /** + * Constructor to initialize student details + * @param {string} name - Full name of the student + * @param {number} studentId - Unique student identifier + * @param {Object} subjects - Object containing subject names and marks + */ + constructor(name, studentId, subjects) { + this.validateStudentData(name, studentId, subjects); + + this.name = name; + this.studentId = studentId; + this.subjects = subjects; + } + + /** + * Comprehensive data validation method + * @param {string} name + * @param {number} studentId + * @param {Object} subjects + * @throws {Error} For invalid input + */ + validateStudentData(name, studentId, subjects) { + // Name validation + if (typeof name !== 'string' || name.trim().split(' ').length < 2) { + throw new Error('Name must be at least two words'); + } + + // Student ID validation + if (typeof studentId !== 'number' || + !Number.isInteger(studentId) || + studentId < 100000 || + studentId > 999999) { + throw new Error('Student ID must be a 6-digit positive number'); + } + + // Subjects validation + if (!subjects || typeof subjects !== 'object' || Object.keys(subjects).length < 5) { + throw new Error('Minimum of 5 subjects required'); + } + + // Subject marks validation + for (const [subject, mark] of Object.entries(subjects)) { + if (typeof mark !== 'number' || mark < 0 || mark > 100) { + throw new Error(`Invalid mark for ${subject}. Marks must be between 0-100`); + } + } + } + + /** + * Generate comprehensive performance report + * @returns {Object} Performance analytics + */ + generatePerformanceReport() { + const subjects = this.subjects; + const totalMarks = Object.values(subjects).reduce((sum, mark) => sum + mark, 0); + const averageMarks = totalMarks / Object.keys(subjects).length; + + return { + name: this.name, + studentId: this.studentId, + totalMarks: totalMarks, + averageMarks: averageMarks.toFixed(2), + highestMark: Math.max(...Object.values(subjects)), + lowestMark: Math.min(...Object.values(subjects)), + grade: this.calculateGrade(averageMarks), + subjectPerformance: subjects + }; + } + + /** + * Calculate performance grade + * @param {number} averageMarks + * @returns {string} Grade + */ + calculateGrade(averageMarks) { + if (averageMarks >= 90) return 'A+'; + if (averageMarks >= 80) return 'A'; + if (averageMarks >= 70) return 'B'; + if (averageMarks >= 60) return 'C'; + if (averageMarks >= 50) return 'D'; + return 'F'; + } + + /** + * Calculate weighted average with subject weights + * @param {Object} weightedSubjects - Subjects with weights + * @returns {number} Weighted average score + */ + calculateWeightedAverage(weightedSubjects = {}) { + // Default weights if not provided + const defaultWeights = { + 'Mathematics': 1.2, + 'Science': 1.1, + 'English': 1.0, + 'History': 1.0, + 'Computer Science': 1.1 + }; + + const weights = { ...defaultWeights, ...weightedSubjects }; + let totalWeightedMarks = 0; + let totalWeight = 0; + + for (const [subject, mark] of Object.entries(this.subjects)) { + const weight = weights[subject] || 1.0; + totalWeightedMarks += mark * weight; + totalWeight += weight; + } + + return (totalWeightedMarks / totalWeight).toFixed(2); + } + + /** + * Generate detailed performance report + * @returns {string} Formatted report + */ + generateDetailedReport() { + const report = this.generatePerformanceReport(); + const motivationalMessage = this.getMotivationalMessage(report.grade); + + return ` +===== Student Performance Report ===== +Name: ${report.name} +Student ID: ${report.studentId} + +Performance Metrics: +- Total Marks: ${report.totalMarks} +- Average Marks: ${report.averageMarks} +- Highest Mark: ${report.highestMark} +- Lowest Mark: ${report.lowestMark} +- Overall Grade: ${report.grade} + +Subject Breakdown: +${Object.entries(this.subjects).map(([subject, mark]) => + `- ${subject}: ${mark}` +).join('\n')} + +${motivationalMessage} +==================================== + `; + } + + /** + * Generate motivational message based on grade + * @param {string} grade + * @returns {string} Motivational message + */ + getMotivationalMessage(grade) { + const messages = { + 'A+': 'Outstanding performance! Keep up the excellent work!', + 'A': 'Excellent results! You\'re on the path to success!', + 'B': 'Good job! There\'s room for improvement.', + 'C': 'You\'re making progress. Stay focused and keep studying!', + 'D': 'You can do better. Seek help and stay motivated!', + 'F': 'Don\'t be discouraged. Every setback is a chance to learn.' + }; + return messages[grade] || 'Keep working hard!'; + } + + /** + * Compare multiple students and rank them + * @param {Array} students - Array of StudentMarksheet instances + * @returns {Array} Ranked list of students + */ + static compareStudents(students) { + if (!Array.isArray(students) || students.length === 0) { + throw new Error('Invalid input. Provide an array of students.'); + } + + // Sort students by total marks in descending order + return students + .map(student => ({ + name: student.name, + studentId: student.studentId, + totalMarks: Object.values(student.subjects).reduce((sum, mark) => sum + mark, 0) + })) + .sort((a, b) => b.totalMarks - a.totalMarks) + .map((student, index) => ({ + ...student, + rank: index + 1 + })); + } + + /** + * Export marksheet to JSON + * @returns {string} JSON representation of marksheet + */ + exportToJSON() { + return JSON.stringify({ + name: this.name, + studentId: this.studentId, + subjects: this.subjects, + performanceReport: this.generatePerformanceReport() + }, null, 2); + } +} + +// Demonstration and Testing +function demonstrateMarksheetSystem() { + try { + // Create students + const student1 = new StudentMarksheet("John Doe", 123456, { + "Mathematics": 85, + "Science": 92, + "English": 78, + "History": 88, + "Computer Science": 95 + }); + + const student2 = new StudentMarksheet("Jane Smith", 654321, { + "Mathematics": 90, + "Science": 88, + "English": 85, + "History": 92, + "Computer Science": 87 + }); + + // Generate and display reports + console.log(student1.generateDetailedReport()); + console.log(student1.calculateWeightedAverage()); + + // Compare students + const rankedStudents = StudentMarksheet.compareStudents([student1, student2]); + console.log("Student Rankings:", rankedStudents); + + // Export to JSON + console.log("JSON Export:", student1.exportToJSON()); + + } catch (error) { + console.error("Marksheet System Error:", error.message); + } +} + +// Run the demonstration +demonstrateMarksheetSystem(); + +// Export the class for potential module usage export default StudentMarksheet; \ No newline at end of file From f624320b4bee265bcccb2ee87a207cae43def723 Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Wed, 28 May 2025 14:11:43 +0530 Subject: [PATCH 09/63] Add function.html with examples of basic functions, parameters, return values, and default parameters --- .../01 Lecture_Example/Basic/function.html | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/Example/01 Lecture_Example/Basic/function.html b/Example/01 Lecture_Example/Basic/function.html index e69de29..039ce7e 100644 --- a/Example/01 Lecture_Example/Basic/function.html +++ b/Example/01 Lecture_Example/Basic/function.html @@ -0,0 +1,68 @@ + + + + + + Document + + + + + + + + \ No newline at end of file From 13dc0c9e72ce8c2dbe4bfb63dda86b8beee5d5d8 Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Thu, 29 May 2025 14:26:14 +0530 Subject: [PATCH 10/63] Add Global and Local Scope example HTML file with JavaScript code --- .../Basic/Global and local scope.html | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 Example/01 Lecture_Example/Basic/Global and local scope.html diff --git a/Example/01 Lecture_Example/Basic/Global and local scope.html b/Example/01 Lecture_Example/Basic/Global and local scope.html new file mode 100644 index 0000000..7c1dc72 --- /dev/null +++ b/Example/01 Lecture_Example/Basic/Global and local scope.html @@ -0,0 +1,49 @@ + + + + + + Document + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 8e614922dce06e235665ad9a697ae27563a941dd Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Thu, 29 May 2025 14:32:06 +0530 Subject: [PATCH 11/63] Add JavaScript Objects example and corresponding HTML file --- .../Basic/JavaScript Objects.js | 26 +++++++++++++++++++ Example/01 Lecture_Example/Basic/object.html | 12 +++++++++ 2 files changed, 38 insertions(+) create mode 100644 Example/01 Lecture_Example/Basic/JavaScript Objects.js create mode 100644 Example/01 Lecture_Example/Basic/object.html diff --git a/Example/01 Lecture_Example/Basic/JavaScript Objects.js b/Example/01 Lecture_Example/Basic/JavaScript Objects.js new file mode 100644 index 0000000..fc84f1b --- /dev/null +++ b/Example/01 Lecture_Example/Basic/JavaScript Objects.js @@ -0,0 +1,26 @@ +// object + +const Days = { + Day1:"Monday", + Day2:"Tuesday" +} + + +console.log("Days ",Days); +console.log("Days ",Days.Day1); + + +class info{ + + Print_Data() { + + console.log("This is Demo ... Data ") + + } + + +} + +obj = new info + +obj.Print_Data(); \ No newline at end of file diff --git a/Example/01 Lecture_Example/Basic/object.html b/Example/01 Lecture_Example/Basic/object.html new file mode 100644 index 0000000..94aac2f --- /dev/null +++ b/Example/01 Lecture_Example/Basic/object.html @@ -0,0 +1,12 @@ + + + + + + Document + + + + + + \ No newline at end of file From 3ddd3c34f7b4b0d3ba5c6f51761e30bd6dd98ddd Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Fri, 30 May 2025 14:48:54 +0530 Subject: [PATCH 12/63] Add String methods example with replace functionality in HTML --- .../Basic/String_methods.html | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 Example/01 Lecture_Example/Basic/String_methods.html diff --git a/Example/01 Lecture_Example/Basic/String_methods.html b/Example/01 Lecture_Example/Basic/String_methods.html new file mode 100644 index 0000000..04a15de --- /dev/null +++ b/Example/01 Lecture_Example/Basic/String_methods.html @@ -0,0 +1,51 @@ + + + + + + Document + + + + + + + + + + +

    Data :

    +

    Update Data :

    + + + + \ No newline at end of file From d512bc5e905f6224dc9ba816626eaec6430a9899 Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Sat, 31 May 2025 11:29:08 +0530 Subject: [PATCH 13/63] Remove outdated HTML and JavaScript files related to basic programming concepts and examples, including loops, operators, string methods, variables, functions, if-else statements, and login functionality. Add new structured HTML files for basic programming concepts with improved content organization and examples. --- Example/Lectures/01 Day/Basic.html | 0 Example/{ => Lectures}/01 Lecture_Example/Basic/Basic.html | 0 Example/{ => Lectures}/01 Lecture_Example/Basic/Break.html | 0 .../01 Lecture_Example/Basic/Global and local scope.html | 0 .../{ => Lectures}/01 Lecture_Example/Basic/JavaScript Objects.js | 0 Example/{ => Lectures}/01 Lecture_Example/Basic/Loop.html | 0 Example/{ => Lectures}/01 Lecture_Example/Basic/Operator.html | 0 .../{ => Lectures}/01 Lecture_Example/Basic/String_methods.html | 0 Example/{ => Lectures}/01 Lecture_Example/Basic/Variable.html | 0 .../{ => Lectures}/01 Lecture_Example/Basic/arrow_function.html | 0 Example/{ => Lectures}/01 Lecture_Example/Basic/function.html | 0 Example/{ => Lectures}/01 Lecture_Example/Basic/if_else.html | 0 Example/{ => Lectures}/01 Lecture_Example/Basic/object.html | 0 .../{ => Lectures}/01 Lecture_Example/Example_login/Login.html | 0 .../{ => Lectures}/01 Lecture_Example/Example_login/Welcome.html | 0 Example/{ => Lectures}/01 Lecture_Example/Example_login/login.js | 0 16 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 Example/Lectures/01 Day/Basic.html rename Example/{ => Lectures}/01 Lecture_Example/Basic/Basic.html (100%) rename Example/{ => Lectures}/01 Lecture_Example/Basic/Break.html (100%) rename Example/{ => Lectures}/01 Lecture_Example/Basic/Global and local scope.html (100%) rename Example/{ => Lectures}/01 Lecture_Example/Basic/JavaScript Objects.js (100%) rename Example/{ => Lectures}/01 Lecture_Example/Basic/Loop.html (100%) rename Example/{ => Lectures}/01 Lecture_Example/Basic/Operator.html (100%) rename Example/{ => Lectures}/01 Lecture_Example/Basic/String_methods.html (100%) rename Example/{ => Lectures}/01 Lecture_Example/Basic/Variable.html (100%) rename Example/{ => Lectures}/01 Lecture_Example/Basic/arrow_function.html (100%) rename Example/{ => Lectures}/01 Lecture_Example/Basic/function.html (100%) rename Example/{ => Lectures}/01 Lecture_Example/Basic/if_else.html (100%) rename Example/{ => Lectures}/01 Lecture_Example/Basic/object.html (100%) rename Example/{ => Lectures}/01 Lecture_Example/Example_login/Login.html (100%) rename Example/{ => Lectures}/01 Lecture_Example/Example_login/Welcome.html (100%) rename Example/{ => Lectures}/01 Lecture_Example/Example_login/login.js (100%) diff --git a/Example/Lectures/01 Day/Basic.html b/Example/Lectures/01 Day/Basic.html new file mode 100644 index 0000000..e69de29 diff --git a/Example/01 Lecture_Example/Basic/Basic.html b/Example/Lectures/01 Lecture_Example/Basic/Basic.html similarity index 100% rename from Example/01 Lecture_Example/Basic/Basic.html rename to Example/Lectures/01 Lecture_Example/Basic/Basic.html diff --git a/Example/01 Lecture_Example/Basic/Break.html b/Example/Lectures/01 Lecture_Example/Basic/Break.html similarity index 100% rename from Example/01 Lecture_Example/Basic/Break.html rename to Example/Lectures/01 Lecture_Example/Basic/Break.html diff --git a/Example/01 Lecture_Example/Basic/Global and local scope.html b/Example/Lectures/01 Lecture_Example/Basic/Global and local scope.html similarity index 100% rename from Example/01 Lecture_Example/Basic/Global and local scope.html rename to Example/Lectures/01 Lecture_Example/Basic/Global and local scope.html diff --git a/Example/01 Lecture_Example/Basic/JavaScript Objects.js b/Example/Lectures/01 Lecture_Example/Basic/JavaScript Objects.js similarity index 100% rename from Example/01 Lecture_Example/Basic/JavaScript Objects.js rename to Example/Lectures/01 Lecture_Example/Basic/JavaScript Objects.js diff --git a/Example/01 Lecture_Example/Basic/Loop.html b/Example/Lectures/01 Lecture_Example/Basic/Loop.html similarity index 100% rename from Example/01 Lecture_Example/Basic/Loop.html rename to Example/Lectures/01 Lecture_Example/Basic/Loop.html diff --git a/Example/01 Lecture_Example/Basic/Operator.html b/Example/Lectures/01 Lecture_Example/Basic/Operator.html similarity index 100% rename from Example/01 Lecture_Example/Basic/Operator.html rename to Example/Lectures/01 Lecture_Example/Basic/Operator.html diff --git a/Example/01 Lecture_Example/Basic/String_methods.html b/Example/Lectures/01 Lecture_Example/Basic/String_methods.html similarity index 100% rename from Example/01 Lecture_Example/Basic/String_methods.html rename to Example/Lectures/01 Lecture_Example/Basic/String_methods.html diff --git a/Example/01 Lecture_Example/Basic/Variable.html b/Example/Lectures/01 Lecture_Example/Basic/Variable.html similarity index 100% rename from Example/01 Lecture_Example/Basic/Variable.html rename to Example/Lectures/01 Lecture_Example/Basic/Variable.html diff --git a/Example/01 Lecture_Example/Basic/arrow_function.html b/Example/Lectures/01 Lecture_Example/Basic/arrow_function.html similarity index 100% rename from Example/01 Lecture_Example/Basic/arrow_function.html rename to Example/Lectures/01 Lecture_Example/Basic/arrow_function.html diff --git a/Example/01 Lecture_Example/Basic/function.html b/Example/Lectures/01 Lecture_Example/Basic/function.html similarity index 100% rename from Example/01 Lecture_Example/Basic/function.html rename to Example/Lectures/01 Lecture_Example/Basic/function.html diff --git a/Example/01 Lecture_Example/Basic/if_else.html b/Example/Lectures/01 Lecture_Example/Basic/if_else.html similarity index 100% rename from Example/01 Lecture_Example/Basic/if_else.html rename to Example/Lectures/01 Lecture_Example/Basic/if_else.html diff --git a/Example/01 Lecture_Example/Basic/object.html b/Example/Lectures/01 Lecture_Example/Basic/object.html similarity index 100% rename from Example/01 Lecture_Example/Basic/object.html rename to Example/Lectures/01 Lecture_Example/Basic/object.html diff --git a/Example/01 Lecture_Example/Example_login/Login.html b/Example/Lectures/01 Lecture_Example/Example_login/Login.html similarity index 100% rename from Example/01 Lecture_Example/Example_login/Login.html rename to Example/Lectures/01 Lecture_Example/Example_login/Login.html diff --git a/Example/01 Lecture_Example/Example_login/Welcome.html b/Example/Lectures/01 Lecture_Example/Example_login/Welcome.html similarity index 100% rename from Example/01 Lecture_Example/Example_login/Welcome.html rename to Example/Lectures/01 Lecture_Example/Example_login/Welcome.html diff --git a/Example/01 Lecture_Example/Example_login/login.js b/Example/Lectures/01 Lecture_Example/Example_login/login.js similarity index 100% rename from Example/01 Lecture_Example/Example_login/login.js rename to Example/Lectures/01 Lecture_Example/Example_login/login.js From e077d1d91e358ca9854ce468823b5055b39f83b3 Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Sat, 31 May 2025 11:44:11 +0530 Subject: [PATCH 14/63] Add new HTML files for basic programming concepts, including variables and data types, with improved examples and structure. --- Example/Lectures/01 Day/Basic.html | 21 ++++++++++ Example/Lectures/01 Day/Variable.html | 57 +++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 Example/Lectures/01 Day/Variable.html diff --git a/Example/Lectures/01 Day/Basic.html b/Example/Lectures/01 Day/Basic.html index e69de29..df4c9e9 100644 --- a/Example/Lectures/01 Day/Basic.html +++ b/Example/Lectures/01 Day/Basic.html @@ -0,0 +1,21 @@ + + + + + + Document + + + + + + + + + \ No newline at end of file diff --git a/Example/Lectures/01 Day/Variable.html b/Example/Lectures/01 Day/Variable.html new file mode 100644 index 0000000..47fe28f --- /dev/null +++ b/Example/Lectures/01 Day/Variable.html @@ -0,0 +1,57 @@ + + + + + + Document + + + + + + + \ No newline at end of file From 2d9c73bb92749cdac44e1be4c366c5aee289725c Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Sat, 31 May 2025 11:46:37 +0530 Subject: [PATCH 15/63] Comment out unused height variable in Variable.html for clarity --- Example/Lectures/01 Day/Variable.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Example/Lectures/01 Day/Variable.html b/Example/Lectures/01 Day/Variable.html index 47fe28f..be34245 100644 --- a/Example/Lectures/01 Day/Variable.html +++ b/Example/Lectures/01 Day/Variable.html @@ -19,7 +19,8 @@ name = "joy"; const age = 23; // constant variable. - height = 4.5; + //height = 4.5; + height = 3.4 document.write("
    Your Name is : ",name); document.write("
    Your age is : ",age); From 7476340b753c7d2b2055c495e87195751ae15f83 Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Sat, 31 May 2025 14:26:29 +0530 Subject: [PATCH 16/63] Add Array.html file with examples of array and object iteration in JavaScript --- .../01 Lecture_Example/Basic/Array.html | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 Example/Lectures/01 Lecture_Example/Basic/Array.html diff --git a/Example/Lectures/01 Lecture_Example/Basic/Array.html b/Example/Lectures/01 Lecture_Example/Basic/Array.html new file mode 100644 index 0000000..eb060da --- /dev/null +++ b/Example/Lectures/01 Lecture_Example/Basic/Array.html @@ -0,0 +1,44 @@ + + + + + + Document + + + + + + + + \ No newline at end of file From 7c5afb6452a8ba0411aaacf579b2d084ace031bb Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Tue, 3 Jun 2025 09:19:40 +0530 Subject: [PATCH 17/63] Add examples of array mapping and finding even numbers in Array.html --- .../01 Lecture_Example/Basic/Array.html | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Example/Lectures/01 Lecture_Example/Basic/Array.html b/Example/Lectures/01 Lecture_Example/Basic/Array.html index eb060da..fca0610 100644 --- a/Example/Lectures/01 Lecture_Example/Basic/Array.html +++ b/Example/Lectures/01 Lecture_Example/Basic/Array.html @@ -34,6 +34,23 @@ } + const names = ["James", "Marie", "Rosa"]; + + const fullNames = names.map(item => item); + console.log(fullNames); + + const ii = fruits.map(item => item); + console.log(ii); + + + const numbers = [1, 2, 5, 7, 9]; + const evenNumber = numbers.find(function(number) { + return number % 2 === 0; + }); + + console.log(evenNumber) + + From 7c7dd7a5ee188ce518310100c8003351b3207ea5 Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Wed, 4 Jun 2025 21:54:26 +0530 Subject: [PATCH 18/63] Update 01. JavaScript Introduction.md --- 01. JavaScript Introduction.md | 178 ++++++++++++++++++++++++--------- 1 file changed, 130 insertions(+), 48 deletions(-) diff --git a/01. JavaScript Introduction.md b/01. JavaScript Introduction.md index 4f97a0d..a09f19b 100644 --- a/01. JavaScript Introduction.md +++ b/01. JavaScript Introduction.md @@ -1,50 +1,132 @@ # 1- Getting Started With JavaScript *** -JavaScript is not something you need to install separately like a software program; it's already built into modern web browsers. To create and run a basic JavaScript program, you only need a text editor and a web browser. Here's a simple guide to creating your first JavaScript program: - -1. **Text Editor:** - Choose a text editor to write your JavaScript code. You can use popular text editors like Visual Studio Code, Sublime Text, Atom, Notepad++, or even a plain text editor like Notepad on Windows or TextEdit on macOS. - -2. **Create an HTML File:** - Create an HTML file where you'll include your JavaScript code. You can do this by opening your text editor and creating a new file with a ".html" extension. For example, you can name it `index.html`. - -3. **Write the HTML Structure:** - In your `index.html` file, write the basic structure of an HTML document, including an opening and closing ``, ``, and `` tags. Here's a simple example: - - ```html - - - - My First JavaScript Program - - - - - - ``` - -4. **Adding JavaScript Code:** - Inside the `` section of your HTML file, you can include JavaScript code within ` - - - ``` - -5. **Save the File:** - Save your `index.html` file after adding the JavaScript code. - -6. **Open in a Web Browser:** - Locate your `index.html` file and open it with your preferred web browser (e.g., Google Chrome, Mozilla Firefox, or Microsoft Edge). You should see an alert message saying "Hello, JavaScript!" - -That's it! You've created and executed a basic JavaScript program in an HTML document. As you continue to learn JavaScript, you can add more complex code and interact with the HTML document's content and structure. You can also link external JavaScript files and build interactive web applications as you become more proficient. \ No newline at end of file +# : Running Your First "Hello, World!" Program + +This tutorial walks you through creating and running a "Hello, World!" program in JavaScript, designed for absolute beginners. We’ll cover two methods: running JavaScript in a web browser and using Node.js. Each step is detailed to ensure clarity. + +## What is JavaScript? +JavaScript is a programming language used to make websites interactive. It runs in browsers (e.g., Chrome) and can also work outside browsers with Node.js. This tutorial focuses on writing and running a simple program that outputs "Hello, World!". + +## Prerequisites +- A computer with a web browser (e.g., Google Chrome). +- A text editor (Notepad is fine, but Visual Studio Code is recommended—free at [code.visualstudio.com](https://code.visualstudio.com/)). +- Optional: Node.js (we’ll guide you through installation for Method 2). +- No coding experience needed. + +## Method 1: Running "Hello, World!" in a Web Browser +This method uses a browser to run JavaScript, displaying the output in the browser’s console. + +### Step 1: Create a New File +1. Open your text editor (e.g., Notepad or VS Code). +2. Create a new file and name it `index.html`. Save it in a folder, like `C:\Users\YourName\Documents\JS_Tutorial`. + +### Step 2: Write the HTML and JavaScript Code +1. Copy and paste the following code into `index.html`: + ```html + + + + + My First JavaScript Program + + +

    Hello, World! Program

    + + + + ``` +2. Save the file (`Ctrl+S` or `File > Save`). + +**What’s happening here?** +- ``: Declares the file as HTML. +- ` + ``` +2. Save the file and refresh the browser (`F5` or `Ctrl+R`). +3. The text "Hello, World!" will appear on the web page below the heading. + +## Method 2: Running "Hello, World!" with Node.js +This method runs JavaScript outside a browser using Node.js, displaying output in a terminal. + +### Step 1: Install Node.js +1. Visit [nodejs.org](https://nodejs.org/) and download the "LTS" version (e.g., 20.17.0 as of now). +2. Run the installer and follow the prompts (accept defaults). +3. Verify installation: + - Open a terminal: + - Windows: Press `Win+R`, type `cmd`, and press Enter. + - Mac: Open Terminal from Applications > Utilities. + - Linux: Open your terminal app. + - Type `node -v` and press Enter. + - You should see a version number (e.g., `v20.17.0`). If not, reinstall Node.js. + +### Step 2: Create a JavaScript File +1. Open your text editor and create a new file named `hello.js`. +2. Add the following code: + ```javascript + console.log("Hello, World!"); + ``` +3. Save the file in your folder (e.g., `C:\Users\YourName\Documents\JS_Tutorial`). + +### Step 3: Run the Program +1. Open a terminal and navigate to your folder: + - Type `cd C:\Users\YourName\Documents\JS_Tutorial` (adjust the path as needed) and press Enter. + - Verify you’re in the right folder by typing `dir` (Windows) or `ls` (Mac/Linux) to see `hello.js`. +2. Run the program: + - Type `node hello.js` and press Enter. + - You should see "Hello, World!" printed in the terminal. + +## Troubleshooting +- **Browser Console Empty**: + - Ensure the ` + + + + + + \ No newline at end of file From b477f7df558b942fac2a536c3f67e1cd7a8896a0 Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Sat, 7 Jun 2025 13:35:15 +0530 Subject: [PATCH 20/63] Add initial content to 01 Variable.md --- Tutorials/01 Variable.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 Tutorials/01 Variable.md diff --git a/Tutorials/01 Variable.md b/Tutorials/01 Variable.md new file mode 100644 index 0000000..e69de29 From 9b7f030f2d0c00846d9e21464d941bc3e930f898 Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Tue, 17 Jun 2025 13:12:48 +0530 Subject: [PATCH 21/63] Add Event.html and Functions.js for basic arithmetic operations --- Example/Lectures/03 Day/Event.html | 20 ++++++++++++++++++++ Example/Lectures/03 Day/Functions.js | 19 +++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 Example/Lectures/03 Day/Event.html create mode 100644 Example/Lectures/03 Day/Functions.js diff --git a/Example/Lectures/03 Day/Event.html b/Example/Lectures/03 Day/Event.html new file mode 100644 index 0000000..336c91b --- /dev/null +++ b/Example/Lectures/03 Day/Event.html @@ -0,0 +1,20 @@ + + + + + + Document + + + + + + + + + + +

    Result

    + + + \ No newline at end of file diff --git a/Example/Lectures/03 Day/Functions.js b/Example/Lectures/03 Day/Functions.js new file mode 100644 index 0000000..8119dc4 --- /dev/null +++ b/Example/Lectures/03 Day/Functions.js @@ -0,0 +1,19 @@ +function info(){ + // function body + alert("welcome to codeswithpankaj") +} + +function add(){ + + num1 = document.getElementById("num1").value; + num2 = document.getElementById("num2").value; + + num1 = parseInt(num1); + num2 = parseInt(num2); + + result = num1 + num2; + + document.getElementById("print_result").innerHTML = result; + + +} \ No newline at end of file From 6db7bb313faf749ed8a9a7b8fd4adef73be9d2ad Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Sat, 21 Jun 2025 13:05:38 +0530 Subject: [PATCH 22/63] Add Error.html, Login.html, Welcome.html, and logic.js for user authentication flow --- Example/Lectures/04 Day/Error.html | 19 ++ Example/Lectures/04 Day/Login.html | 31 +++ Example/Lectures/04 Day/Welcome.html | 321 +++++++++++++++++++++++++++ Example/Lectures/04 Day/logic.js | 20 ++ 4 files changed, 391 insertions(+) create mode 100644 Example/Lectures/04 Day/Error.html create mode 100644 Example/Lectures/04 Day/Login.html create mode 100644 Example/Lectures/04 Day/Welcome.html create mode 100644 Example/Lectures/04 Day/logic.js diff --git a/Example/Lectures/04 Day/Error.html b/Example/Lectures/04 Day/Error.html new file mode 100644 index 0000000..72861e4 --- /dev/null +++ b/Example/Lectures/04 Day/Error.html @@ -0,0 +1,19 @@ + + + + + + Document + + + +
    +

    Error

    +

    An error occurred while processing your request.

    + Go Back to Login +
    + + + + + \ No newline at end of file diff --git a/Example/Lectures/04 Day/Login.html b/Example/Lectures/04 Day/Login.html new file mode 100644 index 0000000..4b70852 --- /dev/null +++ b/Example/Lectures/04 Day/Login.html @@ -0,0 +1,31 @@ + + + + + + Document + + + + + + + + +
    +

    Login

    +
    +
    + + +
    +
    + + +
    + +
    + + + + \ No newline at end of file diff --git a/Example/Lectures/04 Day/Welcome.html b/Example/Lectures/04 Day/Welcome.html new file mode 100644 index 0000000..2fb2c04 --- /dev/null +++ b/Example/Lectures/04 Day/Welcome.html @@ -0,0 +1,321 @@ + + + + + + + + + + Album example · Bootstrap + + + + + + + + + + + + + + + + + +
    + + +
    + +
    + +
    +
    +
    +

    Album example

    +

    Something short and leading about the collection below—its contents, the creator, + etc. Make it short and sweet, but not too short so folks don’t simply skip over it entirely.

    +

    + Main call to action + Secondary action +

    +
    +
    +
    + +
    +
    + +
    +
    +
    + + Placeholder + Thumbnail + + +
    +

    This is a wider card with supporting text below as a natural lead-in to additional + content. This content is a little bit longer.

    +
    +
    + + +
    + 9 mins +
    +
    +
    +
    +
    +
    + + Placeholder + Thumbnail + + +
    +

    This is a wider card with supporting text below as a natural lead-in to additional + content. This content is a little bit longer.

    +
    +
    + + +
    + 9 mins +
    +
    +
    +
    +
    +
    + + Placeholder + Thumbnail + + +
    +

    This is a wider card with supporting text below as a natural lead-in to additional + content. This content is a little bit longer.

    +
    +
    + + +
    + 9 mins +
    +
    +
    +
    + +
    +
    + + Placeholder + Thumbnail + + +
    +

    This is a wider card with supporting text below as a natural lead-in to additional + content. This content is a little bit longer.

    +
    +
    + + +
    + 9 mins +
    +
    +
    +
    +
    +
    + + Placeholder + Thumbnail + + +
    +

    This is a wider card with supporting text below as a natural lead-in to additional + content. This content is a little bit longer.

    +
    +
    + + +
    + 9 mins +
    +
    +
    +
    +
    +
    + + Placeholder + Thumbnail + + +
    +

    This is a wider card with supporting text below as a natural lead-in to additional + content. This content is a little bit longer.

    +
    +
    + + +
    + 9 mins +
    +
    +
    +
    + +
    +
    + + Placeholder + Thumbnail + + +
    +

    This is a wider card with supporting text below as a natural lead-in to additional + content. This content is a little bit longer.

    +
    +
    + + +
    + 9 mins +
    +
    +
    +
    +
    +
    + + Placeholder + Thumbnail + + +
    +

    This is a wider card with supporting text below as a natural lead-in to additional + content. This content is a little bit longer.

    +
    +
    + + +
    + 9 mins +
    +
    +
    +
    +
    +
    + + Placeholder + Thumbnail + + +
    +

    This is a wider card with supporting text below as a natural lead-in to additional + content. This content is a little bit longer.

    +
    +
    + + +
    + 9 mins +
    +
    +
    +
    +
    +
    +
    + +
    + + + + + + \ No newline at end of file diff --git a/Example/Lectures/04 Day/logic.js b/Example/Lectures/04 Day/logic.js new file mode 100644 index 0000000..9660196 --- /dev/null +++ b/Example/Lectures/04 Day/logic.js @@ -0,0 +1,20 @@ +function login_logic(){ + + // get the username and password from the input fields + var username = document.getElementById("username").value; + var password = document.getElementById("password").value; + + r_username = "admin"; + r_password = "admin@123"; + + // check if the username and password are correct + if (username === r_username && password === r_password) { + // if correct, redirect to the home page + window.location.href = "welcome.html"; + + + }else{ + window.location.href = "Error.html"; + } + +} \ No newline at end of file From 81abab1505a83c4d7f3f46c60bef209f77f8c9b1 Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Tue, 24 Jun 2025 13:33:16 +0530 Subject: [PATCH 23/63] Add Cookies.html for cookie management functionality --- Example/Lectures/05 Day/Cookies.html | 38 ++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Example/Lectures/05 Day/Cookies.html diff --git a/Example/Lectures/05 Day/Cookies.html b/Example/Lectures/05 Day/Cookies.html new file mode 100644 index 0000000..406c6b8 --- /dev/null +++ b/Example/Lectures/05 Day/Cookies.html @@ -0,0 +1,38 @@ + + + + + + Document + + + + + + + + + + + + \ No newline at end of file From 15f937f7e22e0844ad85df97eee60f84b92c90c5 Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Sat, 28 Jun 2025 13:28:43 +0530 Subject: [PATCH 24/63] Add Number.html and String.html with examples of math and string functions in JavaScript --- Example/Lectures/06 Day/Number.html | 71 +++++++++++++++++++++++++++++ Example/Lectures/06 Day/String.html | 68 +++++++++++++++++++++++++++ 2 files changed, 139 insertions(+) create mode 100644 Example/Lectures/06 Day/Number.html create mode 100644 Example/Lectures/06 Day/String.html diff --git a/Example/Lectures/06 Day/Number.html b/Example/Lectures/06 Day/Number.html new file mode 100644 index 0000000..e0031e6 --- /dev/null +++ b/Example/Lectures/06 Day/Number.html @@ -0,0 +1,71 @@ + + + + + + Document + + + + + + + + + \ No newline at end of file diff --git a/Example/Lectures/06 Day/String.html b/Example/Lectures/06 Day/String.html new file mode 100644 index 0000000..ccef3b1 --- /dev/null +++ b/Example/Lectures/06 Day/String.html @@ -0,0 +1,68 @@ + + + + + + Document + + + + + + + + \ No newline at end of file From 90439e57859d1a831d62ea201054d764fc8449e4 Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Tue, 1 Jul 2025 14:21:03 +0530 Subject: [PATCH 25/63] Add Regex.html with examples of regular expressions and their methods in JavaScript --- Example/Lectures/07 Day/Regex.html | 92 ++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 Example/Lectures/07 Day/Regex.html diff --git a/Example/Lectures/07 Day/Regex.html b/Example/Lectures/07 Day/Regex.html new file mode 100644 index 0000000..0ed4077 --- /dev/null +++ b/Example/Lectures/07 Day/Regex.html @@ -0,0 +1,92 @@ + + + + + + Document + + + + + + + + \ No newline at end of file From f865c2600451d4214e4d649904346d4e2986e806 Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Tue, 1 Jul 2025 14:27:05 +0530 Subject: [PATCH 26/63] Add Error_Exception.html to demonstrate error handling in JavaScript using try-catch --- Example/Lectures/08 Day/Error_Exception.html | 36 ++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Example/Lectures/08 Day/Error_Exception.html diff --git a/Example/Lectures/08 Day/Error_Exception.html b/Example/Lectures/08 Day/Error_Exception.html new file mode 100644 index 0000000..7dcef64 --- /dev/null +++ b/Example/Lectures/08 Day/Error_Exception.html @@ -0,0 +1,36 @@ + + + + + + Document + + + + + + + + \ No newline at end of file From 6fc777de3e55d450681412ebf2d96c50b8d1bf02 Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Thu, 3 Jul 2025 13:22:28 +0530 Subject: [PATCH 27/63] Add baisc.js and test.js with initial console log for website welcome message --- Example/Lectures/09 Day/baisc.js | 1 + Example/Lectures/09 Day/test.js | 1 + 2 files changed, 2 insertions(+) create mode 100644 Example/Lectures/09 Day/baisc.js create mode 100644 Example/Lectures/09 Day/test.js diff --git a/Example/Lectures/09 Day/baisc.js b/Example/Lectures/09 Day/baisc.js new file mode 100644 index 0000000..3665b80 --- /dev/null +++ b/Example/Lectures/09 Day/baisc.js @@ -0,0 +1 @@ +console.log("welcome to my website"); \ No newline at end of file diff --git a/Example/Lectures/09 Day/test.js b/Example/Lectures/09 Day/test.js new file mode 100644 index 0000000..3665b80 --- /dev/null +++ b/Example/Lectures/09 Day/test.js @@ -0,0 +1 @@ +console.log("welcome to my website"); \ No newline at end of file From f2d56e7f49b1fb7dc322c8a35138752e958dca60 Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Thu, 3 Jul 2025 13:38:17 +0530 Subject: [PATCH 28/63] Add index.html with embedded content including Google Maps, Python tutorial, and YouTube video --- Example/Lectures/10 Day/index.html | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Example/Lectures/10 Day/index.html diff --git a/Example/Lectures/10 Day/index.html b/Example/Lectures/10 Day/index.html new file mode 100644 index 0000000..60fc41c --- /dev/null +++ b/Example/Lectures/10 Day/index.html @@ -0,0 +1,22 @@ + + + + + + Document + + + + + + + + + +
    + + + + \ No newline at end of file From f5617bb48222d6d33e9752d0a7708eddbb1ff128 Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Mon, 21 Jul 2025 15:58:48 +0530 Subject: [PATCH 29/63] update code --- Example/Array/Subject_list.html | 50 +++++++++++++++++++++++++++++++++ Example/Array/table_print.html | 37 ++++++++++++++++++++++++ Example/Loop/table.html | 0 3 files changed, 87 insertions(+) create mode 100644 Example/Array/Subject_list.html create mode 100644 Example/Array/table_print.html create mode 100644 Example/Loop/table.html diff --git a/Example/Array/Subject_list.html b/Example/Array/Subject_list.html new file mode 100644 index 0000000..33a8ca0 --- /dev/null +++ b/Example/Array/Subject_list.html @@ -0,0 +1,50 @@ + + + + + + Document + + + + + + + + +
    +
    +
    + + +
    + +
    + +
    +
    +
    + + + \ No newline at end of file diff --git a/Example/Array/table_print.html b/Example/Array/table_print.html new file mode 100644 index 0000000..35ec3a8 --- /dev/null +++ b/Example/Array/table_print.html @@ -0,0 +1,37 @@ + + + + + + Document + + + + + + + + + +
    + + + + + diff --git a/Example/Loop/table.html b/Example/Loop/table.html new file mode 100644 index 0000000..e69de29 From 9ababad891af2f7a879920a5f49ef5fbb257fc99 Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Sat, 11 Oct 2025 14:13:00 +0530 Subject: [PATCH 30/63] update all codes --- Lectures/Day01/basic.js | 1 + Lectures/Day01/file01.html | 47 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 Lectures/Day01/basic.js create mode 100644 Lectures/Day01/file01.html diff --git a/Lectures/Day01/basic.js b/Lectures/Day01/basic.js new file mode 100644 index 0000000..252df4e --- /dev/null +++ b/Lectures/Day01/basic.js @@ -0,0 +1 @@ +console.log("welcome"); \ No newline at end of file diff --git a/Lectures/Day01/file01.html b/Lectures/Day01/file01.html new file mode 100644 index 0000000..6567781 --- /dev/null +++ b/Lectures/Day01/file01.html @@ -0,0 +1,47 @@ + + + + + + Document + + + + + + + + \ No newline at end of file From cfeb94f4239ee72a4d4ad7f6c81429aaaf272f9f Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Sat, 25 Oct 2025 11:05:28 +0530 Subject: [PATCH 31/63] Add Operator.html and Operator_js.js with arithmetic, comparison, and logical operators examples; Add Variables.html demonstrating variable declarations and usage --- Lectures/Day02/Operator/Operator.html | 12 +++++++ Lectures/Day02/Operator/Operator_js.js | 48 ++++++++++++++++++++++++++ Lectures/Day02/Variables.html | 30 ++++++++++++++++ 3 files changed, 90 insertions(+) create mode 100644 Lectures/Day02/Operator/Operator.html create mode 100644 Lectures/Day02/Operator/Operator_js.js create mode 100644 Lectures/Day02/Variables.html diff --git a/Lectures/Day02/Operator/Operator.html b/Lectures/Day02/Operator/Operator.html new file mode 100644 index 0000000..a0ab819 --- /dev/null +++ b/Lectures/Day02/Operator/Operator.html @@ -0,0 +1,12 @@ + + + + + + Document + + + + + + \ No newline at end of file diff --git a/Lectures/Day02/Operator/Operator_js.js b/Lectures/Day02/Operator/Operator_js.js new file mode 100644 index 0000000..a6318a1 --- /dev/null +++ b/Lectures/Day02/Operator/Operator_js.js @@ -0,0 +1,48 @@ +// Arithmetic Operators: +// + (Addition) +// - (Subtraction) +// * (Multiplication) +// / (Division) +// % (Modulus, returns the remainder) +// ++ (Increment by 1) +// -- (Decrement by 1) +x = 345 +y = 67 + +console.log(x+y); +console.log(x-y); +console.log(x*y); +console.log(x/y); +console.log(x%y); +console.log(++x); +console.log(--y); + +// Comparison Operators: + +// == (Equal to) +// != (Not equal to) +// === (Strict equal to) +// !== (Strict not equal to) +// > (Greater than) +// < (Less than) +// >= (Greater than or equal to) +// <= (Less than or equal to) +x = 34 +y = 67 +console.log(x==y) +console.log(x!=y) +console.log(x>y) +console.log(x=34) + +console.log(34 !== '34') + +// Logical Operators: + +// && (Logical AND) +console.log((x + + + + + Document + + + + + \ No newline at end of file From 7a12a21ebc63f801b731862ef150740300b10e97 Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Sat, 8 Nov 2025 11:12:25 +0530 Subject: [PATCH 32/63] update - new codes if else --- Lectures/Day03/If_else.html | 45 +++++++++++++++++++++++++++++++++++++ Lectures/Day03/basic.html | 44 ++++++++++++++++++++++++++++++++++++ 2 files changed, 89 insertions(+) create mode 100644 Lectures/Day03/If_else.html create mode 100644 Lectures/Day03/basic.html diff --git a/Lectures/Day03/If_else.html b/Lectures/Day03/If_else.html new file mode 100644 index 0000000..5778ff3 --- /dev/null +++ b/Lectures/Day03/If_else.html @@ -0,0 +1,45 @@ + + + + + + Document + + + + + + + + + +
    +
    +
    + + + + + + +
    +
    +
    + + + + \ No newline at end of file diff --git a/Lectures/Day03/basic.html b/Lectures/Day03/basic.html new file mode 100644 index 0000000..d347bef --- /dev/null +++ b/Lectures/Day03/basic.html @@ -0,0 +1,44 @@ + + + + + + Document + + + + + + + + + + + \ No newline at end of file From 284febcb10fce396a4231702b59808578c248e7c Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Fri, 14 Nov 2025 15:26:05 +0530 Subject: [PATCH 33/63] update if else --- Lectures/Lecture01/Day03_14_nov/if_else.html | 43 +++++++++++++++++++ Lectures/{ => Lecture02}/Day01/basic.js | 0 Lectures/{ => Lecture02}/Day01/file01.html | 0 .../Day02/Operator/Operator.html | 0 .../Day02/Operator/Operator_js.js | 0 Lectures/{ => Lecture02}/Day02/Variables.html | 0 Lectures/{ => Lecture02}/Day03/If_else.html | 0 Lectures/{ => Lecture02}/Day03/basic.html | 0 8 files changed, 43 insertions(+) create mode 100644 Lectures/Lecture01/Day03_14_nov/if_else.html rename Lectures/{ => Lecture02}/Day01/basic.js (100%) rename Lectures/{ => Lecture02}/Day01/file01.html (100%) rename Lectures/{ => Lecture02}/Day02/Operator/Operator.html (100%) rename Lectures/{ => Lecture02}/Day02/Operator/Operator_js.js (100%) rename Lectures/{ => Lecture02}/Day02/Variables.html (100%) rename Lectures/{ => Lecture02}/Day03/If_else.html (100%) rename Lectures/{ => Lecture02}/Day03/basic.html (100%) diff --git a/Lectures/Lecture01/Day03_14_nov/if_else.html b/Lectures/Lecture01/Day03_14_nov/if_else.html new file mode 100644 index 0000000..ee604e7 --- /dev/null +++ b/Lectures/Lecture01/Day03_14_nov/if_else.html @@ -0,0 +1,43 @@ + + + + + + Document + + + + + + + + + + + + + +

    Result :

    + + + \ No newline at end of file diff --git a/Lectures/Day01/basic.js b/Lectures/Lecture02/Day01/basic.js similarity index 100% rename from Lectures/Day01/basic.js rename to Lectures/Lecture02/Day01/basic.js diff --git a/Lectures/Day01/file01.html b/Lectures/Lecture02/Day01/file01.html similarity index 100% rename from Lectures/Day01/file01.html rename to Lectures/Lecture02/Day01/file01.html diff --git a/Lectures/Day02/Operator/Operator.html b/Lectures/Lecture02/Day02/Operator/Operator.html similarity index 100% rename from Lectures/Day02/Operator/Operator.html rename to Lectures/Lecture02/Day02/Operator/Operator.html diff --git a/Lectures/Day02/Operator/Operator_js.js b/Lectures/Lecture02/Day02/Operator/Operator_js.js similarity index 100% rename from Lectures/Day02/Operator/Operator_js.js rename to Lectures/Lecture02/Day02/Operator/Operator_js.js diff --git a/Lectures/Day02/Variables.html b/Lectures/Lecture02/Day02/Variables.html similarity index 100% rename from Lectures/Day02/Variables.html rename to Lectures/Lecture02/Day02/Variables.html diff --git a/Lectures/Day03/If_else.html b/Lectures/Lecture02/Day03/If_else.html similarity index 100% rename from Lectures/Day03/If_else.html rename to Lectures/Lecture02/Day03/If_else.html diff --git a/Lectures/Day03/basic.html b/Lectures/Lecture02/Day03/basic.html similarity index 100% rename from Lectures/Day03/basic.html rename to Lectures/Lecture02/Day03/basic.html From 85a4e22159d0ca5db9730f3142503e3440bb5c4a Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Sat, 15 Nov 2025 10:42:15 +0530 Subject: [PATCH 34/63] update Operator --- Lectures/Lecture02/Day04/Operator.html | 86 ++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 Lectures/Lecture02/Day04/Operator.html diff --git a/Lectures/Lecture02/Day04/Operator.html b/Lectures/Lecture02/Day04/Operator.html new file mode 100644 index 0000000..5c40aaf --- /dev/null +++ b/Lectures/Lecture02/Day04/Operator.html @@ -0,0 +1,86 @@ + + + + + + Document + + + + + + + + \ No newline at end of file From 449782bc27e454eb32c9cdbafef8f45e96b94fa1 Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Tue, 18 Nov 2025 10:37:27 +0530 Subject: [PATCH 35/63] update new if _else.. --- Lectures/Lecture02/Day05/if_else.html | 31 +++++++++++ Lectures/Lecture02/Day05/if_else01.html | 70 +++++++++++++++++++++++++ 2 files changed, 101 insertions(+) create mode 100644 Lectures/Lecture02/Day05/if_else.html create mode 100644 Lectures/Lecture02/Day05/if_else01.html diff --git a/Lectures/Lecture02/Day05/if_else.html b/Lectures/Lecture02/Day05/if_else.html new file mode 100644 index 0000000..bbdf04b --- /dev/null +++ b/Lectures/Lecture02/Day05/if_else.html @@ -0,0 +1,31 @@ + + + + + + Document + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Lectures/Lecture02/Day05/if_else01.html b/Lectures/Lecture02/Day05/if_else01.html new file mode 100644 index 0000000..980db21 --- /dev/null +++ b/Lectures/Lecture02/Day05/if_else01.html @@ -0,0 +1,70 @@ + + + + + + Document + + + + + + + + + + + + + +
    + +
    +
    + +
    + + +
    +
    + + +
    + +
    + +
    + + +
    + +
    + +
    +
    + +
    + + + + + \ No newline at end of file From 0af187b10c3494ebdee0b83ad5967e21ed8430df Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Sat, 22 Nov 2025 11:17:40 +0530 Subject: [PATCH 36/63] Add Home.html and login.html with basic structure and functionality; Implement login logic in login_logic.js --- Lectures/Lecture01/Day 22 Nov 2025/Home.html | 120 ++++++++++++++++++ Lectures/Lecture01/Day 22 Nov 2025/login.html | 33 +++++ .../Lecture01/Day 22 Nov 2025/login_logic.js | 18 +++ 3 files changed, 171 insertions(+) create mode 100644 Lectures/Lecture01/Day 22 Nov 2025/Home.html create mode 100644 Lectures/Lecture01/Day 22 Nov 2025/login.html create mode 100644 Lectures/Lecture01/Day 22 Nov 2025/login_logic.js diff --git a/Lectures/Lecture01/Day 22 Nov 2025/Home.html b/Lectures/Lecture01/Day 22 Nov 2025/Home.html new file mode 100644 index 0000000..9d78d81 --- /dev/null +++ b/Lectures/Lecture01/Day 22 Nov 2025/Home.html @@ -0,0 +1,120 @@ + + + + + + Document + + + Document + + + + + + + + + +
    +
    +
    +
    + Welcome To joy Samosa Store ! +
    +
    +
    +
    + + +
    +
    + + +
    +
    +
    +
    +
    +
    + + +
    +
    + + +
    +
    +
    +
    + +
    +
    +
    + +
    +
    + + Welcome To joy Samosa Store ! Bill Print + +
    +
    + +
    Product Name :   NON
    +
    Product Price :   00/-
    +
    Product GST :   0.0%
    +
    GST Amount :   00/-
    +
    Total Price :   00/-
    + + +
    +
    + +
    +
    +
    + + + + \ No newline at end of file diff --git a/Lectures/Lecture01/Day 22 Nov 2025/login.html b/Lectures/Lecture01/Day 22 Nov 2025/login.html new file mode 100644 index 0000000..5796a88 --- /dev/null +++ b/Lectures/Lecture01/Day 22 Nov 2025/login.html @@ -0,0 +1,33 @@ + + + + + + Document + + + + + + +
    +
    +
    +
    +
    + + +
    +
    + + +

    +
    + +
    +
    +
    +
    + + + \ No newline at end of file diff --git a/Lectures/Lecture01/Day 22 Nov 2025/login_logic.js b/Lectures/Lecture01/Day 22 Nov 2025/login_logic.js new file mode 100644 index 0000000..22128d4 --- /dev/null +++ b/Lectures/Lecture01/Day 22 Nov 2025/login_logic.js @@ -0,0 +1,18 @@ + + +function Login_result(){ + + u_name = document.getElementById("username").value; + u_password = document.getElementById("password").value; + + username = "admin@cwpc.in"; + password = "admin@123" + + if(u_name == username && u_password == password){ + window.open("Home.html"); + }else{ + document.getElementById("Error_print").innerHTML = "Wrong Password and user Name .. Try again !" + } + + +} \ No newline at end of file From 62cbb4024ab85ef33be1f00b9b583602f398eb42 Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Sat, 22 Nov 2025 12:37:38 +0530 Subject: [PATCH 37/63] Refactor printbill function to improve GST calculation and add quantity handling --- Lectures/Lecture01/Day 22 Nov 2025/Home.html | 71 ++++++++++---------- 1 file changed, 37 insertions(+), 34 deletions(-) diff --git a/Lectures/Lecture01/Day 22 Nov 2025/Home.html b/Lectures/Lecture01/Day 22 Nov 2025/Home.html index 9d78d81..144ff53 100644 --- a/Lectures/Lecture01/Day 22 Nov 2025/Home.html +++ b/Lectures/Lecture01/Day 22 Nov 2025/Home.html @@ -12,40 +12,43 @@ + + function printbill() { + + let name = document.getElementById("product").value; + let price = document.getElementById("price").value; + let gst = document.getElementById("gst").value; + let qt = document.getElementById("qt").value; + + + let name_p = document.getElementById("name"); + let price_p = document.getElementById("price_p"); + let gst_p = document.getElementById("gst_p"); + let gst_amount_p = document.getElementById("gst_amount_p"); + let total_price_p = document.getElementById("total-price_p"); + + // Print Product Name & Price + name_p.innerHTML = name; + price_p.innerHTML = price; + + // GST Percentage + gst_p.innerHTML = gst; + + // Calculate GST Amount + let gst_amount = price * gst / 100; + + // Total Price = (Price + GST) * Quantity + let total_price = (price + gst_amount) * qt; + + // Print GST Amount & Total + gst_amount_p.innerHTML = gst_amount.toFixed(2); + total_price_p.innerHTML = total_price.toFixed(2); + + } + + + + From 29522ab57cb95be8ac90acca4b1055a5097f6ec2 Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Thu, 27 Nov 2025 10:21:33 +0530 Subject: [PATCH 38/63] Add Switch.html for basic calculator functionality with operator selection --- .../Lecture01/Day 27 Nov 2025/Switch.html | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 Lectures/Lecture01/Day 27 Nov 2025/Switch.html diff --git a/Lectures/Lecture01/Day 27 Nov 2025/Switch.html b/Lectures/Lecture01/Day 27 Nov 2025/Switch.html new file mode 100644 index 0000000..e11573b --- /dev/null +++ b/Lectures/Lecture01/Day 27 Nov 2025/Switch.html @@ -0,0 +1,81 @@ + + + + + + Document + + + + + + + + + +
    +
    +
    +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + +
    +
    +
    +

    Result: N/A

    +
    +
    +
    + +
    + + + + + \ No newline at end of file From d18d33892e111dcc0cddac6fc9a66c81f0d71f5c Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Thu, 27 Nov 2025 10:25:06 +0530 Subject: [PATCH 39/63] Change button type to prevent form submission in Switch.html --- Lectures/Lecture01/Day 27 Nov 2025/Switch.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lectures/Lecture01/Day 27 Nov 2025/Switch.html b/Lectures/Lecture01/Day 27 Nov 2025/Switch.html index e11573b..3e30f00 100644 --- a/Lectures/Lecture01/Day 27 Nov 2025/Switch.html +++ b/Lectures/Lecture01/Day 27 Nov 2025/Switch.html @@ -64,7 +64,7 @@
    - +
    From c2df0b1220c85382361d9690e98c6d441c8fdda4 Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Thu, 4 Dec 2025 10:18:32 +0530 Subject: [PATCH 40/63] loop example --- Lectures/Lecture02/Day07/box_using_loop.html | 40 ++++++++++++++++++++ Lectures/Lecture02/Day07/loop.html | 26 +++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 Lectures/Lecture02/Day07/box_using_loop.html create mode 100644 Lectures/Lecture02/Day07/loop.html diff --git a/Lectures/Lecture02/Day07/box_using_loop.html b/Lectures/Lecture02/Day07/box_using_loop.html new file mode 100644 index 0000000..4dd0222 --- /dev/null +++ b/Lectures/Lecture02/Day07/box_using_loop.html @@ -0,0 +1,40 @@ + + + + + + Document + + + + + + + + + + + + + \ No newline at end of file diff --git a/Lectures/Lecture02/Day07/loop.html b/Lectures/Lecture02/Day07/loop.html new file mode 100644 index 0000000..33ff633 --- /dev/null +++ b/Lectures/Lecture02/Day07/loop.html @@ -0,0 +1,26 @@ + + + + + + Document + + + + + + + + \ No newline at end of file From 3ac9b43e9b170ba6039e730316bca85564329cfd Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Sat, 13 Dec 2025 11:26:34 +0530 Subject: [PATCH 41/63] update loop example --- Lectures/Lecture01/13 Dec 2025/Example1.html | 52 ++++++++++++++++++++ Lectures/Lecture01/13 Dec 2025/Loop.html | 23 +++++++++ 2 files changed, 75 insertions(+) create mode 100644 Lectures/Lecture01/13 Dec 2025/Example1.html create mode 100644 Lectures/Lecture01/13 Dec 2025/Loop.html diff --git a/Lectures/Lecture01/13 Dec 2025/Example1.html b/Lectures/Lecture01/13 Dec 2025/Example1.html new file mode 100644 index 0000000..46e28ff --- /dev/null +++ b/Lectures/Lecture01/13 Dec 2025/Example1.html @@ -0,0 +1,52 @@ + + + + + + Document + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Lectures/Lecture01/13 Dec 2025/Loop.html b/Lectures/Lecture01/13 Dec 2025/Loop.html new file mode 100644 index 0000000..9ae92e5 --- /dev/null +++ b/Lectures/Lecture01/13 Dec 2025/Loop.html @@ -0,0 +1,23 @@ + + + + + + Document + + + + + + + + \ No newline at end of file From 739956229e0bdd6a6e0fc8b9c660a8537f685ef7 Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Sat, 13 Dec 2025 11:27:41 +0530 Subject: [PATCH 42/63] update loop --- Lectures/Lecture01/13 Dec 2025/Example1.html | 1 - 1 file changed, 1 deletion(-) diff --git a/Lectures/Lecture01/13 Dec 2025/Example1.html b/Lectures/Lecture01/13 Dec 2025/Example1.html index 46e28ff..81ceab5 100644 --- a/Lectures/Lecture01/13 Dec 2025/Example1.html +++ b/Lectures/Lecture01/13 Dec 2025/Example1.html @@ -28,7 +28,6 @@ document.getElementById("print_box").innerHTML += "
  • "+i+"
  • "; - } From b5de05ba328f4d1282f8db7f8b6b1253be87899b Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Tue, 16 Dec 2025 10:45:32 +0530 Subject: [PATCH 43/63] update ..login logic... --- .../Day08 - R Date - 16 Dec 2025/Err.html | 13 +++++++ .../Day08 - R Date - 16 Dec 2025/Login.html | 36 +++++++++++++++++++ .../Day08 - R Date - 16 Dec 2025/Welcome.html | 11 ++++++ .../login_logic.js | 17 +++++++++ 4 files changed, 77 insertions(+) create mode 100644 Lectures/Lecture02/Day08 - R Date - 16 Dec 2025/Err.html create mode 100644 Lectures/Lecture02/Day08 - R Date - 16 Dec 2025/Login.html create mode 100644 Lectures/Lecture02/Day08 - R Date - 16 Dec 2025/Welcome.html create mode 100644 Lectures/Lecture02/Day08 - R Date - 16 Dec 2025/login_logic.js diff --git a/Lectures/Lecture02/Day08 - R Date - 16 Dec 2025/Err.html b/Lectures/Lecture02/Day08 - R Date - 16 Dec 2025/Err.html new file mode 100644 index 0000000..dcac068 --- /dev/null +++ b/Lectures/Lecture02/Day08 - R Date - 16 Dec 2025/Err.html @@ -0,0 +1,13 @@ + + + + + + Document + + + +

    Wrong Password GO Back

    + + + \ No newline at end of file diff --git a/Lectures/Lecture02/Day08 - R Date - 16 Dec 2025/Login.html b/Lectures/Lecture02/Day08 - R Date - 16 Dec 2025/Login.html new file mode 100644 index 0000000..790b808 --- /dev/null +++ b/Lectures/Lecture02/Day08 - R Date - 16 Dec 2025/Login.html @@ -0,0 +1,36 @@ + + + + + + Document + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + +
    +
    + +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/Lectures/Lecture02/Day08 - R Date - 16 Dec 2025/Welcome.html b/Lectures/Lecture02/Day08 - R Date - 16 Dec 2025/Welcome.html new file mode 100644 index 0000000..7f9f6e1 --- /dev/null +++ b/Lectures/Lecture02/Day08 - R Date - 16 Dec 2025/Welcome.html @@ -0,0 +1,11 @@ + + + + + + Document + + +

    Welcome to CWPC

    + + \ No newline at end of file diff --git a/Lectures/Lecture02/Day08 - R Date - 16 Dec 2025/login_logic.js b/Lectures/Lecture02/Day08 - R Date - 16 Dec 2025/login_logic.js new file mode 100644 index 0000000..e637569 --- /dev/null +++ b/Lectures/Lecture02/Day08 - R Date - 16 Dec 2025/login_logic.js @@ -0,0 +1,17 @@ +function login(){ + + user_name = document.getElementById("email").value; + password = document.getElementById("pwd").value; + + user = "admin@cwpc.in"; + passwd = "admin@123"; + + + if(user_name == user && password == passwd ){ + window.open("Welcome.html") + }else{ + alert("wrong password") + window.open("Err.html") + } + +} \ No newline at end of file From dc85c50aeaa06c3d592a6bc67791a77a22fce420 Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Tue, 23 Dec 2025 10:29:08 +0530 Subject: [PATCH 44/63] Add Example01 and Example02 HTML files for break and continue tutorial --- .DS_Store | Bin 0 -> 6148 bytes .../Example01.html | 38 ++++++++++++++++++ .../Example02.html | 29 +++++++++++++ 3 files changed, 67 insertions(+) create mode 100644 .DS_Store create mode 100644 Lectures/Lecture02/23 Dec 2025 - break and continue/Example01.html create mode 100644 Lectures/Lecture02/23 Dec 2025 - break and continue/Example02.html diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..3b8f2d30e2975c68514bc6646394d5065d97104d GIT binary patch literal 6148 zcmeHLJxc>Y5Pho$CVoH~!SXsA5ztPYQXyV9vf3uIbrmr0qi`7164$|GI4Z z>#6?Ep7Cv%zMxc0Uy042wVRn7@ZIJ>^3j*m~}JrqAS7f8QK%8|Io!lKghv8?KwBx;;`ZB;A_C zpf&nLIVdU07Y&?0SNh1E{(=H9uWE(1C5bF@{kFYN~ltWK4J)!PV>Hw3p7RwRXT(|d7jUGEfd3fKyatIHhk|0`dg|Lr7qPH>Frn!cq``r6{L~R=K*1$F;Yk~WbTK6l)-gQfge@i1DosDdH?_b literal 0 HcmV?d00001 diff --git a/Lectures/Lecture02/23 Dec 2025 - break and continue/Example01.html b/Lectures/Lecture02/23 Dec 2025 - break and continue/Example01.html new file mode 100644 index 0000000..1525ff1 --- /dev/null +++ b/Lectures/Lecture02/23 Dec 2025 - break and continue/Example01.html @@ -0,0 +1,38 @@ + + + + + + Document + + + + + + + + + + + + + \ No newline at end of file diff --git a/Lectures/Lecture02/23 Dec 2025 - break and continue/Example02.html b/Lectures/Lecture02/23 Dec 2025 - break and continue/Example02.html new file mode 100644 index 0000000..0bb5ff0 --- /dev/null +++ b/Lectures/Lecture02/23 Dec 2025 - break and continue/Example02.html @@ -0,0 +1,29 @@ + + + + + + Document + + + + + + + + + start + end + + + + + + + + \ No newline at end of file From b1c2bbe099172f0337d78f7d4e722ca809ad88ac Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Tue, 23 Dec 2025 10:40:21 +0530 Subject: [PATCH 45/63] Refactor Example02.html to enhance functionality and improve structure for break and continue tutorial --- .../Example02.html | 45 +++++++++++++++++-- 1 file changed, 41 insertions(+), 4 deletions(-) diff --git a/Lectures/Lecture02/23 Dec 2025 - break and continue/Example02.html b/Lectures/Lecture02/23 Dec 2025 - break and continue/Example02.html index 0bb5ff0..2893221 100644 --- a/Lectures/Lecture02/23 Dec 2025 - break and continue/Example02.html +++ b/Lectures/Lecture02/23 Dec 2025 - break and continue/Example02.html @@ -5,10 +5,45 @@ Document + + @@ -19,9 +54,11 @@ start end + stop + - - + +
      From 5d8ef985088c202c192acfa930009126420bd854 Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Thu, 25 Dec 2025 11:28:41 +0530 Subject: [PATCH 46/63] Add HTML files for break, function, and index tutorials --- Lectures/Lecture01/25 Dec 2025/break.html | 27 +++++ Lectures/Lecture01/25 Dec 2025/funciton.html | 108 +++++++++++++++++++ Lectures/Lecture01/25 Dec 2025/index.html | 30 ++++++ 3 files changed, 165 insertions(+) create mode 100644 Lectures/Lecture01/25 Dec 2025/break.html create mode 100644 Lectures/Lecture01/25 Dec 2025/funciton.html create mode 100644 Lectures/Lecture01/25 Dec 2025/index.html diff --git a/Lectures/Lecture01/25 Dec 2025/break.html b/Lectures/Lecture01/25 Dec 2025/break.html new file mode 100644 index 0000000..3e33c38 --- /dev/null +++ b/Lectures/Lecture01/25 Dec 2025/break.html @@ -0,0 +1,27 @@ + + + + + + Document + + + + + + + + \ No newline at end of file diff --git a/Lectures/Lecture01/25 Dec 2025/funciton.html b/Lectures/Lecture01/25 Dec 2025/funciton.html new file mode 100644 index 0000000..51c5735 --- /dev/null +++ b/Lectures/Lecture01/25 Dec 2025/funciton.html @@ -0,0 +1,108 @@ + + + + + + Document + + + + + + + + + + +

      + +

      + +

      Result :

      + + + + + + \ No newline at end of file diff --git a/Lectures/Lecture01/25 Dec 2025/index.html b/Lectures/Lecture01/25 Dec 2025/index.html new file mode 100644 index 0000000..3e87656 --- /dev/null +++ b/Lectures/Lecture01/25 Dec 2025/index.html @@ -0,0 +1,30 @@ + + + + + + Document + + + + + + + + \ No newline at end of file From b309ad3b7b24105b71c23198a0cb73fafe1b9eac Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Tue, 6 Jan 2026 10:45:14 +0530 Subject: [PATCH 47/63] update .. function --- .DS_Store | Bin 6148 -> 6148 bytes .../Function_example.html | 57 ++++++++++++++++++ .../6 Jan 2025 - Functions/example.js | 1 + 3 files changed, 58 insertions(+) create mode 100644 Lectures/Lecture02/6 Jan 2025 - Functions/Function_example.html create mode 100644 Lectures/Lecture02/6 Jan 2025 - Functions/example.js diff --git a/.DS_Store b/.DS_Store index 3b8f2d30e2975c68514bc6646394d5065d97104d..fce976ac69954764f8b776d1a2985e2564a63197 100644 GIT binary patch delta 137 zcmZoMXffEJ#**~Sf`Ng7g+Y%YogtHER&gvCQeRZ6`SnG8pCvfVX_^Y+~!lPRzd)J)+0Xv delta 137 zcmZoMXffEJ#*(ym9RmXc3xgg*IzuKyNp8N2OHxjL5>SkzBe>FLV#RSsRQVLV@&y@& y!O8i#1wcIv3_KG+B>Ut&tkRPgvrJ}+SD&1~DmK}VHHN8yVX_^Y+~!lPRzd)Xry}tH diff --git a/Lectures/Lecture02/6 Jan 2025 - Functions/Function_example.html b/Lectures/Lecture02/6 Jan 2025 - Functions/Function_example.html new file mode 100644 index 0000000..8789bc1 --- /dev/null +++ b/Lectures/Lecture02/6 Jan 2025 - Functions/Function_example.html @@ -0,0 +1,57 @@ + + + + + + Document + + + + + + \ No newline at end of file diff --git a/Lectures/Lecture02/6 Jan 2025 - Functions/example.js b/Lectures/Lecture02/6 Jan 2025 - Functions/example.js new file mode 100644 index 0000000..a9ee2b1 --- /dev/null +++ b/Lectures/Lecture02/6 Jan 2025 - Functions/example.js @@ -0,0 +1 @@ +console.log("This is an example JS file for functions."); \ No newline at end of file From a1745dd7f5a607a5f2a03e668b0f1b680999ee74 Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Thu, 8 Jan 2026 11:04:27 +0530 Subject: [PATCH 48/63] objects ... update --- .../Function_example.html | 0 .../example.js | 0 .../Example.html | 34 +++++++++++ .../8 Jan2026 - objects/Example.html | 34 +++++++++++ .../8 Jan2026 - objects/example-object.html | 59 +++++++++++++++++++ 5 files changed, 127 insertions(+) rename Lectures/Lecture02/{6 Jan 2025 - Functions => 6 Jan 2026 - Functions}/Function_example.html (100%) rename Lectures/Lecture02/{6 Jan 2025 - Functions => 6 Jan 2026 - Functions}/example.js (100%) create mode 100644 Lectures/Lecture02/8 Jan2026 - Global and local scope/Example.html create mode 100644 Lectures/Lecture02/8 Jan2026 - objects/Example.html create mode 100644 Lectures/Lecture02/8 Jan2026 - objects/example-object.html diff --git a/Lectures/Lecture02/6 Jan 2025 - Functions/Function_example.html b/Lectures/Lecture02/6 Jan 2026 - Functions/Function_example.html similarity index 100% rename from Lectures/Lecture02/6 Jan 2025 - Functions/Function_example.html rename to Lectures/Lecture02/6 Jan 2026 - Functions/Function_example.html diff --git a/Lectures/Lecture02/6 Jan 2025 - Functions/example.js b/Lectures/Lecture02/6 Jan 2026 - Functions/example.js similarity index 100% rename from Lectures/Lecture02/6 Jan 2025 - Functions/example.js rename to Lectures/Lecture02/6 Jan 2026 - Functions/example.js diff --git a/Lectures/Lecture02/8 Jan2026 - Global and local scope/Example.html b/Lectures/Lecture02/8 Jan2026 - Global and local scope/Example.html new file mode 100644 index 0000000..faf369a --- /dev/null +++ b/Lectures/Lecture02/8 Jan2026 - Global and local scope/Example.html @@ -0,0 +1,34 @@ + + + + + + Document + + + + + + + + \ No newline at end of file diff --git a/Lectures/Lecture02/8 Jan2026 - objects/Example.html b/Lectures/Lecture02/8 Jan2026 - objects/Example.html new file mode 100644 index 0000000..faf369a --- /dev/null +++ b/Lectures/Lecture02/8 Jan2026 - objects/Example.html @@ -0,0 +1,34 @@ + + + + + + Document + + + + + + + + \ No newline at end of file diff --git a/Lectures/Lecture02/8 Jan2026 - objects/example-object.html b/Lectures/Lecture02/8 Jan2026 - objects/example-object.html new file mode 100644 index 0000000..25e823e --- /dev/null +++ b/Lectures/Lecture02/8 Jan2026 - objects/example-object.html @@ -0,0 +1,59 @@ + + + + + + Document + + + + + + + + \ No newline at end of file From b95fcc08a3a81feac73cae2d6dbc2b9080514658 Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Tue, 20 Jan 2026 10:37:23 +0530 Subject: [PATCH 49/63] Add String Methods tutorial HTML file with various string operations --- .DS_Store | Bin 6148 -> 6148 bytes .../20 Jan 2026 - String/String Methods.html | 80 ++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 Lectures/Lecture02/20 Jan 2026 - String/String Methods.html diff --git a/.DS_Store b/.DS_Store index fce976ac69954764f8b776d1a2985e2564a63197..6442b4cddd2ee75166dcae3a5eeadf2991846e06 100644 GIT binary patch delta 31 mcmZoMXffDe#>&)SG&zA)Y_cC~G&7R|!(=-)xy`3ot%LxKst7*- delta 31 ncmZoMXffDe#>!MQadHBy*knJ}XlBL>43q8H + + + + + Document + + + + + + + + + + + \ No newline at end of file From 55be9cfd11adae0acb1e5571c0d3459f20a00422 Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Thu, 22 Jan 2026 10:49:34 +0530 Subject: [PATCH 50/63] Add index.html for full name display tutorial with input fields and functionality --- .DS_Store | Bin 6148 -> 6148 bytes .../22 Jan 2026 - Example/index.html | 60 ++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 Lectures/Lecture02/22 Jan 2026 - Example/index.html diff --git a/.DS_Store b/.DS_Store index 6442b4cddd2ee75166dcae3a5eeadf2991846e06..833a3e3654a7fa86a48930682d9b66d7518233fb 100644 GIT binary patch delta 138 zcmZoMXffEJ%96}waD;(@frUYjA)O(Up(Hoo#U&{xKM5$tap!Pt`=b8ij;Qh}c;yQ+ z41<&Na|?ia7#R2`fJpYqdsw9>FJ_s{)ZRQffmLj>A8QPg0mEcFHo48GSgnKrE?6Zo delta 138 zcmZoMXffEJ%970a&4Ph}frUYjA)O(Up(Hoo#U&{xKM5$t5&b!uyS47PBdUA~UipFy z!{Frn+ybB;1_nL>5XnAy53BU##VnJV8jL0FgV~t@_V3=&jCb#(%tCbJ{bL1jN diff --git a/Lectures/Lecture02/22 Jan 2026 - Example/index.html b/Lectures/Lecture02/22 Jan 2026 - Example/index.html new file mode 100644 index 0000000..3109e74 --- /dev/null +++ b/Lectures/Lecture02/22 Jan 2026 - Example/index.html @@ -0,0 +1,60 @@ + + + + + + Document + + + + + + + + + +
      +
      +
      + + + + + +
      + +
      +
      +
      +

      + Full Name: +

      +

      + Nishant Chouhan +

      +
      +
      +
      + + + + \ No newline at end of file From 2cf8f2843289156a94b956113a7fd147dafa10ee Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Sat, 24 Jan 2026 11:04:33 +0530 Subject: [PATCH 51/63] Add Object, Scope, and Class tutorials with examples and method implementations --- Lectures/Lecture01/24 Jan 2025/Object.js | 28 ++++++++++++++++ Lectures/Lecture01/24 Jan 2025/Scope.js | 27 ++++++++++++++++ .../Lecture01/24 Jan 2025/class_object.js | 32 +++++++++++++++++++ 3 files changed, 87 insertions(+) create mode 100644 Lectures/Lecture01/24 Jan 2025/Object.js create mode 100644 Lectures/Lecture01/24 Jan 2025/Scope.js create mode 100644 Lectures/Lecture01/24 Jan 2025/class_object.js diff --git a/Lectures/Lecture01/24 Jan 2025/Object.js b/Lectures/Lecture01/24 Jan 2025/Object.js new file mode 100644 index 0000000..7bf9708 --- /dev/null +++ b/Lectures/Lecture01/24 Jan 2025/Object.js @@ -0,0 +1,28 @@ +const info = { + Name : "joy", + Age : 21, + City : "New York" +} + +console.log(info); + +// accessing values +console.log(info.Name); + +// access form key +console.log(info["Age"]); + +// adding new data + +info.Country = "USA"; +console.log(info); + +// add new function +info.greet = function() { + console.log("welcome to codeswithpankaj"); +} + +console.log(info); + + +info.greet(); \ No newline at end of file diff --git a/Lectures/Lecture01/24 Jan 2025/Scope.js b/Lectures/Lecture01/24 Jan 2025/Scope.js new file mode 100644 index 0000000..4353c3e --- /dev/null +++ b/Lectures/Lecture01/24 Jan 2025/Scope.js @@ -0,0 +1,27 @@ +// create a global variable + +var number = 10; + +function printNumber() { + + // local var + var data = 20; + + // access the global variable + console.log("The number is: " + number); + console.log("The data is: " + data); + +} + +console.log("Accessing global variable outside function: " + number); +// console.log("Accessing local variable outside function: " + data); + +function info(){ + //console.log("call data inside info(): " + data); + console.log("call number inside info(): " + number); +} + + +printNumber(); + +info(); \ No newline at end of file diff --git a/Lectures/Lecture01/24 Jan 2025/class_object.js b/Lectures/Lecture01/24 Jan 2025/class_object.js new file mode 100644 index 0000000..7415979 --- /dev/null +++ b/Lectures/Lecture01/24 Jan 2025/class_object.js @@ -0,0 +1,32 @@ +class animal{ + + color = "white"; + + info(){ + console.log("This is an animal class"); + } + + type_dog(name){ + console.log("Dog name is: " + name); + console.log("Dog type is: dengerous dog"); + console.log("Dog color is: "+ this.color); + } + + +} + + +// create object +const dog = new animal(); + +// access method +dog.info(); + +// send data to method +dog.type_dog("Labrador"); + +// send value to variable + +dog.color = "black"; + +dog.type_dog("Bulldog"); \ No newline at end of file From 01c2af03ac10fcea7a6e1f45ad6e996e33eb6c9f Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Tue, 27 Jan 2026 10:41:02 +0530 Subject: [PATCH 52/63] Add Array and Array User Input HTML files with examples for array manipulation --- .../Lecture02/27 Jan 2025 Array/Array.html | 33 ++++++++++ .../27 Jan 2025 Array/Array_userInput.html | 61 +++++++++++++++++++ 2 files changed, 94 insertions(+) create mode 100644 Lectures/Lecture02/27 Jan 2025 Array/Array.html create mode 100644 Lectures/Lecture02/27 Jan 2025 Array/Array_userInput.html diff --git a/Lectures/Lecture02/27 Jan 2025 Array/Array.html b/Lectures/Lecture02/27 Jan 2025 Array/Array.html new file mode 100644 index 0000000..03e04f2 --- /dev/null +++ b/Lectures/Lecture02/27 Jan 2025 Array/Array.html @@ -0,0 +1,33 @@ + + + + + + Document + + + + + + + + + \ No newline at end of file diff --git a/Lectures/Lecture02/27 Jan 2025 Array/Array_userInput.html b/Lectures/Lecture02/27 Jan 2025 Array/Array_userInput.html new file mode 100644 index 0000000..b62bbbe --- /dev/null +++ b/Lectures/Lecture02/27 Jan 2025 Array/Array_userInput.html @@ -0,0 +1,61 @@ + + + + + + Document + + + + + + + + + + + + + + + + + + \ No newline at end of file From ba6334c5538db08e23de09279c048edf01416943 Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Sat, 28 Feb 2026 11:16:09 +0530 Subject: [PATCH 53/63] update new array _string --- Lectures/Lecture01/28 Feb 2026/Array_01.html | 116 ++++++++++++++++++ Lectures/Lecture01/28 Feb 2026/String_01.html | 78 ++++++++++++ 2 files changed, 194 insertions(+) create mode 100644 Lectures/Lecture01/28 Feb 2026/Array_01.html create mode 100644 Lectures/Lecture01/28 Feb 2026/String_01.html diff --git a/Lectures/Lecture01/28 Feb 2026/Array_01.html b/Lectures/Lecture01/28 Feb 2026/Array_01.html new file mode 100644 index 0000000..684cf68 --- /dev/null +++ b/Lectures/Lecture01/28 Feb 2026/Array_01.html @@ -0,0 +1,116 @@ + + + + + + Document + + + + + + + + \ No newline at end of file diff --git a/Lectures/Lecture01/28 Feb 2026/String_01.html b/Lectures/Lecture01/28 Feb 2026/String_01.html new file mode 100644 index 0000000..ab78588 --- /dev/null +++ b/Lectures/Lecture01/28 Feb 2026/String_01.html @@ -0,0 +1,78 @@ + + + + + + Document + + + + + + + + + \ No newline at end of file From 11a635eb6562fc69f4022a12d6918fd1121fcf4a Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Thu, 5 Mar 2026 10:34:59 +0530 Subject: [PATCH 54/63] for...in and for...of Loop --- .../for...in Loop.html | 38 +++++++++++++++++++ .../for...of loop.html | 28 ++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 Lectures/Lecture02/5 March 2026 - for...in and for...of Loop/for...in Loop.html create mode 100644 Lectures/Lecture02/5 March 2026 - for...in and for...of Loop/for...of loop.html diff --git a/Lectures/Lecture02/5 March 2026 - for...in and for...of Loop/for...in Loop.html b/Lectures/Lecture02/5 March 2026 - for...in and for...of Loop/for...in Loop.html new file mode 100644 index 0000000..ed77f54 --- /dev/null +++ b/Lectures/Lecture02/5 March 2026 - for...in and for...of Loop/for...in Loop.html @@ -0,0 +1,38 @@ + + + + + + Document + + // for...in Loop + + + + + + + + + + + + + \ No newline at end of file diff --git a/Lectures/Lecture02/5 March 2026 - for...in and for...of Loop/for...of loop.html b/Lectures/Lecture02/5 March 2026 - for...in and for...of Loop/for...of loop.html new file mode 100644 index 0000000..0f50b45 --- /dev/null +++ b/Lectures/Lecture02/5 March 2026 - for...in and for...of Loop/for...of loop.html @@ -0,0 +1,28 @@ + + + + + + Document + + // for...of Loop + + + + + + + \ No newline at end of file From eddb1449257c10404cffa10ed01406cd1b9b17d2 Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Thu, 5 Mar 2026 13:25:47 +0530 Subject: [PATCH 55/63] update --- .../5 March 2026 - for...in and for...of Loop/for...in Loop.html | 1 - 1 file changed, 1 deletion(-) diff --git a/Lectures/Lecture02/5 March 2026 - for...in and for...of Loop/for...in Loop.html b/Lectures/Lecture02/5 March 2026 - for...in and for...of Loop/for...in Loop.html index ed77f54..7990274 100644 --- a/Lectures/Lecture02/5 March 2026 - for...in and for...of Loop/for...in Loop.html +++ b/Lectures/Lecture02/5 March 2026 - for...in and for...of Loop/for...in Loop.html @@ -23,7 +23,6 @@ console.log(i,' = ',person[i]); } - From 1979df5727c9b9919e8e54c7cd8d85197579eec3 Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Sat, 7 Mar 2026 12:10:35 +0530 Subject: [PATCH 56/63] update codes ... --- .../Map.html | 32 ++++++++++++++++ .../filter.html | 36 ++++++++++++++++++ .../reduce.html | 37 +++++++++++++++++++ 3 files changed, 105 insertions(+) create mode 100644 Lectures/Lecture02/7 March 2026 - map - filter - reduce/Map.html create mode 100644 Lectures/Lecture02/7 March 2026 - map - filter - reduce/filter.html create mode 100644 Lectures/Lecture02/7 March 2026 - map - filter - reduce/reduce.html diff --git a/Lectures/Lecture02/7 March 2026 - map - filter - reduce/Map.html b/Lectures/Lecture02/7 March 2026 - map - filter - reduce/Map.html new file mode 100644 index 0000000..28064f1 --- /dev/null +++ b/Lectures/Lecture02/7 March 2026 - map - filter - reduce/Map.html @@ -0,0 +1,32 @@ + + + + + + Document + + + + + + + + + \ No newline at end of file diff --git a/Lectures/Lecture02/7 March 2026 - map - filter - reduce/filter.html b/Lectures/Lecture02/7 March 2026 - map - filter - reduce/filter.html new file mode 100644 index 0000000..554f066 --- /dev/null +++ b/Lectures/Lecture02/7 March 2026 - map - filter - reduce/filter.html @@ -0,0 +1,36 @@ + + + + + + Document + + + + + + + + + + \ No newline at end of file diff --git a/Lectures/Lecture02/7 March 2026 - map - filter - reduce/reduce.html b/Lectures/Lecture02/7 March 2026 - map - filter - reduce/reduce.html new file mode 100644 index 0000000..86e2730 --- /dev/null +++ b/Lectures/Lecture02/7 March 2026 - map - filter - reduce/reduce.html @@ -0,0 +1,37 @@ + + + + + + Document + + + + + + + + + \ No newline at end of file From 772d41a7109bc156f9ee3e422631bc95bbd83cd0 Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Tue, 17 Mar 2026 14:03:15 +0530 Subject: [PATCH 57/63] update JavaScript Basic --- Lectures/Lecture03/Basic.html | 24 ++++++++++++++++++++++++ Lectures/Lecture03/Demo.js | 1 + 2 files changed, 25 insertions(+) create mode 100644 Lectures/Lecture03/Basic.html create mode 100644 Lectures/Lecture03/Demo.js diff --git a/Lectures/Lecture03/Basic.html b/Lectures/Lecture03/Basic.html new file mode 100644 index 0000000..53a8a34 --- /dev/null +++ b/Lectures/Lecture03/Basic.html @@ -0,0 +1,24 @@ + + + + + + Document + + + + + + + + \ No newline at end of file diff --git a/Lectures/Lecture03/Demo.js b/Lectures/Lecture03/Demo.js new file mode 100644 index 0000000..60ee82d --- /dev/null +++ b/Lectures/Lecture03/Demo.js @@ -0,0 +1 @@ +document.write("welcome to CWPC.in
      ") \ No newline at end of file From 67943dc6b7e5f107097127e38150a707ebab3501 Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Thu, 19 Mar 2026 14:00:38 +0530 Subject: [PATCH 58/63] update new codes in JS --- .../Lecture03/{ => 17 March 2026}/Basic.html | 0 .../Lecture03/{ => 17 March 2026}/Demo.js | 0 .../Lecture03/19 March 2026/input_data.html | 45 +++++++++++++++++++ 3 files changed, 45 insertions(+) rename Lectures/Lecture03/{ => 17 March 2026}/Basic.html (100%) rename Lectures/Lecture03/{ => 17 March 2026}/Demo.js (100%) create mode 100644 Lectures/Lecture03/19 March 2026/input_data.html diff --git a/Lectures/Lecture03/Basic.html b/Lectures/Lecture03/17 March 2026/Basic.html similarity index 100% rename from Lectures/Lecture03/Basic.html rename to Lectures/Lecture03/17 March 2026/Basic.html diff --git a/Lectures/Lecture03/Demo.js b/Lectures/Lecture03/17 March 2026/Demo.js similarity index 100% rename from Lectures/Lecture03/Demo.js rename to Lectures/Lecture03/17 March 2026/Demo.js diff --git a/Lectures/Lecture03/19 March 2026/input_data.html b/Lectures/Lecture03/19 March 2026/input_data.html new file mode 100644 index 0000000..d2def8a --- /dev/null +++ b/Lectures/Lecture03/19 March 2026/input_data.html @@ -0,0 +1,45 @@ + + + + + + Document + + + + + + + + + + + + + + + + \ No newline at end of file From bd7f2355a11f4c44636bcbe3fefaea62ef515b28 Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Tue, 24 Mar 2026 13:45:29 +0530 Subject: [PATCH 59/63] input section --- .../Lecture03/24 March 2026/input_box.html | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 Lectures/Lecture03/24 March 2026/input_box.html diff --git a/Lectures/Lecture03/24 March 2026/input_box.html b/Lectures/Lecture03/24 March 2026/input_box.html new file mode 100644 index 0000000..3133dd2 --- /dev/null +++ b/Lectures/Lecture03/24 March 2026/input_box.html @@ -0,0 +1,78 @@ + + + + + + Document + + + + + + + + + + +
      +
      +
      +
      +

      Input Section

      +
      +
      + + +
      +
      + + +
      +
      + + +
      +
      + +
      +
      +
      +
      +

      Bill

      +
      +
      + +
      + +
      + +
      +
      +
      +
      + + + + \ No newline at end of file From 0db5cc32c5fbbfc3fe7e4ee72bddd67f0148e944 Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Thu, 26 Mar 2026 13:53:17 +0530 Subject: [PATCH 60/63] mcq codes --- .../Lecture03/24 March 2026/input_box.html | 4 +- Lectures/Lecture03/26 March 2026/mcq.html | 72 +++++++++++++++++++ 2 files changed, 74 insertions(+), 2 deletions(-) create mode 100644 Lectures/Lecture03/26 March 2026/mcq.html diff --git a/Lectures/Lecture03/24 March 2026/input_box.html b/Lectures/Lecture03/24 March 2026/input_box.html index 3133dd2..b758589 100644 --- a/Lectures/Lecture03/24 March 2026/input_box.html +++ b/Lectures/Lecture03/24 March 2026/input_box.html @@ -42,11 +42,11 @@

      Input Section

      - +
      - +
      diff --git a/Lectures/Lecture03/26 March 2026/mcq.html b/Lectures/Lecture03/26 March 2026/mcq.html new file mode 100644 index 0000000..068325f --- /dev/null +++ b/Lectures/Lecture03/26 March 2026/mcq.html @@ -0,0 +1,72 @@ + + + + + + Document + + + + + + + +

      MCQ Exam

      + +

      + 1 Which planet is known as the Red Planet ? +

      + +
      +
      + +

      + +

      + 2 Who was the first Prime Minister of India? ? +

      + Bhoomi
      + Sumit
      + ajinkya
      + Pankaj
      +
      +
      + +

      + + + + \ No newline at end of file From d2292e9196d638b82c1f0d32ce5f785cde01afcb Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Tue, 31 Mar 2026 14:06:33 +0530 Subject: [PATCH 61/63] add Loop.html and print_box.html for JavaScript looping examples --- Lectures/Lecture03/31 March 2026/Loop.html | 30 ++++++++++++++ .../Lecture03/31 March 2026/print_box.html | 41 +++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 Lectures/Lecture03/31 March 2026/Loop.html create mode 100644 Lectures/Lecture03/31 March 2026/print_box.html diff --git a/Lectures/Lecture03/31 March 2026/Loop.html b/Lectures/Lecture03/31 March 2026/Loop.html new file mode 100644 index 0000000..633214d --- /dev/null +++ b/Lectures/Lecture03/31 March 2026/Loop.html @@ -0,0 +1,30 @@ + + + + + + Document + + + + + + + + + + \ No newline at end of file diff --git a/Lectures/Lecture03/31 March 2026/print_box.html b/Lectures/Lecture03/31 March 2026/print_box.html new file mode 100644 index 0000000..e944cf6 --- /dev/null +++ b/Lectures/Lecture03/31 March 2026/print_box.html @@ -0,0 +1,41 @@ + + + + + + Document + + + + + + + + + + + + + \ No newline at end of file From 489ba2c54d4f86d3065e74bd6d07647ed2a89cfd Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Thu, 2 Apr 2026 13:35:17 +0530 Subject: [PATCH 62/63] add print_box.html for displaying a range of numbers in a styled list --- .../Lecture03/2 April 2026/print_box.html | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 Lectures/Lecture03/2 April 2026/print_box.html diff --git a/Lectures/Lecture03/2 April 2026/print_box.html b/Lectures/Lecture03/2 April 2026/print_box.html new file mode 100644 index 0000000..5e7d9bb --- /dev/null +++ b/Lectures/Lecture03/2 April 2026/print_box.html @@ -0,0 +1,55 @@ + + + + + + Document + + + + + + + + + + + + + + + + + \ No newline at end of file From 273b203e02d113e44a8048103a17ac797d5dbc5b Mon Sep 17 00:00:00 2001 From: Pankaj Chouhan Date: Thu, 9 Apr 2026 13:40:49 +0530 Subject: [PATCH 63/63] add for_in_loop.html and for_of_loop.html for demonstrating JavaScript loops --- .../Lecture03/9 April 2026/for_in_loop.html | 39 +++++++++++++++++++ .../Lecture03/9 April 2026/for_of_loop.html | 39 +++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 Lectures/Lecture03/9 April 2026/for_in_loop.html create mode 100644 Lectures/Lecture03/9 April 2026/for_of_loop.html diff --git a/Lectures/Lecture03/9 April 2026/for_in_loop.html b/Lectures/Lecture03/9 April 2026/for_in_loop.html new file mode 100644 index 0000000..a5c793b --- /dev/null +++ b/Lectures/Lecture03/9 April 2026/for_in_loop.html @@ -0,0 +1,39 @@ + + + + + + Document + + + + + + + + \ No newline at end of file diff --git a/Lectures/Lecture03/9 April 2026/for_of_loop.html b/Lectures/Lecture03/9 April 2026/for_of_loop.html new file mode 100644 index 0000000..e4bbe94 --- /dev/null +++ b/Lectures/Lecture03/9 April 2026/for_of_loop.html @@ -0,0 +1,39 @@ + + + + + + Document + + + + + +

      Welcome to codeswithpankaj.com

      + + + + + + \ No newline at end of file