From bd3848de88bb5e6ae5e10f314d99a051ddf4d8c8 Mon Sep 17 00:00:00 2001 From: "Andrei Jiroh Halili (STI College Meycauayan)" Date: Thu, 12 Feb 2026 09:01:54 +0800 Subject: [PATCH] chore: pack things up before leaving Signed-off-by: Andrei Jiroh Halili (STI College Meycauayan) --- .vscode/settings.json | 10 +++- CONTRIBUTING.md | 1 + .../studentops/projects/ComProg2_Lab1.java | 58 +++++++++++++++++++ 3 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 CONTRIBUTING.md create mode 100644 java/src/dev/andreijiroh/studentops/projects/ComProg2_Lab1.java diff --git a/.vscode/settings.json b/.vscode/settings.json index 1015ea2..074e8a2 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,5 +7,13 @@ "java.project.outputPath": "java/out", "editor.insertSpaces": true, "editor.tabSize": 2, - "java.debug.settings.onBuildFailureProceed": true + "java.debug.settings.onBuildFailureProceed": true, + "gitlens.remotes": [{ + "domain": "altssh.gitlab.com", + "name": "GitLab.com", + "type": "GitLab", + "urls": { + "commit": "https://gitlab.com/${repo}" + } + }] } \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..5ca117b --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1 @@ +# Contributing guidelines \ No newline at end of file diff --git a/java/src/dev/andreijiroh/studentops/projects/ComProg2_Lab1.java b/java/src/dev/andreijiroh/studentops/projects/ComProg2_Lab1.java new file mode 100644 index 0000000..6a17f56 --- /dev/null +++ b/java/src/dev/andreijiroh/studentops/projects/ComProg2_Lab1.java @@ -0,0 +1,58 @@ +package dev.andreijiroh.studentops.projects; + +/** + * Computer Programming 1 - Lab 1 + * + * Note that since classes are nested, we need to add static instead of individually do + * `public static void` on both `Biodata` and `Manager` classes. + * + * @author Andrei Jiroh Halili (STI College Meycauayan) + * @see https://stackoverflow.com/questions/9560600/what-causes-error-no-enclosing-instance-of-type-foo-is-accessible-and-how-do-i#9560633 + */ +class Comprog2_Lab1 { + static class Biodata { + String name; + int age; + String emailUsername; + + Biodata(String name, int age, String emailUsername) { + this.name = name; + this.age = age; + this.emailUsername = emailUsername; + } + + void introduce() { + System.out.println("Goodday, I am "+name+", "+age+" years old and my email is "+emailUsername+"@lairland.is-a.dev."); + } + } + + static class Manager { + String name; + int age; + String position; + String organization; + + Manager (String name, int age, String position, String organization) { + this.name = name; + this.age = age; + this.organization = organization; + this.position = position; + } + + void introduce() { + System.out.println("Hi, I am "+name+", "+age+" years old, the "+position+" of "+organization); + } + } + + public static void main(String[] args) { + Biodata crew1 = new Biodata("George", 21, "labs.george"); + Biodata crew2 = new Biodata("Gina", 23, "labs.gina"); + Biodata crew3 = new Biodata("Kevin", 22, "labs.kevin"); + Manager hr = new Manager("Gina",37,"HR","ABC Company"); + + crew1.introduce(); + crew2.introduce(); + crew3.introduce(); + hr.introduce(); + } +} -- 2.51.2