diff --git a/.gitignore b/.gitignore
index fc93348..2fca960 100644
--- a/.gitignore
+++ b/.gitignore
@@ -177,3 +177,7 @@
/BigIntegerFibonacci/build/
/Semester 3/GenericRules/target/
/Semester 3/MP4_Generics_CalebFontenot/target/
+/Semester 3/Assignments/FileStream/target/
+/Semester 3/Assignments/DBConnectionTest/target/
+/Semester 3/Assignments/mavenproject1/target/
+/Semester 3/Assignments/JavaFXBallsWithComparator/target/
diff --git a/Semester 3/Assignments/DBConnectionTest/pom.xml b/Semester 3/Assignments/DBConnectionTest/pom.xml
new file mode 100644
index 0000000..b59a8a1
--- /dev/null
+++ b/Semester 3/Assignments/DBConnectionTest/pom.xml
@@ -0,0 +1,21 @@
+
+
+ 4.0.0
+ edu.slcc.asdv.caleb
+ DBConnectionTest
+ 1.0-SNAPSHOT
+ jar
+
+
+ mysql
+ mysql-connector-java
+ 8.0.33
+
+
+
+ UTF-8
+ 20
+ 20
+ edu.slcc.asdv.caleb.dbconnectiontest.DBConnectionTest
+
+
\ No newline at end of file
diff --git a/Semester 3/Assignments/DBConnectionTest/src/main/java/edu/slcc/asdv/caleb/dbconnectiontest/DBConnectionTest.java b/Semester 3/Assignments/DBConnectionTest/src/main/java/edu/slcc/asdv/caleb/dbconnectiontest/DBConnectionTest.java
new file mode 100644
index 0000000..5d64235
--- /dev/null
+++ b/Semester 3/Assignments/DBConnectionTest/src/main/java/edu/slcc/asdv/caleb/dbconnectiontest/DBConnectionTest.java
@@ -0,0 +1,16 @@
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ */
+
+package edu.slcc.asdv.caleb.dbconnectiontest;
+
+/**
+ *
+ * @author caleb
+ */
+public class DBConnectionTest {
+
+ public static void main(String[] args) {
+ System.out.println("Hello World!");
+ }
+}
diff --git a/Semester 3/Assignments/DBConnectionTest/src/main/java/edu/slcc/asdv/caleb/dbconnectiontest/Database.java b/Semester 3/Assignments/DBConnectionTest/src/main/java/edu/slcc/asdv/caleb/dbconnectiontest/Database.java
new file mode 100644
index 0000000..7a14ad5
--- /dev/null
+++ b/Semester 3/Assignments/DBConnectionTest/src/main/java/edu/slcc/asdv/caleb/dbconnectiontest/Database.java
@@ -0,0 +1,129 @@
+package edu.slcc.asdv.caleb.dbconnectiontest;
+
+import java.io.Serializable;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+
+/**
+ *
+ * @author a. v. markou
+ */
+public class Database
+{
+
+ static String result = "";
+
+ private static Connection connection() //throws InstantiationException, IllegalAccessException
+ {
+
+ String databaseName = "suppliers_parts_23";
+ String userName = "admin";
+ String password = "RangerDog01!";
+ String URL2 = "com.mysql.jdbc.Driver";
+ //String URL2 = "com.mysql.cj.jdbc.Driver";
+ Connection con = null;
+ try
+ {// Load Sun's jdbc driver
+ Class.forName(URL2).newInstance();
+ System.out.println("JDBC Driver loaded!");
+ }
+ catch (Exception e) // driver not found
+ {
+ System.err.println("Unable to load database driver");
+ System.err.println("Details : " + e);
+ return null;
+ }
+ String ip = "localhost"; //internet connection
+ String url = "jdbc:mysql://" + ip + ":3306/" + databaseName;
+ try
+ {
+ con = DriverManager.getConnection(url, userName, password);
+ con.setReadOnly(false);
+ }
+ catch (Exception e)
+ {
+ System.err.println(e.toString());
+ return null;
+ }
+ System.out.println("connection successfull");
+ return con;
+ }
+
+ public String getResult()
+ {
+ return "
Suppliers
" + result;
+
+ }
+
+ public static void closeDatabaseConnection( Connection con)
+ {
+ try
+ {
+ if (con != null)
+ {
+ con.close();
+ }
+ }
+ catch (SQLException e)
+ {
+ result = e.toString();
+ e.printStackTrace();
+ }
+ }
+public static void listAllSuppliers()
+ {
+ Connection con = connection();
+ if (con == null)
+ {
+ result = "cannot connect to database" ;
+ return ;
+ }
+ String table = "";
+ PreparedStatement ps = null;
+ ResultSet rs = null;
+ String sqlStr = "SELECT * FROM supplier";
+ try
+ {
+ //prepare statement
+ ps = con.prepareStatement(sqlStr);
+ //execute
+ rs = ps.executeQuery();
+ System.out.println("before entering while");
+ while (rs.next())
+ {
+ //System.out.println("inside while");
+ String sNumber = rs.getString(1) + " ";
+ String sName = rs.getString(2) + " ";
+ String status = rs.getDate(3) + " ";
+ String city = rs.getString(4) + " ";
+ table += sNumber + sName + status + city + "\n";
+ }
+ System.out.println(table);
+ }
+ catch (Exception ex)
+ {
+ ex.printStackTrace();
+ }
+ finally
+ {
+ try
+ {
+ closeDatabaseConnection( con);
+ // close the resources
+ if (ps != null)
+ {
+ ps.close();
+ }
+ }
+ catch (SQLException sqle){ sqle.printStackTrace(); }
+ }
+ result = table;
+ }
+ public static void main(String[] args)
+ {
+ listAllSuppliers();
+ }
+}
diff --git a/Semester 3/Assignments/DBConnectionTest/src/main/java/edu/slcc/asdv/caleb/dbconnectiontest/Scroller.java b/Semester 3/Assignments/DBConnectionTest/src/main/java/edu/slcc/asdv/caleb/dbconnectiontest/Scroller.java
new file mode 100644
index 0000000..9eb0680
--- /dev/null
+++ b/Semester 3/Assignments/DBConnectionTest/src/main/java/edu/slcc/asdv/caleb/dbconnectiontest/Scroller.java
@@ -0,0 +1,22 @@
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
+ */
+package edu.slcc.asdv.caleb.dbconnectiontest;
+
+/**
+ *
+ * @author caleb
+ */
+public class Scroller {
+ public static void main(String[] args) throws InterruptedException {
+ String string = "Java moment";
+ while (true) {
+ System.out.println(string);
+ System.out.print("\033[H\033[2J");
+ System.out.flush();
+ string = string.charAt(string.length() - 1) + string.substring(0, string.length() - 1);
+ Thread.sleep(100);
+ }
+ }
+}
diff --git a/Semester 3/Assignments/FileStream/array.dat b/Semester 3/Assignments/FileStream/array.dat
new file mode 100644
index 0000000..ab34174
Binary files /dev/null and b/Semester 3/Assignments/FileStream/array.dat differ
diff --git a/Semester 3/Assignments/FileStream/inout.dat b/Semester 3/Assignments/FileStream/inout.dat
new file mode 100644
index 0000000..d5bb2bf
Binary files /dev/null and b/Semester 3/Assignments/FileStream/inout.dat differ
diff --git a/Semester 3/Assignments/FileStream/pom.xml b/Semester 3/Assignments/FileStream/pom.xml
new file mode 100644
index 0000000..7c8cf46
--- /dev/null
+++ b/Semester 3/Assignments/FileStream/pom.xml
@@ -0,0 +1,14 @@
+
+
+ 4.0.0
+ edu.slcc.asdv.caleb
+ FileStream
+ 1.0-SNAPSHOT
+ jar
+
+ UTF-8
+ 20
+ 20
+ edu.slcc.asdv.caleb.filestream.FileStream
+
+
\ No newline at end of file
diff --git a/Semester 3/Assignments/FileStream/src/main/java/edu/slcc/asdv/caleb/filestream/Copy.java b/Semester 3/Assignments/FileStream/src/main/java/edu/slcc/asdv/caleb/filestream/Copy.java
new file mode 100644
index 0000000..32b07d1
--- /dev/null
+++ b/Semester 3/Assignments/FileStream/src/main/java/edu/slcc/asdv/caleb/filestream/Copy.java
@@ -0,0 +1,62 @@
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
+ */
+package edu.slcc.asdv.caleb.filestream;
+
+/**
+ *
+ * @author caleb
+ */
+import java.io.*;
+
+public class Copy {
+ /** Main method
+ @param args[0] for sourcefile
+ @param args[1] for target file
+ */
+ public static void main(String[] args) throws IOException {
+ // Check command-line parameter usage
+ if (args.length != 2) {
+ System.out.println(
+ "Usage: java Copy sourceFile targetfile");
+ System.exit(1);
+ }
+
+ // Check if source file exists
+ File sourceFile = new File(args[0]);
+ if (!sourceFile.exists()) {
+ System.out.println("Source file " + args[0]
+ + " does not exist");
+ System.exit(2);
+ }
+
+ // Check if target file exists
+ File targetFile = new File(args[1]);
+ if (targetFile.exists()) {
+ System.out.println("Target file " + args[1]
+ + " already exists");
+ System.exit(3);
+ }
+
+ try (
+ // Create an input stream
+ BufferedInputStream input =
+ new BufferedInputStream(new FileInputStream(sourceFile));
+
+ // Create an output stream
+ BufferedOutputStream output =
+ new BufferedOutputStream(new FileOutputStream(targetFile));
+ ) {
+ // Continuously read a byte from input and write it to output
+ int r, numberOfBytesCopied = 0;
+ while ((r = input.read()) != -1) {
+ output.write((byte)r);
+ numberOfBytesCopied++;
+ }
+
+ // Display the file size
+ System.out.println(numberOfBytesCopied + " bytes copied");
+ }
+ }
+}
diff --git a/Semester 3/Assignments/FileStream/src/main/java/edu/slcc/asdv/caleb/filestream/FileChooser.java b/Semester 3/Assignments/FileStream/src/main/java/edu/slcc/asdv/caleb/filestream/FileChooser.java
new file mode 100644
index 0000000..34a043b
--- /dev/null
+++ b/Semester 3/Assignments/FileStream/src/main/java/edu/slcc/asdv/caleb/filestream/FileChooser.java
@@ -0,0 +1,28 @@
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
+ */
+package edu.slcc.asdv.caleb.filestream;
+
+import javax.swing.JFileChooser;
+import javax.swing.filechooser.FileNameExtensionFilter;
+
+/**
+ *
+ * @author caleb
+ */
+public class FileChooser {
+
+ public static void main(String[] args)
+ {
+
+// Using this process to invoke the constructor,
+// JFileChooser points to user's default directory
+ JFileChooser j = new JFileChooser();
+
+// Open the save dialog
+ j.showSaveDialog(null);
+
+ }
+}
+
diff --git a/Semester 3/Assignments/FileStream/src/main/java/edu/slcc/asdv/caleb/filestream/FileStream.java b/Semester 3/Assignments/FileStream/src/main/java/edu/slcc/asdv/caleb/filestream/FileStream.java
new file mode 100644
index 0000000..3ddcdfe
--- /dev/null
+++ b/Semester 3/Assignments/FileStream/src/main/java/edu/slcc/asdv/caleb/filestream/FileStream.java
@@ -0,0 +1,33 @@
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ */
+
+package edu.slcc.asdv.caleb.filestream;
+import java.io.*;
+/**
+ *
+ * @author caleb
+ */
+public class FileStream {
+
+ public static void main(String[] args) throws IOException {
+ try (
+ // Create an output stream to the file
+ FileOutputStream output = new FileOutputStream("temp.dat");
+ ) {
+ // Output values to the file
+ for (int i = 1; i <= 10; i++)
+ output.write(i);
+ }
+
+ try (
+ // Create an input stream for the file
+ FileInputStream input = new FileInputStream("temp.dat");
+ ) {
+ // Read values from the file
+ int value;
+ while ((value = input.read()) != -1)
+ System.out.print(value + " ");
+ }
+ }
+}
diff --git a/Semester 3/Assignments/FileStream/src/main/java/edu/slcc/asdv/caleb/filestream/ReadRawBytes.java b/Semester 3/Assignments/FileStream/src/main/java/edu/slcc/asdv/caleb/filestream/ReadRawBytes.java
new file mode 100644
index 0000000..84cac00
--- /dev/null
+++ b/Semester 3/Assignments/FileStream/src/main/java/edu/slcc/asdv/caleb/filestream/ReadRawBytes.java
@@ -0,0 +1,44 @@
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
+ */
+package edu.slcc.asdv.caleb.filestream;
+
+import java.io.IOException;
+import java.io.RandomAccessFile;
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+//import java.lang.Byte;
+
+/**
+ *
+ * @author caleb
+ */
+public class ReadRawBytes {
+ public static void main(String[] args)
+ {
+ ArrayList byteArrayList = new ArrayList();
+ // Read raw bytes from file until 0xFF
+ try ( RandomAccessFile inout = new RandomAccessFile("test.dat", "r");) {
+ byte currentByte = 0x00;
+ for (int i = 0; i < inout.length(); i++) {
+ currentByte = inout.readByte();
+ if (currentByte != -1) {
+ byteArrayList.add(currentByte);
+ } else {
+ break;
+ }
+ }
+
+ } catch (IOException ex) {
+ System.out.println(ex);
+ }
+ byte[] byteArray = new byte[byteArrayList.size()];
+ for (int i = 0; i < byteArrayList.size(); i++) {
+ byteArray[i] = byteArrayList.get(i);
+ }
+ System.out.println("Data read back from file was: ");
+ String fileString = new String(byteArray, StandardCharsets.UTF_8);
+ System.out.println(fileString);
+}
+}
diff --git a/Semester 3/Assignments/FileStream/src/main/java/edu/slcc/asdv/caleb/filestream/Test.java b/Semester 3/Assignments/FileStream/src/main/java/edu/slcc/asdv/caleb/filestream/Test.java
new file mode 100644
index 0000000..527d48b
--- /dev/null
+++ b/Semester 3/Assignments/FileStream/src/main/java/edu/slcc/asdv/caleb/filestream/Test.java
@@ -0,0 +1,43 @@
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
+ */
+package edu.slcc.asdv.caleb.filestream;
+
+import java.io.Serializable;
+
+/**
+ *
+ * @author caleb
+ */
+public class Test implements Serializable {
+
+ private int x;
+
+ public Test(int x)
+ {
+ this.x = x;
+ }
+
+ /**
+ * Get the value of x
+ *
+ * @return the value of x
+ */
+ public int getX()
+ {
+ return x;
+ }
+
+ /**
+ * Set the value of x
+ *
+ * @param x new value of x
+ */
+ public void setX(int x)
+ {
+ this.x = x;
+ }
+
+
+}
diff --git a/Semester 3/Assignments/FileStream/src/main/java/edu/slcc/asdv/caleb/filestream/TestDataStream.java b/Semester 3/Assignments/FileStream/src/main/java/edu/slcc/asdv/caleb/filestream/TestDataStream.java
new file mode 100644
index 0000000..e1bf31d
--- /dev/null
+++ b/Semester 3/Assignments/FileStream/src/main/java/edu/slcc/asdv/caleb/filestream/TestDataStream.java
@@ -0,0 +1,38 @@
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
+ */
+package edu.slcc.asdv.caleb.filestream;
+
+/**
+ *
+ * @author caleb
+ */
+import java.io.*;
+
+public class TestDataStream {
+ public static void main(String[] args) throws IOException {
+ try ( // Create an output stream for file temp.dat
+ DataOutputStream output =
+ new DataOutputStream(new FileOutputStream("temp.dat"));
+ ) {
+ // Write student test scores to the file
+ output.writeUTF("John");
+ output.writeDouble(85.5);
+ output.writeUTF("Jim");
+ output.writeDouble(185.5);
+ output.writeUTF("George");
+ output.writeDouble(105.25);
+ }
+
+ try ( // Create an input stream for file temp.dat
+ DataInputStream input =
+ new DataInputStream(new FileInputStream("temp.dat"));
+ ) {
+ // Read student test scores from the file
+ System.out.println(input.readUTF() + " " + input.readDouble());
+ System.out.println(input.readUTF() + " " + input.readDouble());
+ System.out.println(input.readUTF() + " " + input.readDouble());
+ }
+ }
+}
\ No newline at end of file
diff --git a/Semester 3/Assignments/FileStream/src/main/java/edu/slcc/asdv/caleb/filestream/TestObjectStreamForArray.java b/Semester 3/Assignments/FileStream/src/main/java/edu/slcc/asdv/caleb/filestream/TestObjectStreamForArray.java
new file mode 100644
index 0000000..6800785
--- /dev/null
+++ b/Semester 3/Assignments/FileStream/src/main/java/edu/slcc/asdv/caleb/filestream/TestObjectStreamForArray.java
@@ -0,0 +1,55 @@
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
+ */
+package edu.slcc.asdv.caleb.filestream;
+
+/**
+ *
+ * @author caleb
+ */
+import java.io.*;
+
+public class TestObjectStreamForArray {
+
+ public static void main(String[] args)
+ throws ClassNotFoundException, IOException
+ {
+ int[] numbers = {1, 2, 3, 4, 5};
+
+ Test[] arTest = new Test[2];
+ arTest[0] = new Test(10);
+ arTest[0] = new Test(20);
+
+ String[] strings = {"John", "Susan", "Kim"};
+
+ try ( // Create an output stream for file array.dat
+ ObjectOutputStream output = new ObjectOutputStream(new FileOutputStream("array.dat", true));) {
+ // Write arrays to the object output stream
+ output.writeObject(numbers);
+ output.writeObject(strings);
+ output.writeObject(arTest);
+ }
+
+ try ( // Create an input stream for file array.dat
+ ObjectInputStream input
+ = new ObjectInputStream(new FileInputStream("array.dat"));) {
+ int[] newNumbers = (int[]) (input.readObject());
+ String[] newStrings = (String[]) (input.readObject());
+
+ // Display arrays
+ for (int i = 0; i < newNumbers.length; i++) {
+ System.out.print(newNumbers[i] + " ");
+ }
+ System.out.println();
+
+ for (int i = 0; i < newStrings.length; i++) {
+ System.out.print(newStrings[i] + " ");
+ }
+ System.out.println();
+ for (int i = 0; i < arTest.length; i++) {
+ System.out.print(arTest[i] + " ");
+ }
+ }
+ }
+}
diff --git a/Semester 3/Assignments/FileStream/src/main/java/edu/slcc/asdv/caleb/filestream/TestRandomAccessFile.java b/Semester 3/Assignments/FileStream/src/main/java/edu/slcc/asdv/caleb/filestream/TestRandomAccessFile.java
new file mode 100644
index 0000000..62bda97
--- /dev/null
+++ b/Semester 3/Assignments/FileStream/src/main/java/edu/slcc/asdv/caleb/filestream/TestRandomAccessFile.java
@@ -0,0 +1,75 @@
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
+ */
+package edu.slcc.asdv.caleb.filestream;
+
+/**
+ *
+ * @author caleb
+ */
+import java.io.*;
+
+public class TestRandomAccessFile {
+
+ public static void main(String[] args) throws IOException
+ {
+ try ( // Create a random access file
+ RandomAccessFile inout = new RandomAccessFile("inout.dat", "rw");) {
+ // Clear the file to destroy the old contents if exists
+ inout.setLength(0);
+
+ // Write new integers to the file
+ for (int i = 0; i < 200; i++) {
+ inout.writeInt(i);
+ }
+
+ // Display the current length of the file
+ System.out.println("Current file length is " + inout.length());
+
+ // Retrieve the first number
+ inout.seek(0); // Move the file pointer to the beginning
+ System.out.println("The first number is " + inout.readInt());
+
+ // Retrieve the second number
+ inout.seek(1 * 4); // Move the file pointer to the second number
+ System.out.println("The second number is " + inout.readInt());
+
+ // Retrieve the tenth number
+ inout.seek(9 * 4); // Move the file pointer to the tenth number
+ System.out.println("The tenth number is " + inout.readInt());
+
+ // Modify the eleventh number
+ inout.writeInt(555);
+
+ // Append a new number
+ inout.seek(inout.length()); // Move the file pointer to the end
+ inout.writeInt(999);
+
+ // Display the new length
+ System.out.println("The new length is " + inout.length());
+
+ // Retrieve the new eleventh number
+ inout.seek(10 * 4); // Move the file pointer to the eleventh number
+ System.out.println("The eleventh number is " + inout.readInt());
+ inout.seek(0); // Move the pointer to the beginning of the file
+ int intOut;
+ int counter = 0;
+ while (true) {
+ try {
+ counter++;
+ intOut = inout.readInt();
+ System.out.print(intOut + " ");
+ if ((counter + 1) % 5 == 0) {
+ System.out.println();
+ }
+ } catch (EOFException ex) {
+ System.out.println();
+ System.out.println("We reached the end of the file!");
+ break;
+ }
+ }
+ }
+
+ }
+}
diff --git a/Semester 3/Assignments/FileStream/temp.dat b/Semester 3/Assignments/FileStream/temp.dat
new file mode 100644
index 0000000..8de8f43
--- /dev/null
+++ b/Semester 3/Assignments/FileStream/temp.dat
@@ -0,0 +1 @@
+
diff --git a/Semester 3/Assignments/FileStream/test.dat b/Semester 3/Assignments/FileStream/test.dat
new file mode 100644
index 0000000..3a27dcf
--- /dev/null
+++ b/Semester 3/Assignments/FileStream/test.dat
@@ -0,0 +1 @@
+This is another abritrary string of characters˙
\ No newline at end of file
diff --git a/Semester 3/Assignments/JavaFXBallsWithComparator/labChapter20.pdf b/Semester 3/Assignments/JavaFXBallsWithComparator/labChapter20.pdf
new file mode 100644
index 0000000..57f370f
Binary files /dev/null and b/Semester 3/Assignments/JavaFXBallsWithComparator/labChapter20.pdf differ
diff --git a/Semester 3/Assignments/JavaFXBallsWithComparator/nb-configuration.xml b/Semester 3/Assignments/JavaFXBallsWithComparator/nb-configuration.xml
new file mode 100644
index 0000000..ab59f8c
--- /dev/null
+++ b/Semester 3/Assignments/JavaFXBallsWithComparator/nb-configuration.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+ [{"repository":"php","rule":"S3335"},{"repository":"php","rule":"S3336"},{"repository":"php","rule":"S2002"},{"repository":"php","rule":"S2005"},{"repository":"php","rule":"S3333"},{"repository":"php","rule":"S3334"},{"repository":"Web","rule":"ImgWithoutWidthOrHeightCheck"},{"repository":"php","rule":"S1151"},{"repository":"php","rule":"S3332"},{"repository":"php","rule":"S2001"},{"repository":"php","rule":"S2000"},{"repository":"typescript","rule":"S4798"},{"repository":"javascript","rule":"S3801"},{"repository":"typescript","rule":"S2138"},{"repository":"typescript","rule":"S2376"},{"repository":"java","rule":"S4288"},{"repository":"php","rule":"S5867"},{"repository":"java","rule":"S6211"},{"repository":"java","rule":"S2096"},{"repository":"java","rule":"S6212"},{"repository":"php","rule":"S2011"},{"repository":"typescript","rule":"S4328"},{"repository":"typescript","rule":"S4204"},{"repository":"typescript","rule":"S4324"},{"repository":"Web","rule":"PageWithoutFaviconCheck"},{"repository":"typescript","rule":"S4327"},{"repository":"typescript","rule":"S4326"},{"repository":"typescript","rule":"S3353"},{"repository":"typescript","rule":"S1172"},{"repository":"typescript","rule":"S2260"},{"repository":"java","rule":"S5128"},{"repository":"php","rule":"S2007"},{"repository":"php","rule":"S3337"},{"repository":"php","rule":"S3338"},{"repository":"javascript","rule":"S139"},{"repository":"javascript","rule":"S135"},{"repository":"javascript","rule":"S138"},{"repository":"javascript","rule":"S131"},{"repository":"javascript","rule":"S134"},{"repository":"javascript","rule":"S2817"},{"repository":"typescript","rule":"S3003"},{"repository":"typescript","rule":"S1067"},{"repository":"typescript","rule":"S1066"},{"repository":"Web","rule":"S1829"},{"repository":"java","rule":"S4174"},{"repository":"Web","rule":"IllegalTabCheck"},{"repository":"typescript","rule":"S3499"},{"repository":"typescript","rule":"S3257"},{"repository":"typescript","rule":"S1192"},{"repository":"typescript","rule":"S3498"},{"repository":"php","rule":"S5856"},{"repository":"java","rule":"S2063"},{"repository":"java","rule":"S3030"},{"repository":"java","rule":"S3032"},{"repository":"Web","rule":"DoubleQuotesCheck"},{"repository":"Web","rule":"MaxLineLengthCheck"},{"repository":"java","rule":"S105"},{"repository":"typescript","rule":"S1488"},{"repository":"Web","rule":"LongJavaScriptCheck"},{"repository":"java","rule":"S103"},{"repository":"Web","rule":"WmodeIsWindowCheck"},{"repository":"java","rule":"S104"},{"repository":"java","rule":"S109"},{"repository":"typescript","rule":"S3786"},{"repository":"javascript","rule":"S1821"},{"repository":"java","rule":"S113"},{"repository":"java","rule":"S4248"},{"repository":"php","rule":"S1105"},{"repository":"php","rule":"S1106"},{"repository":"php","rule":"S1121"},{"repository":"typescript","rule":"S3317"},{"repository":"typescript","rule":"S1131"},{"repository":"java","rule":"S2059"},{"repository":"java","rule":"S2057"},{"repository":"java","rule":"S6411"},{"repository":"php","rule":"S1117"},{"repository":"java","rule":"S3052"},{"repository":"typescript","rule":"S881"},{"repository":"php","rule":"S1451"},{"repository":"Web","rule":"NonConsecutiveHeadingCheck"},{"repository":"java","rule":"S126"},{"repository":"typescript","rule":"S5867"},{"repository":"java","rule":"S134"},{"repository":"java","rule":"S4266"},{"repository":"java","rule":"S2196"},{"repository":"java","rule":"S2197"},{"repository":"java","rule":"S118"},{"repository":"typescript","rule":"S1154"},{"repository":"java","rule":"S121"},{"repository":"java","rule":"S122"},{"repository":"php","rule":"S1578"},{"repository":"php","rule":"S5935"},{"repository":"java","rule":"S3047"},{"repository":"php","rule":"S4142"},{"repository":"typescript","rule":"S1441"},{"repository":"java","rule":"S2701"},{"repository":"typescript","rule":"S1440"},{"repository":"php","rule":"S881"},{"repository":"java","rule":"S138"},{"repository":"typescript","rule":"S3514"},{"repository":"java","rule":"S139"},{"repository":"typescript","rule":"S2427"},{"repository":"typescript","rule":"S3512"},{"repository":"typescript","rule":"S2424"},{"repository":"typescript","rule":"S3513"},{"repository":"typescript","rule":"S1451"},{"repository":"Web","rule":"IllegalNamespaceCheck"},{"repository":"xml","rule":"S3419"},{"repository":"typescript","rule":"S3525"},{"repository":"Web","rule":"WhiteSpaceAroundCheck"},{"repository":"typescript","rule":"S3402"},{"repository":"typescript","rule":"S1105"},{"repository":"typescript","rule":"S3524"},{"repository":"java","rule":"S3937"},{"repository":"xml","rule":"S1120"},{"repository":"java","rule":"S1996"},{"repository":"xml","rule":"S3420"},{"repository":"xml","rule":"S3423"},{"repository":"Web","rule":"InternationalizationCheck"},{"repository":"java","rule":"S6073"},{"repository":"css","rule":"S4664"},{"repository":"typescript","rule":"S2208"},{"repository":"typescript","rule":"S4622"},{"repository":"typescript","rule":"S3533"},{"repository":"php","rule":"S2070"},{"repository":"typescript","rule":"S1117"},{"repository":"typescript","rule":"S1116"},{"repository":"java","rule":"S2959"},{"repository":"typescript","rule":"S1110"},{"repository":"Web","rule":"S1436"},{"repository":"xml","rule":"S2321"},{"repository":"php","rule":"S2047"},{"repository":"php","rule":"S2046"},{"repository":"typescript","rule":"S1528"},{"repository":"php","rule":"S2043"},{"repository":"javascript","rule":"S117"},{"repository":"php","rule":"S2042"},{"repository":"php","rule":"S2044"},{"repository":"javascript","rule":"S113"},{"repository":"Web","rule":"MouseEventWithoutKeyboardEquivalentCheck"},{"repository":"javascript","rule":"S4139"},{"repository":"typescript","rule":"S1526"},{"repository":"typescript","rule":"S1525"},{"repository":"php","rule":"NoSonar"},{"repository":"typescript","rule":"S1539"},{"repository":"Web","rule":"IllegalTagLibsCheck"},{"repository":"php","rule":"S2050"},{"repository":"typescript","rule":"S1774"},{"repository":"javascript","rule":"S126"},{"repository":"typescript","rule":"S1530"},{"repository":"javascript","rule":"S121"},{"repository":"typescript","rule":"S1537"},{"repository":"typescript","rule":"S1535"},{"repository":"javascript","rule":"S122"},{"repository":"typescript","rule":"S909"},{"repository":"php","rule":"S5899"},{"repository":"java","rule":"S5194"},{"repository":"typescript","rule":"S3723"},{"repository":"php","rule":"S2260"},{"repository":"typescript","rule":"S1541"},{"repository":"java","rule":"S1711"},{"repository":"javascript","rule":"S1192"},{"repository":"php","rule":"S2278"},{"repository":"php","rule":"S2036"},{"repository":"php","rule":"S2277"},{"repository":"php","rule":"S1067"},{"repository":"php","rule":"S2038"},{"repository":"php","rule":"S2037"},{"repository":"javascript","rule":"S106"},{"repository":"javascript","rule":"S109"},{"repository":"php","rule":"S5783"},{"repository":"javascript","rule":"S3498"},{"repository":"javascript","rule":"S103"},{"repository":"javascript","rule":"S3499"},{"repository":"javascript","rule":"S105"},{"repository":"javascript","rule":"S104"},{"repository":"typescript","rule":"S1438"},{"repository":"java","rule":"S1939"},{"repository":"typescript","rule":"S3973"},{"repository":"javascript","rule":"S100"},{"repository":"java","rule":"S1821"},{"repository":"java","rule":"S1942"},{"repository":"java","rule":"S1943"},{"repository":"java","rule":"S1820"},{"repository":"java","rule":"S1941"},{"repository":"Web","rule":"HeaderCheck"},{"repository":"Web","rule":"UnclosedTagCheck"},{"repository":"typescript","rule":"S2817"},{"repository":"javascript","rule":"S3003"},{"repository":"typescript","rule":"S2933"},{"repository":"java","rule":"S2309"},{"repository":"php","rule":"S126"},{"repository":"css","rule":"S5362"},{"repository":"java","rule":"S4605"},{"repository":"java","rule":"S4604"},{"repository":"java","rule":"S2308"},{"repository":"xml","rule":"S3282"},{"repository":"php","rule":"S2918"},{"repository":"java","rule":"S2301"},{"repository":"java","rule":"S1696"},{"repository":"java","rule":"S1213"},{"repository":"typescript","rule":"S139"},{"repository":"java","rule":"S1698"},{"repository":"java","rule":"S1699"},{"repository":"php","rule":"S1820"},{"repository":"java","rule":"S3750"},{"repository":"javascript","rule":"S1172"},{"repository":"java","rule":"S1451"},{"repository":"php","rule":"S122"},{"repository":"java","rule":"S1694"},{"repository":"java","rule":"S1695"},{"repository":"php","rule":"S1821"},{"repository":"javascript","rule":"S2260"},{"repository":"javascript","rule":"S3353"},{"repository":"javascript","rule":"S4326"},{"repository":"Web","rule":"UnifiedExpressionCheck"},{"repository":"php","rule":"S134"},{"repository":"java","rule":"S1448"},{"repository":"java","rule":"S2658"},{"repository":"java","rule":"S1449"},{"repository":"java","rule":"S3749"},{"repository":"php","rule":"S139"},{"repository":"javascript","rule":"S1067"},{"repository":"javascript","rule":"S1066"},{"repository":"java","rule":"S1200"},{"repository":"Web","rule":"ComplexityCheck"},{"repository":"javascript","rule":"S2376"},{"repository":"typescript","rule":"S3801"},{"repository":"Web","rule":"RequiredAttributeCheck"},{"repository":"javascript","rule":"S2138"},{"repository":"php","rule":"S104"},{"repository":"java","rule":"S3658"},{"repository":"java","rule":"S2208"},{"repository":"java","rule":"S2444"},{"repository":"javascript","rule":"S1154"},{"repository":"java","rule":"S2203"},{"repository":"java","rule":"S2325"},{"repository":"java","rule":"S3414"},{"repository":"typescript","rule":"S2966"},{"repository":"java","rule":"S1106"},{"repository":"java","rule":"S1228"},{"repository":"java","rule":"S1107"},{"repository":"java","rule":"S1108"},{"repository":"java","rule":"S1109"},{"repository":"xml","rule":"S3373"},{"repository":"java","rule":"S1105"},{"repository":"javascript","rule":"S5867"},{"repository":"java","rule":"S4926"},{"repository":"java","rule":"S1774"},{"repository":"javascript","rule":"S1131"},{"repository":"javascript","rule":"S3798"},{"repository":"javascript","rule":"S3317"},{"repository":"Web","rule":"InputWithoutLabelCheck"},{"repository":"javascript","rule":"S881"},{"repository":"xml","rule":"S2260"},{"repository":"java","rule":"S1641"},{"repository":"java","rule":"S2972"},{"repository":"java","rule":"S2973"},{"repository":"java","rule":"S2974"},{"repository":"javascript","rule":"S3786"},{"repository":"javascript","rule":"S1488"},{"repository":"java","rule":"S923"},{"repository":"typescript","rule":"S1821"},{"repository":"javascript","rule":"S1117"},{"repository":"javascript","rule":"S1116"},{"repository":"java","rule":"S1315"},{"repository":"javascript","rule":"S1110"},{"repository":"java","rule":"S1312"},{"repository":"java","rule":"S1314"},{"repository":"java","rule":"S1310"},{"repository":"javascript","rule":"S3533"},{"repository":"javascript","rule":"S2208"},{"repository":"java","rule":"S1309"},{"repository":"java","rule":"S3725"},{"repository":"Web","rule":"DynamicJspIncludeCheck"},{"repository":"Web","rule":"InlineStyleCheck"},{"repository":"java","rule":"S1541"},{"repository":"java","rule":"S2260"},{"repository":"java","rule":"S2141"},{"repository":"php","rule":"S1311"},{"repository":"java","rule":"S2384"},{"repository":"javascript","rule":"S3760"},{"repository":"javascript","rule":"S3523"},{"repository":"javascript","rule":"S3402"},{"repository":"javascript","rule":"S3524"},{"repository":"javascript","rule":"S3525"},{"repository":"xml","rule":"S105"},{"repository":"typescript","rule":"S4157"},{"repository":"xml","rule":"S103"},{"repository":"java","rule":"S2148"},{"repository":"java","rule":"S2143"},{"repository":"java","rule":"S1176"},{"repository":"java","rule":"S1160"},{"repository":"php","rule":"S1200"},{"repository":"java","rule":"S2250"},{"repository":"java","rule":"S818"},{"repository":"java","rule":"S1162"},{"repository":"java","rule":"S4551"},{"repository":"java","rule":"S2131"},{"repository":"javascript","rule":"S1451"},{"repository":"javascript","rule":"S3512"},{"repository":"javascript","rule":"S2424"},{"repository":"javascript","rule":"S3513"},{"repository":"javascript","rule":"S3514"},{"repository":"javascript","rule":"S3757"},{"repository":"javascript","rule":"S3758"},{"repository":"javascript","rule":"S2427"},{"repository":"javascript","rule":"S2428"},{"repository":"javascript","rule":"S1105"},{"repository":"php","rule":"S5915"},{"repository":"php","rule":"S1314"},{"repository":"java","rule":"S1166"},{"repository":"php","rule":"S1799"},{"repository":"java","rule":"S5793"},{"repository":"java","rule":"S1194"},{"repository":"java","rule":"S2162"},{"repository":"java","rule":"S2164"},{"repository":"javascript","rule":"S1440"},{"repository":"javascript","rule":"S1441"},{"repository":"javascript","rule":"S1442"},{"repository":"Web","rule":"MultiplePageDirectivesCheck"},{"repository":"java","rule":"S3254"},{"repository":"java","rule":"S2047"},{"repository":"php","rule":"S1541"},{"repository":"java","rule":"S3242"},{"repository":"javascript","rule":"S3973"},{"repository":"javascript","rule":"S1438"},{"repository":"Web","rule":"LinkToNothingCheck"},{"repository":"java","rule":"S2039"},{"repository":"java","rule":"S1188"},{"repository":"java","rule":"S1067"},{"repository":"java","rule":"S2156"},{"repository":"java","rule":"S3366"},{"repository":"Web","rule":"LinksIdenticalTextsDifferentTargetsCheck"},{"repository":"java","rule":"S5970"},{"repository":"typescript","rule":"S100"},{"repository":"typescript","rule":"S103"},{"repository":"php","rule":"S1990"},{"repository":"typescript","rule":"S105"},{"repository":"typescript","rule":"S104"},{"repository":"javascript","rule":"S1541"},{"repository":"java","rule":"S864"},{"repository":"javascript","rule":"S3723"},{"repository":"java","rule":"S5979"},{"repository":"java","rule":"NoSonar"},{"repository":"java","rule":"S5977"},{"repository":"java","rule":"S5612"},{"repository":"java","rule":"S1258"},{"repository":"java","rule":"S3437"},{"repository":"Web","rule":"FileLengthCheck"},{"repository":"Web","rule":"JspScriptletCheck"},{"repository":"java","rule":"S2221"},{"repository":"java","rule":"S1132"},{"repository":"javascript","rule":"S909"},{"repository":"java","rule":"S3553"},{"repository":"typescript","rule":"S113"},{"repository":"javascript","rule":"S1530"},{"repository":"javascript","rule":"S1774"},{"repository":"javascript","rule":"S1535"},{"repository":"javascript","rule":"S1537"},{"repository":"javascript","rule":"S1539"},{"repository":"java","rule":"S3306"},{"repository":"typescript","rule":"S106"},{"repository":"java","rule":"S2698"},{"repository":"typescript","rule":"S109"},{"repository":"php","rule":"S1996"},{"repository":"php","rule":"S2964"},{"repository":"java","rule":"S2693"},{"repository":"java","rule":"S1120"},{"repository":"java","rule":"S2694"},{"repository":"java","rule":"S2211"},{"repository":"php","rule":"S1997"},{"repository":"java","rule":"S2333"},{"repository":"java","rule":"S1244"},{"repository":"typescript","rule":"S121"},{"repository":"java","rule":"S1151"},{"repository":"typescript","rule":"S122"},{"repository":"Web","rule":"IllegalElementCheck"},{"repository":"typescript","rule":"S126"},{"repository":"typescript","rule":"S4137"},{"repository":"java","rule":"S888"},{"repository":"javascript","rule":"S1525"},{"repository":"javascript","rule":"S1526"},{"repository":"typescript","rule":"S4139"},{"repository":"javascript","rule":"S1528"},{"repository":"javascript","rule":"S3827"},{"repository":"typescript","rule":"S4136"},{"repository":"java","rule":"S3578"},{"repository":"typescript","rule":"S117"},{"repository":"typescript","rule":"S131"},{"repository":"php","rule":"S2830"},{"repository":"typescript","rule":"S134"},{"repository":"typescript","rule":"S135"},{"repository":"typescript","rule":"S138"},{"repository":"typescript","rule":"S4023"},{"repository":"java","rule":"S881"},{"repository":"java","rule":"S5867"},{"repository":"java","rule":"S1147"},{"repository":"java","rule":"S1142"},{"repository":"php","rule":"S2701"}]
+ JDK_FX_17
+ {}
+ true
+
+
diff --git a/Semester 3/Assignments/JavaFXBallsWithComparator/nbactions.xml b/Semester 3/Assignments/JavaFXBallsWithComparator/nbactions.xml
new file mode 100644
index 0000000..a0cb38e
--- /dev/null
+++ b/Semester 3/Assignments/JavaFXBallsWithComparator/nbactions.xml
@@ -0,0 +1,40 @@
+
+
+
+ run
+
+ jar
+
+
+ clean
+ javafx:run
+
+
+
+ debug
+
+ clean
+ javafx:run@ide-debug
+
+
+ true
+
+
+
+ profile
+
+ clean
+ javafx:run@ide-profile
+
+
+
+ CUSTOM-jlink
+ jlink
+
+ clean
+
+ compile
+ javafx:jlink
+
+
+
diff --git a/Semester 3/Assignments/JavaFXBallsWithComparator/pom.xml b/Semester 3/Assignments/JavaFXBallsWithComparator/pom.xml
new file mode 100644
index 0000000..9308376
--- /dev/null
+++ b/Semester 3/Assignments/JavaFXBallsWithComparator/pom.xml
@@ -0,0 +1,76 @@
+
+ 4.0.0
+ edu.slcc.asdv.caleb
+ JavaFXBallsWithComparator
+ 1.0-SNAPSHOT
+
+ UTF-8
+
+
+
+ org.openjfx
+ javafx-controls
+ 20
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.8.0
+
+ 17
+
+
+
+ org.openjfx
+ javafx-maven-plugin
+ 0.0.4
+
+ edu.slcc.asdv.caleb.javafxballswithcomparator.App
+
+
+
+
+
+ default-cli
+
+
+
+
+ debug
+
+
+
+
+
+
+
+
+ ide-debug
+
+
+
+
+
+
+
+
+ ide-profile
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Semester 3/Assignments/JavaFXBallsWithComparator/src/main/java/edu/slcc/asdv/caleb/javafxballswithcomparator/A1.java b/Semester 3/Assignments/JavaFXBallsWithComparator/src/main/java/edu/slcc/asdv/caleb/javafxballswithcomparator/A1.java
new file mode 100644
index 0000000..579efe0
--- /dev/null
+++ b/Semester 3/Assignments/JavaFXBallsWithComparator/src/main/java/edu/slcc/asdv/caleb/javafxballswithcomparator/A1.java
@@ -0,0 +1,42 @@
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
+ */
+package edu.slcc.asdv.caleb.javafxballswithcomparator;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ *
+ * @author caleb
+ */
+public class A1 implements Comparable {
+ int x;
+ public A1() {}
+ public A1(int x) {this.x = x;}
+ @Override
+ public int compareTo(A1 o)
+ {
+ return this.x - o.x;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "A1{" + "x=" + x + '}';
+ }
+ public static void main(String[] args)
+ {
+ System.out.println("Sorting in ascending order");
+ List list1 = Arrays.asList(new A1(3), new A1(), new A1(2));
+
+ Collections.sort(list1);
+ System.out.println(list1);
+
+ System.out.println("Sorting in descending order");
+ Collections.sort(list1, Collections.reverseOrder());
+ System.out.println(list1);
+ }
+}
diff --git a/Semester 3/Assignments/JavaFXBallsWithComparator/src/main/java/edu/slcc/asdv/caleb/javafxballswithcomparator/A2.java b/Semester 3/Assignments/JavaFXBallsWithComparator/src/main/java/edu/slcc/asdv/caleb/javafxballswithcomparator/A2.java
new file mode 100644
index 0000000..b896474
--- /dev/null
+++ b/Semester 3/Assignments/JavaFXBallsWithComparator/src/main/java/edu/slcc/asdv/caleb/javafxballswithcomparator/A2.java
@@ -0,0 +1,41 @@
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
+ */
+package edu.slcc.asdv.caleb.javafxballswithcomparator;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+
+/**
+ *
+ * @author caleb
+ */
+public class A2 {
+ int x;
+ public A2() {}
+ public A2(int x) {this.x = x;}
+
+ @Override
+ public String toString()
+ {
+ return "A2{" + "x=" + x + '}';
+ }
+ public static void main(String[] args)
+ {
+ System.out.println("Sorting in ascending order");
+ List list1 = Arrays.asList(new A2(4), new A2(), new A2(2));
+ Comparator c = new Comparator() {
+ @Override
+ public int compare(A2 o1, A2 o2)
+ {
+ return o1.x - o2.x;
+ }
+ };
+ Collections.sort(list1, c);
+ System.out.println(list1);
+ }
+
+}
diff --git a/Semester 3/Assignments/JavaFXBallsWithComparator/src/main/java/edu/slcc/asdv/caleb/javafxballswithcomparator/App.java b/Semester 3/Assignments/JavaFXBallsWithComparator/src/main/java/edu/slcc/asdv/caleb/javafxballswithcomparator/App.java
new file mode 100644
index 0000000..5466125
--- /dev/null
+++ b/Semester 3/Assignments/JavaFXBallsWithComparator/src/main/java/edu/slcc/asdv/caleb/javafxballswithcomparator/App.java
@@ -0,0 +1,30 @@
+package edu.slcc.asdv.caleb.javafxballswithcomparator;
+
+import javafx.application.Application;
+import javafx.scene.Scene;
+import javafx.scene.control.Label;
+import javafx.scene.layout.StackPane;
+import javafx.stage.Stage;
+
+
+/**
+ * JavaFX App
+ */
+public class App extends Application {
+
+ @Override
+ public void start(Stage stage) {
+ var javaVersion = SystemInfo.javaVersion();
+ var javafxVersion = SystemInfo.javafxVersion();
+
+ var label = new Label("Hello, JavaFX " + javafxVersion + ", running on Java " + javaVersion + ".");
+ var scene = new Scene(new StackPane(label), 640, 480);
+ stage.setScene(scene);
+ stage.show();
+ }
+
+ public static void main(String[] args) {
+ launch();
+ }
+
+}
\ No newline at end of file
diff --git a/Semester 3/Assignments/JavaFXBallsWithComparator/src/main/java/edu/slcc/asdv/caleb/javafxballswithcomparator/Circle.java b/Semester 3/Assignments/JavaFXBallsWithComparator/src/main/java/edu/slcc/asdv/caleb/javafxballswithcomparator/Circle.java
new file mode 100644
index 0000000..e00dccc
--- /dev/null
+++ b/Semester 3/Assignments/JavaFXBallsWithComparator/src/main/java/edu/slcc/asdv/caleb/javafxballswithcomparator/Circle.java
@@ -0,0 +1,51 @@
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
+ */
+package edu.slcc.asdv.caleb.javafxballswithcomparator;
+
+/**
+ *
+ * @author caleb
+ */
+public class Circle extends GeometricObject {
+ private double radius;
+
+ public Circle() {
+ }
+
+ public Circle(double radius) {
+ this.radius = radius;
+ }
+
+ /** Return radius */
+ public double getRadius() {
+ return radius;
+ }
+
+ /** Set a new radius */
+ public void setRadius(double radius) {
+ this.radius = radius;
+ }
+
+ @Override /** Return area */
+ public double getArea() {
+ return radius * radius * Math.PI;
+ }
+
+ /** Return diameter */
+ public double getDiameter() {
+ return 2 * radius;
+ }
+
+ @Override /** Return perimeter */
+ public double getPerimeter() {
+ return 2 * radius * Math.PI;
+ }
+
+ /* Print the circle info */
+ public void printCircle() {
+ System.out.println("The circle is created " + getDateCreated() +
+ " and the radius is " + radius);
+ }
+}
diff --git a/Semester 3/Assignments/JavaFXBallsWithComparator/src/main/java/edu/slcc/asdv/caleb/javafxballswithcomparator/GeometricObject.java b/Semester 3/Assignments/JavaFXBallsWithComparator/src/main/java/edu/slcc/asdv/caleb/javafxballswithcomparator/GeometricObject.java
new file mode 100644
index 0000000..8d06c56
--- /dev/null
+++ b/Semester 3/Assignments/JavaFXBallsWithComparator/src/main/java/edu/slcc/asdv/caleb/javafxballswithcomparator/GeometricObject.java
@@ -0,0 +1,66 @@
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
+ */
+package edu.slcc.asdv.caleb.javafxballswithcomparator;
+
+/**
+ *
+ * @author caleb
+ */
+public abstract class GeometricObject {
+ private String color = "white";
+ private boolean filled;
+ private java.util.Date dateCreated;
+
+ /** Construct a default geometric object */
+ protected GeometricObject() {
+ dateCreated = new java.util.Date();
+ }
+
+ /** Construct a geometric object with color and filled value */
+ protected GeometricObject(String color, boolean filled) {
+ dateCreated = new java.util.Date();
+ this.color = color;
+ this.filled = filled;
+ }
+
+ /** Return color */
+ public String getColor() {
+ return color;
+ }
+
+ /** Set a new color */
+ public void setColor(String color) {
+ this.color = color;
+ }
+
+ /** Return filled. Since filled is boolean,
+ * the get method is named isFilled */
+ public boolean isFilled() {
+ return filled;
+ }
+
+ /** Set a new filled */
+ public void setFilled(boolean filled) {
+ this.filled = filled;
+ }
+
+ /** Get dateCreated */
+ public java.util.Date getDateCreated() {
+ return dateCreated;
+ }
+
+ @Override
+ public String toString() {
+ return "created on " + dateCreated + "\ncolor: " + color +
+ " and filled: " + filled;
+ }
+
+ /** Abstract method getArea */
+ public abstract double getArea();
+
+ /** Abstract method getPerimeter */
+ public abstract double getPerimeter();
+}
+
diff --git a/Semester 3/Assignments/JavaFXBallsWithComparator/src/main/java/edu/slcc/asdv/caleb/javafxballswithcomparator/GeometricObjectComparator.java b/Semester 3/Assignments/JavaFXBallsWithComparator/src/main/java/edu/slcc/asdv/caleb/javafxballswithcomparator/GeometricObjectComparator.java
new file mode 100644
index 0000000..20e939e
--- /dev/null
+++ b/Semester 3/Assignments/JavaFXBallsWithComparator/src/main/java/edu/slcc/asdv/caleb/javafxballswithcomparator/GeometricObjectComparator.java
@@ -0,0 +1,19 @@
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
+ */
+package edu.slcc.asdv.caleb.javafxballswithcomparator;
+
+/**
+ *
+ * @author caleb
+ */
+import java.util.Comparator;
+
+public class GeometricObjectComparator
+ implements Comparator, java.io.Serializable {
+ public int compare(GeometricObject o1, GeometricObject o2) {
+ return o1.getArea() > o2.getArea() ?
+ 1 : o1.getArea() == o2.getArea() ? 0 : -1;
+ }
+}
diff --git a/Semester 3/Assignments/JavaFXBallsWithComparator/src/main/java/edu/slcc/asdv/caleb/javafxballswithcomparator/MultipleBallsWithComparator.java b/Semester 3/Assignments/JavaFXBallsWithComparator/src/main/java/edu/slcc/asdv/caleb/javafxballswithcomparator/MultipleBallsWithComparator.java
new file mode 100644
index 0000000..a585cd1
--- /dev/null
+++ b/Semester 3/Assignments/JavaFXBallsWithComparator/src/main/java/edu/slcc/asdv/caleb/javafxballswithcomparator/MultipleBallsWithComparator.java
@@ -0,0 +1,185 @@
+package edu.slcc.asdv.caleb.javafxballswithcomparator;
+
+import javafx.animation.KeyFrame;
+import javafx.animation.Timeline;
+import javafx.application.Application;
+import javafx.beans.property.DoubleProperty;
+import javafx.geometry.Pos;
+import javafx.scene.Node;
+import javafx.stage.Stage;
+import javafx.scene.Scene;
+import javafx.scene.control.Button;
+import javafx.scene.control.ScrollBar;
+import javafx.scene.layout.BorderPane;
+import javafx.scene.layout.HBox;
+import javafx.scene.layout.Pane;
+import javafx.scene.paint.Color;
+import javafx.scene.shape.Circle;
+import javafx.util.Duration;
+
+public class MultipleBallsWithComparator extends Application
+{
+
+ @Override // Override the start method in the Application class
+ public void start(Stage primaryStage)
+ {
+ MultipleBallPane ballPane = new MultipleBallPane();
+
+ Button btAdd = new Button("+");
+ Button btSubtract = new Button("-");
+ HBox hBox = new HBox(10);
+ hBox.getChildren().addAll(btAdd, btSubtract);
+ hBox.setAlignment(Pos.CENTER);
+
+ // Add or remove a ball
+ btAdd.setOnAction(e -> ballPane.add());
+ btSubtract.setOnAction(e -> ballPane.subtract());
+
+ // Pause and resume animation
+ ballPane.setOnMousePressed(e -> ballPane.pause());
+ ballPane.setOnMouseReleased(e -> ballPane.play());
+
+ // Use a scroll bar to control animation speed
+ ScrollBar sbSpeed = new ScrollBar();
+ sbSpeed.setMax(20);
+ sbSpeed.setValue(10);
+ ballPane.rateProperty().bind(sbSpeed.valueProperty());
+
+ BorderPane pane = new BorderPane();
+ pane.setCenter(ballPane);
+ pane.setTop(sbSpeed);
+ pane.setBottom(hBox);
+
+ // Create a scene and place the pane in the stage
+ Scene scene = new Scene(pane, 250, 150);
+ primaryStage.setTitle("Multiple Bouncing Balls"); // Set the stage title
+ primaryStage.setScene(scene); // Place the scene in the stage
+ primaryStage.show(); // Display the stage
+ }
+
+ private class MultipleBallPane extends Pane
+ {
+
+ private Timeline animation;
+
+ public MultipleBallPane()
+ {
+ // Create an animation for moving the ball
+ animation = new Timeline(
+ new KeyFrame(Duration.millis(50), e -> moveBall()));
+ animation.setCycleCount(Timeline.INDEFINITE);
+ animation.play(); // Start animation
+ }
+
+ public void add()
+ {
+ Color color = new Color(Math.random(),
+ Math.random(), Math.random(), 0.5);
+ getChildren().add(new Ball(30, 30, Math.random() * 16 + 5, color));
+ }
+
+ public void subtract()
+ {
+ if (getChildren().size() > 0)
+ {
+ //> Locate the ball with the largest radius
+ Ball ball = (Ball) (getChildren().get(0));
+ for (Node node : getChildren())
+ {
+ if (((Ball) node).getRadius() > ball.getRadius())
+ {
+ ball = (Ball) node;
+ }
+ }
+
+ getChildren().remove(ball);
+ }
+ }
+
+ public void play()
+ {
+ animation.play();
+ }
+
+ public void pause()
+ {
+ animation.pause();
+ }
+
+ public void increaseSpeed()
+ {
+ animation.setRate(animation.getRate() + 0.1);
+ }
+
+ public void decreaseSpeed()
+ {
+ animation.setRate(
+ animation.getRate() > 0 ? animation.getRate() - 0.1 : 0);
+ }
+
+ public DoubleProperty rateProperty()
+ {
+ return animation.rateProperty();
+ }
+
+ protected void moveBall()
+ {
+ for (Node node : this.getChildren())
+ {
+ Ball ball = (Ball) node;
+ // Check boundaries
+ if (ball.getCenterX() < ball.getRadius()
+ || ball.getCenterX() > getWidth() - ball.getRadius())
+ {
+ ball.dx *= -1; // Change ball move direction
+ }
+ if (ball.getCenterY() < ball.getRadius()
+ || ball.getCenterY() > getHeight() - ball.getRadius())
+ {
+ ball.dy *= -1; // Change ball move direction
+ }
+
+ // Adjust ball position
+ ball.setCenterX(ball.dx + ball.getCenterX());
+ ball.setCenterY(ball.dy + ball.getCenterY());
+ }
+ }
+ }
+
+ class Ball extends Circle implements Comparable
+ {
+
+ private double dx = 1, dy = 1;
+
+ Ball(double x, double y, double radius, Color color)
+ {
+ super(x, y, radius);
+ setFill(color); // Set ball color
+ }
+
+ public int compareTo(Ball b)
+ {
+ if (this.getRadius() - b.getRadius() < 0)
+ {
+ return -1;
+ }
+ else if (this.getRadius() - b.getRadius() == 0)
+ {
+ return 0;
+ }
+ else
+ {
+ return 1;
+ }
+ }
+ }
+
+ /**
+ * The main method is only needed for the IDE with limited JavaFX support.
+ * Not needed for running from the command line.
+ */
+ public static void main(String[] args)
+ {
+ launch(args);
+ }
+}
diff --git a/Semester 3/Assignments/JavaFXBallsWithComparator/src/main/java/edu/slcc/asdv/caleb/javafxballswithcomparator/Rectangle.java b/Semester 3/Assignments/JavaFXBallsWithComparator/src/main/java/edu/slcc/asdv/caleb/javafxballswithcomparator/Rectangle.java
new file mode 100644
index 0000000..ab279a9
--- /dev/null
+++ b/Semester 3/Assignments/JavaFXBallsWithComparator/src/main/java/edu/slcc/asdv/caleb/javafxballswithcomparator/Rectangle.java
@@ -0,0 +1,53 @@
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
+ */
+package edu.slcc.asdv.caleb.javafxballswithcomparator;
+
+/**
+ *
+ * @author caleb
+ */
+public class Rectangle extends GeometricObject {
+ private double width;
+ private double height;
+
+ public Rectangle() {
+ }
+
+ public Rectangle(double width, double height) {
+ this.width = width;
+ this.height = height;
+ }
+
+ /** Return width */
+ public double getWidth() {
+ return width;
+ }
+
+ /** Set a new width */
+ public void setWidth(double width) {
+ this.width = width;
+ }
+
+ /** Return height */
+ public double getHeight() {
+ return height;
+ }
+
+ /** Set a new height */
+ public void setHeight(double height) {
+ this.height = height;
+ }
+
+ @Override /** Return area */
+ public double getArea() {
+ return width * height;
+ }
+
+ @Override /** Return perimeter */
+ public double getPerimeter() {
+ return 2 * (width + height);
+ }
+}
+
diff --git a/Semester 3/Assignments/JavaFXBallsWithComparator/src/main/java/edu/slcc/asdv/caleb/javafxballswithcomparator/SystemInfo.java b/Semester 3/Assignments/JavaFXBallsWithComparator/src/main/java/edu/slcc/asdv/caleb/javafxballswithcomparator/SystemInfo.java
new file mode 100644
index 0000000..6cd94e8
--- /dev/null
+++ b/Semester 3/Assignments/JavaFXBallsWithComparator/src/main/java/edu/slcc/asdv/caleb/javafxballswithcomparator/SystemInfo.java
@@ -0,0 +1,13 @@
+package edu.slcc.asdv.caleb.javafxballswithcomparator;
+
+public class SystemInfo {
+
+ public static String javaVersion() {
+ return System.getProperty("java.version");
+ }
+
+ public static String javafxVersion() {
+ return System.getProperty("javafx.version");
+ }
+
+}
\ No newline at end of file
diff --git a/Semester 3/Assignments/JavaFXBallsWithComparator/src/main/java/edu/slcc/asdv/caleb/javafxballswithcomparator/TestArrayAndLinkedList.java b/Semester 3/Assignments/JavaFXBallsWithComparator/src/main/java/edu/slcc/asdv/caleb/javafxballswithcomparator/TestArrayAndLinkedList.java
new file mode 100644
index 0000000..39e33b6
--- /dev/null
+++ b/Semester 3/Assignments/JavaFXBallsWithComparator/src/main/java/edu/slcc/asdv/caleb/javafxballswithcomparator/TestArrayAndLinkedList.java
@@ -0,0 +1,45 @@
+package edu.slcc.asdv.caleb.javafxballswithcomparator;
+
+import java.util.ArrayList;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.ListIterator;
+
+public class TestArrayAndLinkedList
+{
+
+ public static void main(String[] args)
+ {
+ List arrayList = new ArrayList<>();
+ arrayList.add(1);
+ arrayList.add(2);
+ arrayList.add(3);
+ arrayList.add(1);
+ arrayList.add(4);
+ arrayList.add(0, 10);
+ arrayList.add(3, 30);
+
+ System.out.println("A list of integers in the array list:");
+ System.out.println(arrayList);
+
+ LinkedList