You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 65b4e64
Browse filesBrowse the repository at this point in the historyBrowse files
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2
+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
3
+
4
+
name: Node.js CI
5
+
6
+
on:
7
+
push:
8
+
branches: [ "main" ]
9
+
pull_request:
10
+
branches: [ "main" ]
11
+
12
+
jobs:
13
+
build:
14
+
15
+
runs-on: ubuntu-latest
16
+
17
+
strategy:
18
+
matrix:
19
+
node-version: [18.x, 20.x, 22.x]
20
+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
//check whether a person is elligible to vote or not
2
-
//should be 18 plus and should havea citizenship to cast vote
1
+
// Create a system that processes student data, calculates grades, filters results, and generates reports. It should handle real-world logic like grade calculations, filtering by criteria, and data transformations.
3
2
4
-
constage=24
5
-
constcitizenshipNum=23456
6
-
if(age>=18){
7
-
if(Boolean(citizenshipNum)){
8
-
console.log("You are elligible to cast vote...")
3
+
// What to Build:
4
+
// An array of student objects, where each student has: name, marks (array of subject scores), attendance percentage
5
+
// Functions that:
6
+
// Calculate average marks and assign grades (A/B/C/D based on ranges)
7
+
// Filter students by criteria (e.g., "show only students with > 75 average")
8
+
// Find top performer and lowest scorer
9
+
// Check eligibility (average > 40 AND attendance > 75%)
10
+
// Loops to iterate through data and transform it
11
+
// Conditionals to apply grading rules (use switch for grade assignment or if/else for eligibility)
12
+
// Generate a summary report showing: total students, pass count, fail count, average class score
13
+
// How to Approach It:
14
+
// Start with data structure — Create realistic student objects with nested arrays (marks per subject)
15
+
// Build utility functions — Each function should do ONE thing (calculate average, assign grade, filter students)
16
+
// Use loops strategically — .map() mindset (though not required): transform data from one form to another
17
+
// Apply game logic — Use conditionals creatively (e.g., bonus points if attendance > 90%)
18
+
// Combine everything — Chain functions and loops to build the final report
19
+
// Challenge Twist (Optional):
20
+
// Add a pass/fail rule: If marks < 40, fail regardless of attendance
21
+
// Add a merit scholarship checker: Show students eligible for scholarship (average > 80 AND attendance 100)
22
+
// Export data to a formatted string report using template literals
23
+
// This project forces them to design with objects, organize logic with functions, and process data with loops — all core pillars.
console.log("The pass/fail eligibilty of each student; ",eligibility)
119
+
120
+
//again updating with results
121
+
for(leti=0;i<students.length;i++){
122
+
students[i].Result=eligibility[i]
123
+
124
+
}
125
+
console.log("Updated Students Profile with grade and avgmarks:",students)
126
+
127
+
128
+
//pass count
129
+
letpcount=0;
130
+
for(leti=0;i<eligibility.length;i++){
131
+
132
+
if(eligibility[i]==="PASS"){
133
+
pcount+=1
134
+
}
135
+
}
136
+
console.log("The pass count in letslearn is: ",pcount)
137
+
138
+
//fail count
139
+
letfcount=0;
140
+
for(leti=0;i<eligibility.length;i++){
141
+
142
+
if(eligibility[i]==="PASS"){
143
+
continue;
144
+
}
145
+
else{
146
+
fcount+=1
147
+
}
148
+
}
149
+
console.log("The fail count in letslearn is: ",fcount)
150
+
//average class score
151
+
functionclassScore(){
152
+
letavgClassScore=0;
153
+
for(leti=0;i<avgmarks.length;i++){
154
+
avgClassScore+=avgmarks[i]
155
+
}
156
+
returnavgClassScore/students.length
157
+
}
158
+
159
+
console.log("The average score of class is : ",classScore(avgmarks))
160
+
161
+
// summary report showing: total students, pass count, fail count, average class score
162
+
console.log("==============CLASS REPORT OF LETSLEARN=============")
163
+
console.log(`\nThe total students in Letslearn is : ${students.length}\nPass count of lets learn : ${pcount} \nFail count of letslearn : ${fcount}\nAverage class score of letslearn is : ${classScore(avgmarks)}`)
0 commit comments