From 9e5131a1e2b6f4fc05c29ad07ccc8a4561f81a4e Mon Sep 17 00:00:00 2001 From: ajhalili2006 Date: Thu, 7 May 2026 22:46:25 +0000 Subject: [PATCH] checkpoint commit cramming session help Signed-off-by: ajhalili2006 --- .idx/dev.nix | 1 + .../studentops/projects/DivideDemo_v2.java | 35 ++++++++----------- .../PETA_labs_20260326_activity1.java | 21 ++--------- .../PETA_labs_20260326_activity2.java | 26 +++++++++++++- 4 files changed, 43 insertions(+), 40 deletions(-) diff --git a/.idx/dev.nix b/.idx/dev.nix index a4c022f..ba6f778 100644 --- a/.idx/dev.nix +++ b/.idx/dev.nix @@ -17,6 +17,7 @@ deno github-copilot-cli gemini-cli + nano ]; idx = { diff --git a/java/src/dev/andreijiroh/studentops/projects/DivideDemo_v2.java b/java/src/dev/andreijiroh/studentops/projects/DivideDemo_v2.java index 3e1cd18..532b144 100644 --- a/java/src/dev/andreijiroh/studentops/projects/DivideDemo_v2.java +++ b/java/src/dev/andreijiroh/studentops/projects/DivideDemo_v2.java @@ -16,26 +16,21 @@ import java.util.InputMismatchException; */ public class DivideDemo_v2 { public static void main(String[] args) { - while (true) { - Scanner keyboard = new Scanner(System.in); - try { - int a = 10; - System.out.print("Enter a integer: "); - int b = keyboard.nextInt(); - int result = a / b; - System.out.println("Result: " + result); - break; - } catch (ArithmeticException e) { - System.err.println("Can't divide by zero or something gone wrong while trying to divide"); - break; - } catch (InputMismatchException e) { - System.err.println("That parameter must be a integer"); - keyboard.nextLine(); - } catch (Exception e) { - System.err.println("Something gone wrong while running this program: "+ e); - break; - } - keyboard.close(); + Scanner keyboard = new Scanner(System.in); + try { + int a = 10; + System.out.print("Enter a integer: "); + int b = keyboard.nextInt(); + int result = a / b; + System.out.println("Result: " + result); + } catch (ArithmeticException e) { + System.err.println("Can't divide by zero or something gone wrong while trying to divide"); + } catch (InputMismatchException e) { + System.err.println("That parameter must be a integer"); + keyboard.nextLine(); + } catch (Exception e) { + System.err.println("Something gone wrong while running this program: "+ e); } + keyboard.close(); } } diff --git a/java/src/dev/andreijiroh/studentops/projects/PETA_labs_20260326_activity1.java b/java/src/dev/andreijiroh/studentops/projects/PETA_labs_20260326_activity1.java index a942cce..86437c0 100644 --- a/java/src/dev/andreijiroh/studentops/projects/PETA_labs_20260326_activity1.java +++ b/java/src/dev/andreijiroh/studentops/projects/PETA_labs_20260326_activity1.java @@ -45,26 +45,8 @@ public class PETA_labs_20260326_activity1 { case March: System.out.println("Graduation time!"); break; - case April: - System.out.println("TBD"); - break; - case May: - System.out.println("TBD"); - break; - case June: - System.out.println("TBD"); - break; case July: - System.out.println("TBD"); - break; - case August: - System.out.println("TBD"); - break; - case September: - System.out.println("TBD"); - break; - case October: - System.out.println("TBD"); + System.out.println("We're so back to school!"); break; case November: System.out.println("We'll be in [INSERT CEREMENTRY HERE] sending you thoughts and prayers. (context: TheJuiceMedia Honest Gov't Ads)"); @@ -74,6 +56,7 @@ public class PETA_labs_20260326_activity1 { break; default: // TNB\ + System.out.println("Have a nice day!"); break; }; } diff --git a/java/src/dev/andreijiroh/studentops/projects/PETA_labs_20260326_activity2.java b/java/src/dev/andreijiroh/studentops/projects/PETA_labs_20260326_activity2.java index 4aedbfd..12bd3f1 100644 --- a/java/src/dev/andreijiroh/studentops/projects/PETA_labs_20260326_activity2.java +++ b/java/src/dev/andreijiroh/studentops/projects/PETA_labs_20260326_activity2.java @@ -1,9 +1,33 @@ package dev.andreijiroh.studentops.projects; +import java.math.BigInteger; +import java.util.Scanner; + /** * PETA activity 2 code for lab exercise on 2026-03-26 * @author Andrei Jiroh Halili (STI College Meycauayan) */ public class PETA_labs_20260326_activity2 { - // TBD + static class Student { + String name = "Andrei Jiroh Halili"; + int studentId = 2000459491; + + class Profile { + String course = "BS in Information Technology"; + String yearLevel = "1Y2"; + } + + void showInfo() { + /* Obviously auto-completed by Gemini on Firebase Studio (aka VS Code for Web) */ + System.out.println("Name: "+name); + System.out.println("Student ID: "+studentId); + System.out.println("Course: "+new Profile().course); + System.out.println("Year Level: "+new Profile().yearLevel); + } + } + + public static void main(String[] args) { + Student studentOpsInfo = new Student(); + studentOpsInfo.showInfo(); + } } -- 2.51.2