commit ec32ec24c12a140aeb1e0b2c22d643487a0b0085
parent a0e5e3e6d9fa98e3d302eaf274fe871a7cb51cf3
Author: Amit Dutta <amitdutta4255@gmail.com>
Date: Mon, 29 Jun 2026 21:31:16 +0530
added eduincs codes
Diffstat:
6 files changed, 201 insertions(+), 15 deletions(-)
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
@@ -16,27 +16,47 @@
}
},
{
- "type": "cppbuild",
- "label": "C/C++: gcc.exe build active file",
- "command": "C:\\MinGW\\bin\\gcc.exe",
- "args": [
- "-fdiagnostics-color=always",
- "-g",
- "${file}",
- "-o",
- "${fileDirname}\\${fileBasenameNoExtension}.exe"
- ],
+ "label": "C/C++: build active file",
+ "type": "shell",
+ "command": "$sep1='─────────────────────────────────────────'; $sep2='═════════════════════════════════════════'; $compiler=if('${fileExtname}' -eq '.cpp'){'C:\\MinGW\\bin\\g++.exe'}else{'C:\\MinGW\\bin\\gcc.exe'}; $exe='${fileDirname}\\${fileBasenameNoExtension}.exe'; Write-Host ('• Building ${fileBasename}...') -ForegroundColor Yellow -NoNewline; $bsw=[System.Diagnostics.Stopwatch]::StartNew(); & $compiler -fdiagnostics-color=always -g '${file}' -o $exe 2>&1; $bsw.Stop(); $bms=$bsw.ElapsedMilliseconds; if ($LASTEXITCODE -ne 0) { Write-Host ' failed' -ForegroundColor Red; exit 1 }; if ($bms -ge 1000) { $bt=([math]::Round($bms/1000,2).ToString()+' s') } else { $bt=($bms.ToString()+' ms') }; Write-Host (' done ('+$bt+')') -ForegroundColor Green; Write-Host $sep2 -ForegroundColor DarkGray",
+ "args": [],
+ "options": {
+ "cwd": "${fileDirname}",
+ "shell": {
+ "executable": "powershell.exe",
+ "args": ["-NoProfile", "-Command"]
+ }
+ },
+ "problemMatcher": ["$gcc"],
+ "group": "build",
+ "detail": "Auto-selects gcc for .c and g++ for .cpp"
+ },
+ {
+ "label": "C/C++: build and run active file",
+ "type": "shell",
+ "command": "$sep1='─────────────────────────────────────────'; $sep2='═════════════════════════════════════════'; $compiler=if('${fileExtname}' -eq '.cpp'){'C:\\MinGW\\bin\\g++.exe'}else{'C:\\MinGW\\bin\\gcc.exe'}; $exe='${fileDirname}\\${fileBasenameNoExtension}.exe'; Write-Host ('• Building ${fileBasename}...') -ForegroundColor Yellow -NoNewline; $bsw=[System.Diagnostics.Stopwatch]::StartNew(); & $compiler -fdiagnostics-color=always -g '${file}' -o $exe 2>&1; $bsw.Stop(); $bms=$bsw.ElapsedMilliseconds; if ($LASTEXITCODE -ne 0) { Write-Host ' failed' -ForegroundColor Red; exit 1 }; if ($bms -ge 1000) { $bt=([math]::Round($bms/1000,2).ToString()+' s') } else { $bt=($bms.ToString()+' ms') }; Write-Host (' done ('+$bt+')') -ForegroundColor Green; $size=0; if (Test-Path $exe) { $size=[math]::Round((Get-Item $exe).length / 1KB, 2) }; Write-Host ('• Running ${fileBasenameNoExtension}.exe') -ForegroundColor Cyan; Write-Host $sep1 -ForegroundColor Blue; $sw=[System.Diagnostics.Stopwatch]::StartNew(); & $exe; $exit=$LASTEXITCODE; $sw.Stop(); $ms=$sw.ElapsedMilliseconds; Remove-Item $exe -Force -ErrorAction SilentlyContinue; Write-Host ([char]10 + $sep1) -ForegroundColor Blue; if ($ms -ge 1000) { $rt=([math]::Round($ms/1000,2).ToString()+' s ('+$ms.ToString()+' ms)') } else { $rt=($ms.ToString()+' ms') }; if ($exit -eq 0) { Write-Host ('• Clean Exit (Code 0)') -ForegroundColor Green } else { Write-Host ('• Error Exit (Code '+$exit+')') -ForegroundColor Red }; Write-Host ('• Time : '+$rt) -ForegroundColor Magenta; Write-Host ('• Size : '+$size+' KB') -ForegroundColor DarkYellow; Write-Host $sep2 -ForegroundColor DarkGray",
+ "args": [],
"options": {
- "cwd": "${fileDirname}"
+ "cwd": "${fileDirname}",
+ "shell": {
+ "executable": "powershell.exe",
+ "args": ["-NoProfile", "-Command"]
+ }
},
- "problemMatcher": [
- "$gcc"
- ],
+ "problemMatcher": ["$gcc"],
"group": {
"kind": "build",
"isDefault": true
},
- "detail": "Task generated by Debugger."
+ "presentation": {
+ "echo": false,
+ "reveal": "always",
+ "focus": true,
+ "panel": "shared",
+ "showReuseMessage": true,
+ "clear": true
+ },
+ "detail": "Builds, runs, deletes exe — only runs if build succeeds"
}
]
}
\ No newline at end of file
diff --git a/semester_2/eduincs/pgrm_001.cpp b/semester_2/eduincs/pgrm_001.cpp
@@ -0,0 +1,15 @@
+/*
+ * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 29 Jun 2026
+ * Repo: https://github.com/notamitgamer/bsc
+ * License: MIT
+ */
+
+/* hello world */
+
+#include<iostream>
+using namespace std;
+int main() {
+ cout << "hello, world!" << endl;
+ cout << "Now we are at void";
+ return 0;
+}+
\ No newline at end of file
diff --git a/semester_2/eduincs/pgrm_002.cpp b/semester_2/eduincs/pgrm_002.cpp
@@ -0,0 +1,17 @@
+/*
+ * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 29 Jun 2026
+ * Repo: https://github.com/notamitgamer/bsc
+ * License: MIT
+ */
+
+/* Taking input */
+
+#include<iostream>
+using namespace std;
+int main() {
+ int n;
+ cout << "Enter the number: ";
+ cin >> n;
+ cout << "You entered: " << n;
+ return 0;
+}+
\ No newline at end of file
diff --git a/semester_2/eduincs/pgrm_003.cpp b/semester_2/eduincs/pgrm_003.cpp
@@ -0,0 +1,33 @@
+/*
+ * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 29 Jun 2026
+ * Repo: https://github.com/notamitgamer/bsc
+ * License: MIT
+ */
+
+/* class - object */
+
+#include<iostream>
+using namespace std;
+
+class person {
+ public:
+ int age;
+ string name;
+
+ void setName(string n) {
+ name = n;
+ }
+
+ void setAge(int a) {
+ age = a;
+ }
+};
+
+int main() {
+ person p;
+ p.setName("Amit Dutta");
+ p.setAge(19);
+ cout << "Name: " << p.name << endl;
+ cout << "Age: " << p.age;
+ return 0;
+}+
\ No newline at end of file
diff --git a/semester_2/eduincs/pgrm_004.cpp b/semester_2/eduincs/pgrm_004.cpp
@@ -0,0 +1,47 @@
+/*
+ * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 29 Jun 2026
+ * Repo: https://github.com/notamitgamer/bsc
+ * License: MIT
+ */
+
+/* Write a program to calculate area and circumference of a circle. */
+
+#include<iostream>
+#include<cmath>
+using namespace std;
+
+class circle {
+ private:
+ double r, radius;
+
+ public:
+ circle(double r) {
+ setRadius(r);
+ }
+ ~circle() {};
+
+ void setRadius(double r) {
+ if(r >= 0) radius = r;
+ else radius = 0;
+ }
+
+ double getRadius() {
+ return radius;
+ }
+
+ double area() {
+ return M_PI * radius * radius;
+ }
+
+ double cir() {
+ return 2 * M_PI * radius;
+ }
+};
+
+int main() {
+ circle c(5);
+ cout << "Radius: " << c.getRadius() << endl;
+ cout << "Area: " << c.area() << endl;
+ cout << "Circumference: " << c.cir() << endl;
+ return 0;
+}+
\ No newline at end of file
diff --git a/semester_2/eduincs/pgrm_005.cpp b/semester_2/eduincs/pgrm_005.cpp
@@ -0,0 +1,49 @@
+/*
+ * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 29 Jun 2026
+ * Repo: https://github.com/notamitgamer/bsc
+ * License: MIT
+ */
+
+/* Write a program to calculate area and perimeter of a rectangle. */
+
+#include<iostream>
+using namespace std;
+
+class rectangle {
+ private:
+ double len, bre;
+ public:
+ rectangle() {
+ len = 0;
+ bre = 0;
+ }
+
+ void getData() {
+ cout << "Enter the length: ";
+ cin >> len;
+ cout << "Enter the breadth: ";
+ cin >> bre;
+ }
+
+ double getArea() {
+ return len * bre;
+ }
+
+ double getPeri() {
+ return 2 * (len + bre);
+ }
+
+ void display() {
+ cout << "Area: " << getArea() << endl;
+ cout << "Perimeter: " << getPeri();
+ }
+
+ ~rectangle() {}
+};
+
+int main() {
+ rectangle rec;
+ rec.getData();
+ rec.display();
+ return 0;
+}+
\ No newline at end of file