Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
186 commits
Select commit Hold shift + click to select a range
64a4535
♻️ Update README.md
flexycode Apr 6, 2024
d7e8362
Merge pull request #1 from flexycode/flexycode-patch-1
flexycode Apr 6, 2024
c12faec
✨ Update README.md
flexycode Apr 8, 2024
c98d098
📓 Add accessing_array_elements java file
flexycode Apr 12, 2024
88af7bd
📓 Add array
flexycode Apr 12, 2024
7d109a4
📓 Rename week_1 to week_2
flexycode Apr 12, 2024
78c5e12
📓 looping_through_a_multidimensional_array
flexycode Apr 12, 2024
385442c
📓 Add looping_through_an_array
flexycode Apr 12, 2024
c7a6729
📓 Add looping_through_an_array_with_conditions
flexycode Apr 12, 2024
b057c9d
📓 Add multidimensional_array
flexycode Apr 12, 2024
5764a68
📓 Add multidimensional_array_patterns
flexycode Apr 12, 2024
0da4964
📓 Add excemption_handling
flexycode Apr 12, 2024
88606b2
📓 Add file_handling java file_class
flexycode Apr 12, 2024
72bba2a
📓 Add arrayindexoutofbounds_exception
flexycode Apr 12, 2024
41a926c
📓 Add illegalargument_exception
flexycode Apr 12, 2024
671c5d4
📓 Add nullpointer_exception
flexycode Apr 12, 2024
f52dbe1
📓 Add userdefined_exception
flexycode Apr 12, 2024
614df40
📓 Add create_file
flexycode Apr 12, 2024
aea211f
📓 Add delete_file
flexycode Apr 12, 2024
9efe55f
📓 Add read_file
flexycode Apr 12, 2024
7d9704d
📓 Add write_file
flexycode Apr 12, 2024
b530db9
✨ Update documentation in README.md
flexycode Apr 12, 2024
086abcc
📓 Add GUI
flexycode Apr 12, 2024
21379a9
📓 Add GUI Example code
flexycode Apr 12, 2024
6c950cc
♻️ Add Exception-Handling
flexycode Apr 13, 2024
a642e58
♻️
flexycode Apr 13, 2024
8a7c8ef
📓 Add File-Handling
flexycode Apr 13, 2024
4077a59
🧊 Update README.md
flexycode Apr 13, 2024
dcffb00
📓 Add Exception Handling
flexycode Apr 13, 2024
d9248c9
🔨 Delete XActivityCode/week_3/Exception-Handling/App.java
flexycode Apr 13, 2024
869d85d
📓 Upload File-Handling files
flexycode Apr 13, 2024
cd5ebf4
📓 Add FileHandling Java
flexycode Apr 13, 2024
f24ddb4
🔨 Delete XActivityCode/week_3/File-Handling/App.java
flexycode Apr 13, 2024
4d08ff6
💻 Update README.md
flexycode Apr 19, 2024
1a96e77
💻 Update README.md
flexycode Apr 19, 2024
62bf253
Create LICENCE.md
flexycode Apr 19, 2024
05697c6
🔒 Create LICENSE
flexycode Apr 19, 2024
63e2963
♻️ Delete LICENCE.md
flexycode Apr 19, 2024
3c11f13
💻 Update README.md
flexycode Apr 19, 2024
26f1b83
Add StringBuilder
flexycode Apr 20, 2024
eb353ba
Add partial code for this activity
flexycode Apr 20, 2024
b730f7e
commit
flexycode Apr 20, 2024
37d07c6
Add StringBuilder.java
flexycode Apr 20, 2024
13232a2
📓 Update StringBuilder.java
flexycode Apr 20, 2024
d9b46e6
Update StringBuilder.java
flexycode Apr 20, 2024
7492a72
Update StringBuilder.java
flexycode Apr 20, 2024
ca5f5dd
📓 Update StringBuilder.java
flexycode Apr 20, 2024
e63251c
Add Append
flexycode Apr 21, 2024
f935449
Add Insert StringBuilder
flexycode Apr 21, 2024
5451f6e
Update README.md
flexycode Apr 22, 2024
fa6af82
💻 Update README.md
flexycode Apr 22, 2024
451e562
💻 Update README.md
flexycode Apr 22, 2024
77471a9
📓 Added RegularExpression
flexycode Apr 22, 2024
b85539a
📓 Added RegularExpression for Match
flexycode Apr 22, 2024
bc054fe
📓 Update
flexycode Apr 22, 2024
16aa76c
📓 RegexPattern
flexycode Apr 22, 2024
eae95b9
📓 Added SBReplace
flexycode Apr 22, 2024
20860d1
📓 Added Delete
flexycode Apr 22, 2024
ab6b127
📓 Added Reverse
flexycode Apr 22, 2024
5121879
Delete XActivityCode/week_4/StringBuilder directory
flexycode Apr 22, 2024
1ded1f0
📓 Added StringBuilder Java File
flexycode Apr 22, 2024
53b8b58
💬 Create Instruction.txt
flexycode Apr 22, 2024
9c2b230
💬 Create Instruction.txt
flexycode Apr 22, 2024
26fac38
Update README.md
flexycode Apr 25, 2024
b465a38
📓 Add introduction
flexycode Apr 26, 2024
080ee4c
📓 Added sample program for recursion
flexycode Apr 26, 2024
e8ceaa0
📓 Added Sample of Recursion
flexycode Apr 27, 2024
9b0912e
📓 Added recursive_factorial
flexycode Apr 28, 2024
1b05778
📓 Added recursive_fibonacci
flexycode Apr 28, 2024
c40adcb
Update README.md
flexycode Apr 29, 2024
af502fe
Update README.md
flexycode May 1, 2024
f05ede4
💻 Update README.md
flexycode May 1, 2024
8edec4f
💻 Update README.md
flexycode May 4, 2024
68bfeb8
💻 Update README.md
flexycode May 5, 2024
87c1fba
💻 Update README.md
flexycode May 8, 2024
0467c8a
📓 Add Polymorphism_1 example
flexycode May 9, 2024
e447da8
📓 Add Polymorphism_2 example
flexycode May 9, 2024
e1fdcd9
📓 Add explanation
flexycode May 9, 2024
2822f72
💻 Update README.md
flexycode May 10, 2024
e2b05e2
📓 Added class_with_constructor
flexycode May 10, 2024
460da60
📓 Added standard_class
flexycode May 10, 2024
cb6d24e
📓 Move class_with_constructor into claases folder
flexycode May 10, 2024
fb34fde
📓 Move standard_class to classes folder
flexycode May 10, 2024
9cf209c
📓 Added intermediate_java
flexycode May 10, 2024
7c267da
📓 Added methods
flexycode May 10, 2024
3c53de3
📓 Add aggregation example
flexycode May 10, 2024
cce9cca
📓 Add aggregation example Fauna
flexycode May 10, 2024
0abb7db
📓 Add aggregation example
flexycode May 10, 2024
61cbf2c
📓 Add Fauna.java
flexycode May 10, 2024
2f06e60
📓 Add association
flexycode May 10, 2024
8e3c117
📓 Add Department in association java folder
flexycode May 10, 2024
7c344de
📓 Add Professor.java in association
flexycode May 10, 2024
6ec25b7
🧊 Add Long Quiz
flexycode May 11, 2024
356ee86
🧊 Create Instruction for this Quiz
flexycode May 11, 2024
b9f2206
💻 Update README.md
flexycode May 12, 2024
bb9ce07
💻 Update README.md
flexycode May 12, 2024
82525ed
💻 Update README.md
flexycode May 12, 2024
7678010
🧊 Added Lab Activity 4 - Regular Expression
flexycode May 12, 2024
317c347
🧊 Create Instruction for Lab Activity 4
flexycode May 12, 2024
24e9d5d
💻 Update README.md
flexycode May 12, 2024
af740e9
📓 Add Regex character_class
flexycode May 12, 2024
c5eab7b
💻 Update README.md
flexycode May 14, 2024
c925d42
💻 Update README.md
flexycode May 15, 2024
fa1ec6d
💻 Update README.md
flexycode May 15, 2024
29bd3f7
💻 Update README.md
flexycode May 16, 2024
7690395
💻 Update README.md
flexycode May 16, 2024
2a72c93
💻 Update README.md
flexycode May 17, 2024
ca39c28
📓 Add regex_pattern
flexycode May 17, 2024
e70a954
📓 Add string_pattern
flexycode May 17, 2024
1618ee5
📓 Add combination_regex
flexycode May 17, 2024
d722dd6
💻 Update README.md
flexycode May 18, 2024
86b3b79
💻 Update README.md
flexycode May 18, 2024
76cd6ec
📓 Move class_with_constructor and classes_and_objects
flexycode May 19, 2024
76f58af
📓 Add MainStudentRecord
flexycode May 19, 2024
a2993a2
📓 Add Student class
flexycode May 19, 2024
418ba52
📓 Add Courses class
flexycode May 19, 2024
56430eb
📓 Add Degree class
flexycode May 19, 2024
264d2c4
💻 Update README.md
flexycode May 19, 2024
3ab03a2
💻 Update README.md
flexycode May 19, 2024
e55801a
💻 Update README.md
flexycode May 19, 2024
a1d4e3d
💻 Update README.md
flexycode May 30, 2024
549f233
💻 Update README.md
flexycode May 30, 2024
cb83041
💻 Update README.md
flexycode May 30, 2024
97feb56
💻 Final Revision
flexycode Jun 7, 2024
63f14af
Merge pull request #3 from flexycode/flexycode-patch-2
flexycode Jun 7, 2024
10e8c86
💻 Update README.md
flexycode Jun 7, 2024
aa7e0c9
💻 Update README.md
flexycode Jun 9, 2024
3774988
💻 Update README.md
flexycode Jun 12, 2024
7d713d5
📓 Add JButton sample1
flexycode Jun 15, 2024
04dc7b7
📓 Add JButton sample2
flexycode Jun 15, 2024
52c2524
🚀 Add Two png file for the Sample2
flexycode Jun 15, 2024
025180a
📓 Add JCheckBox
flexycode Jun 15, 2024
69b707a
📓 Add JComboBox
flexycode Jun 15, 2024
6840236
📓 Add JComboBox Frame.java
flexycode Jun 15, 2024
d4dc7a4
🚀 Add png file Icon
flexycode Jun 15, 2024
0857cad
📓 Add JFrame Java File
flexycode Jun 15, 2024
5642080
🚀 Add tiktok png file
flexycode Jun 15, 2024
ffcc4fe
📓 Add JLabel Java File
flexycode Jun 15, 2024
3f4cac9
📓 Add smile png
flexycode Jun 15, 2024
2a9bea4
📓 Add JList Multiple Selection Java file
flexycode Jun 15, 2024
aba537a
📓 Add JList Single Selection Java file
flexycode Jun 15, 2024
007cfb3
📓 Add JPanel java file
flexycode Jun 15, 2024
56e25ed
📓 Add JRadioButton Java file
flexycode Jun 15, 2024
f7fa2cd
📓 Add Layout BorderLayout Java file
flexycode Jun 15, 2024
c3b2ccf
📓 Add Layout FlowLayout java file
flexycode Jun 15, 2024
a65c0cc
📓 Add Layout GridLayout
flexycode Jun 15, 2024
1829a00
📓 Add Inheritance java file
flexycode Jun 15, 2024
c75b3e3
📓 Add Polymorphism Grocery App.java
flexycode Jun 15, 2024
f23c8d7
📓 Add class Cashier for Grocery Polymorphism
flexycode Jun 15, 2024
d53af9a
📓 Add class GroceryItem to Grocery Polymorphism
flexycode Jun 15, 2024
fca5c98
📓 Add class Junkfood for Grocery Polymorphism
flexycode Jun 15, 2024
464ffbd
📓 Add class Shampoo for Grocery Polymorphism
flexycode Jun 15, 2024
64e0da9
📓 Add Polymorphism example "Person"
flexycode Jun 15, 2024
40aad4a
📓 Add Abstraction java file
flexycode Jun 15, 2024
878821d
📓 Add Encapsulation Java file
flexycode Jun 15, 2024
577d4ec
🔨 Fix some string value
flexycode Jun 15, 2024
6ea94b8
📓 Add MouseEvents and Image_as_Background
flexycode Jun 15, 2024
88d6104
📓 Add Sample of event-driven programming
flexycode Jun 15, 2024
01fdffb
🚀 Add png, jpg and gif file
flexycode Jun 15, 2024
5767962
👷 Rename folder
flexycode Jun 15, 2024
ad58ff5
💻 Update README.md
flexycode Jun 17, 2024
650d038
💻 Update README.md
flexycode Jun 17, 2024
f925bc4
✨ Update README.md
flexycode Jun 17, 2024
c5e11e6
💻 Update README.md
flexycode Jun 17, 2024
f57e449
💻 Update README.md
flexycode Jun 17, 2024
2953f90
💻 Update README.md
flexycode Jun 17, 2024
9ee2ab5
💻 Update README.md
flexycode Jun 17, 2024
002f1aa
💻 Update README.md
flexycode Jun 17, 2024
d5748a3
💻 Update README.md
flexycode Jun 17, 2024
dfa1316
💻 Update README.md
flexycode Jun 17, 2024
b110495
💻 Update README.md
flexycode Jun 17, 2024
0a16653
💻 Update README.md
flexycode Jun 17, 2024
7becba8
💻 Update README.md
flexycode Jun 18, 2024
4ac7ffb
📓 Add Multithreading for extends and implements
flexycode Jun 18, 2024
0f7c735
📓 Add MyRunnable
flexycode Jun 18, 2024
be917a0
📓 Add MyThread
flexycode Jun 18, 2024
7410c95
📓 Add extends and implements file for Multithreading
flexycode Jun 18, 2024
9c1305b
📓 Add Threads
flexycode Jun 18, 2024
92f6318
💻 Update Documentation
flexycode Jun 18, 2024
7603127
💻 Update README.md
flexycode Jun 19, 2024
819ad4e
📓 Add locks App.java
flexycode Jun 20, 2024
8cfcad2
📓 Add locks MyThreads.java
flexycode Jun 20, 2024
9bbc5a8
📓 Add registration java file folder
flexycode Jun 20, 2024
fcea70a
📓 Add reservation and shared_array
flexycode Jun 20, 2024
13dcd01
💻 Show GPA
flexycode Jul 30, 2024
2f1b4e3
Merge pull request #4 from flexycode/flexycode-patch-3
flexycode Jul 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"githubPullRequests.ignoredPullRequestBranches": [
"main"
]
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Jay Arre P. Talosig

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
162 changes: 128 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
### Professor: Jay D. Abaleta         
### No. of Units: 3 Units
### Prerequisite: [CCPRGG1L Fundamentals of Programming](https://github.com/flexycode/CCPRGG1L_FUNDAMENTALS_COM23P)
### GPA : 3.50 [Passed](https://www.youtube.com/watch?v=19fUYjhGy0c)

# 📊 Table of Contents

Expand All @@ -16,7 +17,7 @@
- [FAQ](#faq)      
- [Changelog](#changelogs)  

## [Introduction](#introduction)
## [Introduction](#introduction)
This repository contains source code for a Java project that focuses on Intermediate concepts, codes and exercises.

#### Course Description:
Expand All @@ -30,32 +31,31 @@ At the end of the course, the studend must be able to:

###### ⚡ Course Outline: ACO -CI-F- 030(01) Course Outline - CCPRGG2L - COM

# 💻 Lesson
# 💻 Lesson 

### CCPRGG1L Table lecture
#### Course Outline and Timeframe

| Week No. | Date Coverage | Topic | Reference |
|----------|--------------------------------------------------------------|-------------------------------------------------------------------|-----------------------------------------------------------------------|
| 1 | April 6 | Class Orientation | Course Syllabus |
| | | Ø University Mission & Vision | | | | | Ø College Mission & Vision | |
| | | Ø Course Syllabi | |
| | | Ø Lab Guidelines and Safety Review | |
| 2 | April 6 | Arrays | Chapter 8&9 Java Programming Eight Edition, Farrell, Joyce |
| 3 | April 13-17 | File and String manipulation | Chapter 7&13 Java Programming Eight Edition, Farrell, Joyce |
| 4 | April 20 | Recursion | Chapter 2 Introduction to Programming in Java: |
| | April 27 | | An Interdisciplinary Approach, 2nd Edition, Robert Sedgewick |
| | | | Chapter 13 Java Programming: From Problem Analysis to |
| | | | Program Design, Fifth Edition., Malik, DS |
| 5 | May 4 | Regular Expression | Chapter 30 Java : The Complete Reference Tenth Edition, Schildt, Herbert, 2018 |
| 6 | May 11 | Introduction to Classes | Chapter 3 Java Programming Eight Edition, Farrell, Joyce |
| 7 | May 18 | Composition, objects, and classes | Chapter 3 Introduction to Programming in Java: An Interdisciplinary Approach, 2nd Edition, Robert Sedgewick |
| 8 | May 25 | Instance method Inheritance Polymorphism | Chapter 10 Java Programming: From Problem Analysis to Program Design, Fifth Edition., Malik, DS |
| 9 | June 1 | Introduction to Swing package | Chapter 14 Java Programming Eight Edition, Farrell, Joyce |
| 10 | June 8 | Interfaces and event-driven programming | Chapter 10 Core Java: Volume II Advanced Features Tenth Edition, Hortsmann, Cay S., 2017 |
| 11 | June 15 | Threads | Chapter 11 Java : The Complete Reference Tenth Edition, Schildt, Herbert, 2018 |
| 12 | July 29 | Runnable interface Synchronization | Chapter 11 Core Java: Volume II Advanced Features Tenth Edition, Hortsmann, Cay S., 2017 |
| 13 | July 6 | Course Synthesis & Final Examination | |
| Week No. | Date Coverage | Topic | Reference |
|----------|---------------|------------------------------------------------------|-----------------------------------------------------------------------------------------------------|
| 1 | April 6 | Class Orientation | Course Syllabus |
| | | - Ø University Mission & Vision | |
| | | - Ø College Mission & Vision | |  
| | | - Ø Course Syllabi | | 
| | | - Ø Lab Guidelines and Safety Review | |
| 2 | April 6 | Arrays | Chapter 8&9 Java Programming Eight Edition, Farrell, Joyce |
| 3 | April 13 | File and String manipulation | Chapter 7&13 Java Programming Eight Edition, Farrell, Joyce |
| 4 | April 20 | Recursion | Chapter 2 Introduction to Programming in Java: An Interdisciplinary Approach, 2nd Edition, Robert Sedgewick |
| | April 27 | | Chapter 13 Java Programming: From Problem Analysis to Program Design, Fifth Edition, Malik, DS |
| 5 | May 4 | Regular Expression | Chapter 30 Java: The Complete Reference Tenth Edition, Schildt, Herbert, 2018 |
| 6 | May 11 | Introduction to Classes | Chapter 3 Java Programming Eight Edition, Farrell, Joyce |
| 7 | May 18 | Composition, objects, and classes | Chapter 3 Introduction to Programming in Java: An Interdisciplinary Approach, 2nd Edition, Robert Sedgewick |
| 8 | May 25 | Instance method Inheritance Polymorphism | Chapter 10 Java Programming: From Problem Analysis to Program Design, Fifth Edition, Malik, DS |
| 9 | June 1 | Introduction to Swing package | Chapter 14 Java Programming Eight Edition, Farrell, Joyce |
| 10 | June 8 | Interfaces and event-driven programming | Chapter 10 Core Java: Volume II Advanced Features Tenth Edition, Hortsmann, Cay S., 2017 |
| 11 | June 15 | Threads | Chapter 11 Java: The Complete Reference Tenth Edition, Schildt, Herbert, 2018 |
| 12 | June 22 | Runnable interface Synchronization | Chapter 11 Core Java: Volume II Advanced Features Tenth Edition, Hortsmann, Cay S., 2017 |
| 13 | June 29 | Course Synthesis & Final Examination | |


#### SUGGESTED READINGS AND REFERENCES
Expand Down Expand Up @@ -101,13 +101,12 @@ coming soon

🤖 Compile the Java code using javac and run the compiled program with java.


```bash
javac ProgScanner.java
java ProgScanner
javac [java file name] 
java [java file name] 
```

# 🏆 Contributing 
# 🏆 Contributing  


### 🧠 Submitting Changes
Expand All @@ -125,7 +124,7 @@ java ProgScanner

# 🔑 License 

This course project repository is licensed under the MIT License and National University.
This course project repository is licensed under the [MIT License and National University](https://github.com/flexycode/CCPRGG2L_INTERMEDIATE_PROGRAMMING/blob/main/LICENSE)

## National University of Manila License   

Expand All @@ -149,7 +148,7 @@ This project is provided "as is" without warranty of any kind, express or implie

# 🔭Acknowledgements   

### ✨ Professor Jay A. Abaleta 
### ✨ Professor Jay A. Abaleta  
Professor Jay Abaleta is a Senior Software Engineer and esteemed faculty member at National University. With a strong background in teaching the core principles and advanced concepts of Java, he is highly regarded in the field. In addition to his role at National University, Prof. Abaleta also serves as a Professor at Adamson University and as a lecturer of IT/CS at Arba Minch University, sharing his expertise with students worldwide. Having studied at St. Paul University Philippines, Prof. Abaleta brings a wealth of knowledge and experience to his teaching. Known for his friendly and approachable nature, Prof. Abaleta fosters a positive learning environment where students thrive. His dedication and passion for teaching have made him a beloved professor among his students.

# 💬FAQ    
Expand All @@ -158,17 +157,112 @@ To be follow
```

# 📫 Changelogs     
## [4.1.1] - 2024-04-6     
### Added
- Uploaded the Course Syllabus
- Added breakdown and documentation
## [4.1.4] - 2024-04-6      
### Added  
- Uploaded the Course Syllabus
- Added breakdown and documentation

### Changed
- ✨ revised icon

### Fixed 
- ✨ Revised my documentaion

## [4.1.5] - 2024-04-14       
### Added  
- ✨ Added Exception-Handling Lab-1 Activity
- ✨ Added File-Handling Lab-2 Activity

### Changed
- ✨ Change documentation
- ✨ Change some variable and refix function in both Lab Activity

### Fixed
- ✨ Fixed commit error changes

## [4.1.4] - 2024-04-20         
### Added 
- ✨ Added StringBuilder.java for StringManipulation activity

### Changed
- ✨ Changed documentatation

### Fixed
- Revised my documentaion
- ✨ Fixed commit error changes
- ✨ Fixed Systax error
- ✨ Fixed build structure

## [4.1.4] - 2024-05-04 
- ✨ Discussion regarding recursion 
- ✨ Added Source code for recursion

### Activity
- 💻 45 Minutes 
- 💻 Long Quiz

## [4.1.5] - 2024-05-11         
### Added 
- ✨ Discussion material for Regular Expression (RegEx)
- ✨ Added Lab activity 4 for Regular Expression
- ✨ Added source code example for Regular Expression (RegEx)

### Changed
- ✨ Changed documentatation

### Activity
- 💻 Lab Class
- 💻 Lab Activity 4

## [4.1.5] - 2024-05-18         
### Added 
- ✨ Add Object and Classes java file
- ✨ Add Professor Jay example for object and classes java file

### Changed
- ✨ Move Object and Classes java file into folder week 6 to week 7 folder

### Activity
- 💻 Class Lecture about Classes and Object
- 💻 Lab Class
- 💻 Lab Activity 5 Object and Classes

## [5.1.2] - 2024-05-25          
### Added    
- ✨ Added Polymorphism code example


## [6.1.1] - 2024-06-01   
### Activity
- 💻 Long Quiz No. 2                 

## [6.1.10] - 2024-06-08
### Added
- ✨ Add 2 Sample of JButton     
- ✨ Add Java file for JCheckBox    
- ✨ Add Java file for JComboBox        
- ✨ Add Java file for JFrame    
- ✨ Add Java file for JLabel          
- ✨ Add JList Java file folder for Single & Multiple Selection   
- ✨ Add Java file for JPanel 
- ✨ Add Java file for JRadioButton
- ✨ Add 3 file folder for Layout: ( BorderLayout, FlowLayout and GridLayout )                         
### Activity 
- 💻 Lab Lecture - Introduction to Swing Packages 

## [6.1.1] - 2024-06-15   
### Added
- ✨ Add Java file for Image as Background       
- ✨ Add Java file for MouseEvents
- ✨ Add Java Application: Snake Game     
### Activity   
- 💻 Lab Lecture - Introduction to Swing Packages

## [6.1.2] - 2024-06-22       
### Added
- ✨ Add Thread topic and source code         
- ✨ Add Multithreading with 3 sample Java file       


#### [Back to Table of Content](#introduction)    


Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package ArrayExceptionHandling;

import java.util.Scanner;

public class ArrayExceptionHandling {
public static void main(String[] args) {
String[] array = {"One", "Two", "Three"};
Scanner scanner = new Scanner(System.in);

System.out.println("Array values: " + String.join(", ", array));

while (true) {
try {
System.out.print("Enter Array Index: ");
int index = scanner.nextInt();

if (index >= 0 && index < array.length) {
System.out.println("Array Element = " + array[index]);
System.out.println("Exception: Caught");
} else {
throw new ArrayIndexOutOfBoundsException("Index " + index + " out of bounds for length " + array.length);
}
} catch (ArrayIndexOutOfBoundsException e) {
System.out.println(e.getMessage());
System.out.println("Quitting...");
break;
} catch (Exception e) {
System.out.println("Exception: Caught");
scanner.nextLine(); // Clear the input buffer
}
}

scanner.close();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Juan Limbo34
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Alan 12Laure
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Kenzo Virus26
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Gabriel Macato36
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Joshua 78Manalansan
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
package FileHandling;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;

public class FileHandling {
public static void main(String[] args) {
// Create a file containing the usernames and passwords
String[] fileContents = {"Juan Limbo34", "Alan 12Laure", "Kenzo Virus26", "Gabriel Macato36", "Joshua 78Manalansan"};
createFile(fileContents);

// Read the file and validate the username and password
Scanner scanner = new Scanner(System.in);
System.out.print("Enter username: ");
String username = scanner.nextLine();
System.out.print("Enter password: ");
String password = scanner.nextLine();

boolean validCredentials = validateCredentials(username, password);
if (validCredentials) {
System.out.println("Successfully entered the program!");
} else {
System.out.println("Invalid username or password.");
}

scanner.close();
}

private static void createFile(String[] fileContents) {
try {
// Set the file path to your Documents folder
String filePath = "C:\\Users\\flexycode\\eclipse-workspace\\File-Handling";
for (int i = 0; i < fileContents.length; i++) {
FileWriter textOut = new FileWriter(filePath + "namepass_" + i + ".txt");
textOut.write(fileContents[i]);
textOut.close();
}
} catch (IOException e) {
System.out.println("An error occurred while creating the file.");
e.printStackTrace();
}
}

private static boolean validateCredentials(String username, String password) {
for (int i = 0; i < 5; i++) {
try {
File file = new File("namepass_" + i + ".txt");
Scanner fileScanner = new Scanner(file);
String line = fileScanner.nextLine();
String[] credentials = line.split(" ");
if (credentials.length == 2 && credentials[0].equals(username) && credentials[1].equals(password)) {
fileScanner.close();
return true;
}
fileScanner.close();
} catch (FileNotFoundException e) {
System.out.println("An error occurred while reading the file.");
e.printStackTrace();
}
}
return false;
}
}
19 changes: 19 additions & 0 deletions XActivityCode/week_3/Instruction.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Lab Activity 1 - Exception Handling

## Instructions
Create a java Program use the exception handling to Compile and run the Test Exceptions
program. The program will ask the user to input the array index to validate the exception handling in Array Exception, The output should look like this:

array value of: One, Two, Three

Enter Array Index: 1
Output:
Array Element = Two
Exception: Caught

Enter Array Index: 6
Output:
Index 6 out of bounds for length 3

Quitting...

Loading