diff --git a/.gitignore b/.gitignore index 8fc55e4..a1b2ca6 100644 --- a/.gitignore +++ b/.gitignore @@ -123,5 +123,12 @@ /Semester 2/Assignments/JavaFX_CalebFontenot/target/ /Semester 2/Assignments/JavaFX_CalebFontenot/nbproject/private/ /Semester 2/Assignments/JavaFX_CalebFontenot/build/ +<<<<<<< Updated upstream /Semester 2/Exams/ProgrammingExam2_CalebFontenot/nbproject/private/ /Semester 2/Exams/ProgrammingExam2_CalebFontenot/build/ +======= +>>>>>>> Stashed changes +/Semester 2/Assignments/bruh/nbproject/private/ +/Semester 2/Exams/Exam2-Practice_CalebFontenot/target/ +/Semester 2/Exams/Exam2-Practice1_CalebFontenot/target/ +/Semester 2/Assignments/Exam2-Practice2_CalebFontenot/target/ diff --git a/Semester 2/Assignments/JavaFX_CalebFontenot/Printed HTMLs/BidirectionalBindingDemo.html b/Semester 2/Assignments/JavaFX_CalebFontenot/Printed HTMLs/BidirectionalBindingDemo.html new file mode 100644 index 0000000..73d9e00 --- /dev/null +++ b/Semester 2/Assignments/JavaFX_CalebFontenot/Printed HTMLs/BidirectionalBindingDemo.html @@ -0,0 +1,60 @@ + + + +BidirectionalBindingDemo.java + + + + +
/home/caleb/ASDV-Java/Semester 2/Assignments/JavaFX_CalebFontenot/src/javafx_calebfontenot/BidirectionalBindingDemo.java
+
+/*
+ * 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 javafx_calebfontenot;
+
+import javafx.beans.property.DoubleProperty;
+import javafx.beans.property.SimpleDoubleProperty;
+
+/**
+ *
+ * @author caleb
+ */
+public class BidirectionalBindingDemo {
+    public static void main(String[] args)
+    {
+        DoubleProperty d1 = new SimpleDoubleProperty(1);
+        DoubleProperty d2 = new SimpleDoubleProperty(2);
+        
+        System.out.println("d1 is " + d1.getValue()
+                                      + " and d2 is " + d2.getValue());
+         d1.bindBidirectional(d2);
+         System.out.println("d1 is " + d1.getValue()
+                                      + " and d2 is " + d2.getValue());
+         d1.setValue(50.1);
+         System.out.println("d1 is " + d1.getValue()
+                                      + " and d2 is " + d2.getValue());
+         d2.setValue(70.2);
+         System.out.println("d1 is " + d1.getValue()
+                                       + " and d2 is " + d2.getValue());
+         
+         
+         
+    }
+}
+
+
+ diff --git a/Semester 2/Assignments/JavaFX_CalebFontenot/Printed HTMLs/BindingDemo.html b/Semester 2/Assignments/JavaFX_CalebFontenot/Printed HTMLs/BindingDemo.html new file mode 100644 index 0000000..ea1c24f --- /dev/null +++ b/Semester 2/Assignments/JavaFX_CalebFontenot/Printed HTMLs/BindingDemo.html @@ -0,0 +1,57 @@ + + + +BindingDemo.java + + + + +
/home/caleb/ASDV-Java/Semester 2/Assignments/JavaFX_CalebFontenot/src/javafx_calebfontenot/BindingDemo.java
+
+/*
+ * 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 javafx_calebfontenot;
+
+import javafx.beans.property.DoubleProperty;
+import javafx.beans.property.SimpleDoubleProperty;
+
+/**
+ *
+ * @author caleb
+ */
+public class BindingDemo {
+    public static void main(String[] args)
+    {
+        DoubleProperty d1 = new SimpleDoubleProperty(1);
+        DoubleProperty d2 = new SimpleDoubleProperty(1);
+        
+        d1.bind(d2);
+        System.out.println("d1 is " + d1.getValue()
+                                      + " and d2 is " + d2.getValue());
+        d2.setValue(70.2);
+        System.out.println("d1 is " + d1.getValue()
+                                    + " and d2 is" + d2.getValue());
+        //d1.set(33); // remove comment to crash the program.
+        // When you bind, you cannot change. It is like getting married.
+    }
+}
+
+
+ diff --git a/Semester 2/Assignments/JavaFX_CalebFontenot/Printed HTMLs/Checkerboard.html b/Semester 2/Assignments/JavaFX_CalebFontenot/Printed HTMLs/Checkerboard.html new file mode 100644 index 0000000..d85a143 --- /dev/null +++ b/Semester 2/Assignments/JavaFX_CalebFontenot/Printed HTMLs/Checkerboard.html @@ -0,0 +1,87 @@ + + + +Checkerboard.java + + + + +
/home/caleb/ASDV-Java/Semester 2/Assignments/JavaFX_CalebFontenot/src/javafx_calebfontenot/Checkerboard.java
+
+/*
+ * 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 javafx_calebfontenot;
+
+import javafx.application.Application;
+import static javafx.application.Application.launch;
+import javafx.scene.Scene;
+import javafx.scene.layout.Pane;
+import javafx.scene.paint.Color;
+import javafx.scene.shape.Rectangle;
+import javafx.stage.Stage;
+
+/**
+ *
+ * @author caleb
+ */
+public class Checkerboard extends Application {
+
+    @Override
+    public void start(Stage primaryStage) throws Exception
+    {
+        Pane pane = new Pane();                                                      // Create a pane object
+        Scene scene = new Scene(pane, 800, 800);  // Create a scene object
+        primaryStage.setScene(scene);                                           // Set the stage scene to the scene object
+        primaryStage.show();                                                           // Make the window display on the screen
+        Rectangle[][] r = new Rectangle[8][8];
+        //Fill array with rectangle objects.
+        for (int i = 0; i < 8; ++i) {
+            for (int j = 0; j < 8; ++j) {
+                r[i][j] = new Rectangle();
+            }
+        }
+        int j = 0;
+        for (int i = 0; i < 8; ++i) {
+            for (j = 0; j < 8; ++j) {
+                r[i][j].setWidth(80);
+                r[i][j].setHeight(80);
+                if (j > 0) {
+                    r[i][j].setX(r[i][j - 1].getX() + 75);
+                }
+                if ((i + j) % 2 == 0) {
+                    r[i][j].setFill(Color.RED);
+                } else {
+                    r[i][j].setFill(Color.BLACK);
+                }
+                r[i][j].setY((i + 1) * 75);
+                pane.getChildren().add(r[i][j]);
+            }
+        }
+    }
+
+    public static void main(String[] args)
+    {
+        launch(args);
+    }
+}
+
+
+ diff --git a/Semester 2/Assignments/JavaFX_CalebFontenot/Printed HTMLs/JavaFX_CalebFontenot.html b/Semester 2/Assignments/JavaFX_CalebFontenot/Printed HTMLs/JavaFX_CalebFontenot.html index 22c07b1..9536f93 100644 --- a/Semester 2/Assignments/JavaFX_CalebFontenot/Printed HTMLs/JavaFX_CalebFontenot.html +++ b/Semester 2/Assignments/JavaFX_CalebFontenot/Printed HTMLs/JavaFX_CalebFontenot.html @@ -8,17 +8,12 @@ body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace} pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace} table {color: #888888; background-color: #313335; font-family: monospace} -.ST0 {color: #ffc66d} .string {color: #6a8759} .number {color: #6897bb} .whitespace {color: #505050} -.ST1 {color: #9876aa; font-family: monospace; font-style: italic} .comment {color: #808080} -.ST4 {color: #ffc66d; font-family: monospace; font-style: italic} -.ST2 {color: #808080; font-family: monospace; font-weight: bold} -.ST3 {color: #8a653b} +.ST0 {color: #808080; font-family: monospace; font-weight: bold} .literal {color: #cc7832} -.ST5 {font-family: monospace; font-style: italic} --> @@ -37,16 +32,16 @@ table {color: #888888; background-color: #313335; font-family: monospace} public class JavaFX_CalebFontenot extends Application { @Override - public void start(Stage primaryStage) + public void start(Stage primaryStage) { Button btn = new Button(); btn.setText("Say 'Hello World'"); btn.setOnAction(new EventHandler<ActionEvent>() { @Override - public void handle(ActionEvent event) + public void handle(ActionEvent event) { - System.out.println("Hello World!"); + System.out.println("Hello World!"); } }); @@ -54,7 +49,7 @@ table {color: #888888; background-color: #313335; font-family: monospace} StackPane root = new StackPane(); root.getChildren().add(btn); - Scene scene = new Scene(root, 300, 250); + Scene scene = new Scene(root, 300, 250); primaryStage.setTitle("Hello World!"); primaryStage.setScene(scene); @@ -62,11 +57,11 @@ table {color: #888888; background-color: #313335; font-family: monospace} } /** - * @param args the command line arguments + * @param args the command line arguments */ - public static void main(String[] args) + public static void main(String[] args) { - launch(args); + launch(args); } } diff --git a/Semester 2/Assignments/JavaFX_CalebFontenot/Printed HTMLs/ShowCircleCentered.html b/Semester 2/Assignments/JavaFX_CalebFontenot/Printed HTMLs/ShowCircleCentered.html index 62658c1..77b32b9 100644 --- a/Semester 2/Assignments/JavaFX_CalebFontenot/Printed HTMLs/ShowCircleCentered.html +++ b/Semester 2/Assignments/JavaFX_CalebFontenot/Printed HTMLs/ShowCircleCentered.html @@ -8,17 +8,12 @@ body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace} pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace} table {color: #888888; background-color: #313335; font-family: monospace} -.ST2 {color: #ffc66d} .number {color: #6897bb} .string {color: #6a8759} .comment {color: #808080} .whitespace {color: #505050} -.ST3 {color: #9876aa; font-family: monospace; font-style: italic} -.ST4 {color: #ffc66d; font-family: monospace; font-style: italic} -.ST1 {color: #808080; font-family: monospace; font-weight: bold} -.ST0 {color: #287bde} +.ST0 {color: #808080; font-family: monospace; font-weight: bold} .literal {color: #cc7832} -.ST5 {font-family: monospace; font-style: italic} --> @@ -26,8 +21,8 @@ table {color: #888888; background-color: #313335; font-family: monospace}
/home/caleb/ASDV-Java/Semester 2/Assignments/JavaFX_CalebFontenot/src/javafx_calebfontenot/ShowCircleCentered.java
 /*
- * 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
+ * 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 javafx_calebfontenot;
 
@@ -40,12 +35,12 @@ table {color: #888888; background-color: #313335; font-family: monospace}
 
 /**
  *
- * @author caleb
+ * @author caleb
  */
 public class ShowCircleCentered extends Application {
 
     @Override
-    public void start(Stage primaryStage)
+    public void start(Stage primaryStage)
     {
         // Create a pane to hold the Circle
         Pane pane = new Pane();
@@ -54,20 +49,20 @@ table {color: #888888; background-color: #313335; font-family: monospace}
         Circle circle = new Circle();
         circle.centerXProperty().bind(pane.widthProperty().divide(2));
         circle.centerYProperty().bind(pane.heightProperty().divide(2));
-        circle.setRadius(50);
-        circle.setStroke(Color.BLACK);
-        circle.setFill(Color.WHITE);
+        circle.setRadius(50);
+        circle.setStroke(Color.BLACK);
+        circle.setFill(Color.WHITE);
         pane.getChildren().add(circle); // Add the circle to the pane
         
         // Create a scene and place it in the stage
-        Scene scene = new Scene(pane, 200, 200);
+        Scene scene = new Scene(pane, 200, 200);
         primaryStage.setTitle("ShowCircleCentered"); // Set the stage title
         primaryStage.setScene(scene); // Place the scene in the stage
         primaryStage.show(); // Display the stage
     }
-    public static void main(String[] args)
+    public static void main(String[] args)
     {
-        launch(args);
+        launch(args);
     }
     
 }
diff --git a/Semester 2/Assignments/JavaFX_CalebFontenot/Printed HTMLs/ShowRectangle.html b/Semester 2/Assignments/JavaFX_CalebFontenot/Printed HTMLs/ShowRectangle.html
index 4c3df93..89d6e60 100644
--- a/Semester 2/Assignments/JavaFX_CalebFontenot/Printed HTMLs/ShowRectangle.html	
+++ b/Semester 2/Assignments/JavaFX_CalebFontenot/Printed HTMLs/ShowRectangle.html	
@@ -51,7 +51,7 @@ table {color: #888888; background-color: #313335; font-family: monospace}
         Scene scene = new Scene(pane, 300, 200);  // Create a scene object
         primaryStage.setScene(scene);                                           // Set the stage scene to the scene object
         primaryStage.show();                                                           // Make the window display on the screen
-        Rectangle r = new Rectangle(30, 30, 88, 44);
+        Rectangle r = new Rectangle(30, 30, 88, 44);  // Crate a rectangle object with these dimentions.
         r.setX(30);
         r.setY(30);
         r.setStroke(Color.BLUE);                                              // Set the rectangle outline to Blue
diff --git a/Semester 2/Assignments/JavaFX_CalebFontenot/lib/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar b/Semester 2/Assignments/JavaFX_CalebFontenot/lib/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar
new file mode 100644
index 0000000..2ef054a
Binary files /dev/null and b/Semester 2/Assignments/JavaFX_CalebFontenot/lib/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar differ
diff --git a/Semester 2/Assignments/JavaFX_CalebFontenot/lib/nblibraries.properties b/Semester 2/Assignments/JavaFX_CalebFontenot/lib/nblibraries.properties
new file mode 100644
index 0000000..b5bd56c
--- /dev/null
+++ b/Semester 2/Assignments/JavaFX_CalebFontenot/lib/nblibraries.properties	
@@ -0,0 +1,4 @@
+libs.CopyLibs.classpath=\
+    ${base}/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar
+libs.CopyLibs.displayName=CopyLibs Task
+libs.CopyLibs.prop-version=3.0
diff --git a/Semester 2/Assignments/JavaFX_CalebFontenot/nbproject/build-impl.xml b/Semester 2/Assignments/JavaFX_CalebFontenot/nbproject/build-impl.xml
index 2978b93..7479bd2 100644
--- a/Semester 2/Assignments/JavaFX_CalebFontenot/nbproject/build-impl.xml	
+++ b/Semester 2/Assignments/JavaFX_CalebFontenot/nbproject/build-impl.xml	
@@ -43,14 +43,39 @@ is divided into following sections:
         
         
     
-    
+    
+        
+        
+        
+            
+        
+        
+        
+    
+    
+        
+            
+                
+                
+            
+        
+    
+    
+        
+            
+                
+                
+            
+        
+    
+    
         
         
         
         
         
     
-    
+    
         
         
     
@@ -119,7 +144,7 @@ is divided into following sections:
         
         
     
-    
+    
         
         
         
@@ -310,7 +335,7 @@ is divided into following sections:
         
         
     
-    
+    
         Must set src.dir
         Must set test.src.dir
         Must set build.dir
@@ -1072,7 +1097,7 @@ is divided into following sections:
     
         
     
-    
+    
     
+
+    
+        TODO supply a title
+        
+        
+    
+    
+    
+        
TODO write content
+ + diff --git a/Semester 2/Exams/Exam2-Practice1_CalebFontenot/Printed HTMLs/Automobile.html b/Semester 2/Exams/Exam2-Practice1_CalebFontenot/Printed HTMLs/Automobile.html new file mode 100644 index 0000000..ea75dd7 --- /dev/null +++ b/Semester 2/Exams/Exam2-Practice1_CalebFontenot/Printed HTMLs/Automobile.html @@ -0,0 +1,104 @@ + + + +Automobile.java + + + + +
/home/caleb/ASDV-Java/Semester 2/Exams/Exam2-Practice_CalebFontenot/src/main/java/com/calebfontenot/exam2/practice_calebfontenot/Automobile.java
+
+/*
+ * 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 com.calebfontenot.exam2.practice_calebfontenot;
+
+import java.util.Objects;
+
+/**
+ *
+ * @author caleb
+ */
+public class Automobile implements Comparable<Automobile> {
+
+    private String vin;
+    private CountryOfOrigin origin;
+
+    public Automobile(String vin, CountryOfOrigin origin)
+    {
+        this.vin = vin;
+        this.origin = origin;
+    }
+
+    public CountryOfOrigin getOrigin()
+    {
+        return origin;
+    }
+
+    public void setOrigin(CountryOfOrigin origin)
+    {
+        this.origin = origin;
+    }
+
+
+    public String getVin()
+    {
+        return vin;
+    }
+
+    public void setVin(String vin)
+    {
+        this.vin = vin;
+    }
+
+    @Override
+    public String toString()
+    {
+        return "Automobile{" + "vin=" + vin + ", origin=" + origin + '}';
+    }
+
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (this == obj) {
+            return true;
+        }
+        if (obj == null) {
+            return false;
+        }
+        if (getClass() != obj.getClass()) {
+            return false;
+        }
+        final Automobile other = (Automobile) obj;
+        if (!Objects.equals(this.vin, other.vin)) {
+            return false;
+        }
+        return Objects.equals(this.origin, other.origin);
+    }
+    
+    @Override
+    public int compareTo(Automobile o)
+    {
+        return vin.compareTo(o.vin);
+    }
+    
+}
+
+
+ diff --git a/Semester 2/Exams/Exam2-Practice1_CalebFontenot/Printed HTMLs/CountryOfOrigin.html b/Semester 2/Exams/Exam2-Practice1_CalebFontenot/Printed HTMLs/CountryOfOrigin.html new file mode 100644 index 0000000..196025d --- /dev/null +++ b/Semester 2/Exams/Exam2-Practice1_CalebFontenot/Printed HTMLs/CountryOfOrigin.html @@ -0,0 +1,133 @@ + + + +CountryOfOrigin.java + + + + +
/home/caleb/ASDV-Java/Semester 2/Exams/Exam2-Practice_CalebFontenot/src/main/java/com/calebfontenot/exam2/practice_calebfontenot/CountryOfOrigin.java
+
+/*
+ * 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 com.calebfontenot.exam2.practice_calebfontenot;
+
+import java.util.Arrays;
+
+/**
+ *
+ * @author caleb
+ */
+public class CountryOfOrigin implements Cloneable, Comparable<CountryOfOrigin> {
+
+    private char[] country = "USA".toCharArray();
+
+    public CountryOfOrigin() {}
+    
+    public CountryOfOrigin(char[] country)
+    {
+        this.country = country;
+    }
+
+    public String getCountry()
+    {
+        return String.copyValueOf(this.country);
+    }
+
+    public void setCountry(char[] country)
+    {
+        this.country = country;
+    }
+
+    public boolean changeOneLetter(int index, char newLetter)
+    {
+        if (index >= this.country.length || index < 0) {
+            return false;
+        }
+        this.country[index] = newLetter;
+        return true;
+    }
+
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (this == obj) {
+            return true;
+        }
+        if (obj == null) {
+            return false;
+        }
+        if (getClass() != obj.getClass()) {
+            return false;
+        }
+        final CountryOfOrigin other = (CountryOfOrigin) obj;
+        return Arrays.equals(this.country, other.country);
+    }
+
+    @Override
+    public String toString()
+    {
+        return String.copyValueOf(this.country);
+    }
+
+    @Override
+    public int compareTo(CountryOfOrigin o)
+    {
+      return String.copyValueOf(this.country).compareTo(String.copyValueOf(o.country));
+    }
+    
+    @Override
+    public Object clone() {
+        return new CountryOfOrigin(new String(this.country).toCharArray());
+    }
+
+    public static void main(String[] args) throws CloneNotSupportedException
+    {
+     CountryOfOrigin c1 = new CountryOfOrigin();
+     CountryOfOrigin c2 = new CountryOfOrigin("GERMANY".toCharArray());
+     CountryOfOrigin c3 = (CountryOfOrigin) c2.clone();
+     
+        System.out.println("c1 is: " + c1);
+        System.out.println("c2 is: " + c2);
+        System.out.println("c3 cloned of c2 is: " + c3);
+        
+        c3.changeOneLetter(0, 'J');
+        c3.changeOneLetter(1, 'A');
+        c3.changeOneLetter(2, 'P');
+        
+        System.out.println("c3 after changeOneLetter is: " + c3);
+        System.out.println("if this displays GERMANY and not JAPMANY\nyour clone is deep: " + c2);
+        
+        System.out.println(c1.compareTo(c2));
+        System.out.println(c1.compareTo(c3));
+        System.out.println(c1.equals(c2));
+        System.out.println(c1.equals(c3));
+        System.out.println(c2.getCountry());
+        c2.setCountry("ITALY".toCharArray());
+        System.out.println(c2.getCountry());
+        System.out.println(c1.getCountry());
+    }
+}
+
+
+ diff --git a/Semester 2/Exams/Exam2-Practice1_CalebFontenot/Printed HTMLs/Dealership.html b/Semester 2/Exams/Exam2-Practice1_CalebFontenot/Printed HTMLs/Dealership.html new file mode 100644 index 0000000..5195b0c --- /dev/null +++ b/Semester 2/Exams/Exam2-Practice1_CalebFontenot/Printed HTMLs/Dealership.html @@ -0,0 +1,68 @@ + + + +Dealership.java + + + + +
/home/caleb/ASDV-Java/Semester 2/Exams/Exam2-Practice_CalebFontenot/src/main/java/com/calebfontenot/exam2/practice_calebfontenot/Dealership.java
+
+/*
+ * 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 com.calebfontenot.exam2.practice_calebfontenot;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+
+/**
+ *
+ * @author caleb
+ */
+public class Dealership extends ArrayList<Automobile> {
+    /** Sorts the inherited ArrayList of Automobiles
+     *   into ascending order by vin number.
+     * @param d the Dealership of Automobiles
+     */
+    public static void sortByVin(Dealership d) { //java.util.Collections.sort() could do all of this in a single line
+        Object[] dealershipArray = d.toArray();
+        Arrays.sort(dealershipArray);
+        d.clear();
+        for (int i = 0; i < dealershipArray.length; ++i) {
+            d.add((Automobile) dealershipArray[i]);
+        }
+    }
+    public static void main(String[] args)
+    {
+        Dealership d = new Dealership();
+        
+        d.add(new Automobile("8", new CountryOfOrigin("USA".toCharArray())));
+        d.add(new Automobile("1", new CountryOfOrigin("GERMANY".toCharArray())));
+        System.out.println("THE ORIGINAL DEALERSHIP\n" + d);
+        Dealership.sortByVin(d);
+        System.out.println("\nTHE SORTED BY VIN DEALERSHIP\n" + d);
+    }
+}
+
+
+ diff --git a/Semester 2/Exams/Exam2-Practice1_CalebFontenot/exam2Programming-1.pdf b/Semester 2/Exams/Exam2-Practice1_CalebFontenot/exam2Programming-1.pdf new file mode 100644 index 0000000..611cbc6 Binary files /dev/null and b/Semester 2/Exams/Exam2-Practice1_CalebFontenot/exam2Programming-1.pdf differ diff --git a/Semester 2/Exams/Exam2-Practice1_CalebFontenot/pom.xml b/Semester 2/Exams/Exam2-Practice1_CalebFontenot/pom.xml new file mode 100644 index 0000000..15491e9 --- /dev/null +++ b/Semester 2/Exams/Exam2-Practice1_CalebFontenot/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + com.calebfontenot + Exam2-Practice1_CalebFontenot + 1.0-SNAPSHOT + jar + + UTF-8 + 17 + 17 + com.calebfontenot.exam2.practice_calebfontenot.Exam2Practice_CalebFontenot + + Exam2-Practice1_CalebFontenot + \ No newline at end of file diff --git a/Semester 2/Exams/Exam2-Practice1_CalebFontenot/src/main/java/com/calebfontenot/exam2/practice_calebfontenot/Automobile.java b/Semester 2/Exams/Exam2-Practice1_CalebFontenot/src/main/java/com/calebfontenot/exam2/practice_calebfontenot/Automobile.java new file mode 100644 index 0000000..365ae33 --- /dev/null +++ b/Semester 2/Exams/Exam2-Practice1_CalebFontenot/src/main/java/com/calebfontenot/exam2/practice_calebfontenot/Automobile.java @@ -0,0 +1,76 @@ +/* + * 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 com.calebfontenot.exam2.practice_calebfontenot; + +import java.util.Objects; + +/** + * + * @author caleb + */ +public class Automobile implements Comparable { + + private String vin; + private CountryOfOrigin origin; + + public Automobile(String vin, CountryOfOrigin origin) + { + this.vin = vin; + this.origin = origin; + } + + public CountryOfOrigin getOrigin() + { + return origin; + } + + public void setOrigin(CountryOfOrigin origin) + { + this.origin = origin; + } + + + public String getVin() + { + return vin; + } + + public void setVin(String vin) + { + this.vin = vin; + } + + @Override + public String toString() + { + return "Automobile{" + "vin=" + vin + ", origin=" + origin + '}'; + } + + @Override + public boolean equals(Object obj) + { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final Automobile other = (Automobile) obj; + if (!Objects.equals(this.vin, other.vin)) { + return false; + } + return Objects.equals(this.origin, other.origin); + } + + @Override + public int compareTo(Automobile o) + { + return vin.compareTo(o.vin); + } + +} diff --git a/Semester 2/Exams/Exam2-Practice1_CalebFontenot/src/main/java/com/calebfontenot/exam2/practice_calebfontenot/CountryOfOrigin.java b/Semester 2/Exams/Exam2-Practice1_CalebFontenot/src/main/java/com/calebfontenot/exam2/practice_calebfontenot/CountryOfOrigin.java new file mode 100644 index 0000000..15f4e06 --- /dev/null +++ b/Semester 2/Exams/Exam2-Practice1_CalebFontenot/src/main/java/com/calebfontenot/exam2/practice_calebfontenot/CountryOfOrigin.java @@ -0,0 +1,102 @@ +/* + * 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 com.calebfontenot.exam2.practice_calebfontenot; + +import java.util.Arrays; + +/** + * + * @author caleb + */ +public class CountryOfOrigin implements Cloneable, Comparable { + + private char[] country = "USA".toCharArray(); + + public CountryOfOrigin() {} + + public CountryOfOrigin(char[] country) + { + this.country = country; + } + + public String getCountry() + { + return String.copyValueOf(this.country); + } + + public void setCountry(char[] country) + { + this.country = country; + } + + public boolean changeOneLetter(int index, char newLetter) + { + if (index >= this.country.length || index < 0) { + return false; + } + this.country[index] = newLetter; + return true; + } + + @Override + public boolean equals(Object obj) + { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final CountryOfOrigin other = (CountryOfOrigin) obj; + return Arrays.equals(this.country, other.country); + } + + @Override + public String toString() + { + return String.copyValueOf(this.country); + } + + @Override + public int compareTo(CountryOfOrigin o) + { + return String.copyValueOf(this.country).compareTo(String.copyValueOf(o.country)); + } + + @Override + public Object clone() { + return new CountryOfOrigin(new String(this.country).toCharArray()); + } + + public static void main(String[] args) throws CloneNotSupportedException + { + CountryOfOrigin c1 = new CountryOfOrigin(); + CountryOfOrigin c2 = new CountryOfOrigin("GERMANY".toCharArray()); + CountryOfOrigin c3 = (CountryOfOrigin) c2.clone(); + + System.out.println("c1 is: " + c1); + System.out.println("c2 is: " + c2); + System.out.println("c3 cloned of c2 is: " + c3); + + c3.changeOneLetter(0, 'J'); + c3.changeOneLetter(1, 'A'); + c3.changeOneLetter(2, 'P'); + + System.out.println("c3 after changeOneLetter is: " + c3); + System.out.println("if this displays GERMANY and not JAPMANY\nyour clone is deep: " + c2); + + System.out.println(c1.compareTo(c2)); + System.out.println(c1.compareTo(c3)); + System.out.println(c1.equals(c2)); + System.out.println(c1.equals(c3)); + System.out.println(c2.getCountry()); + c2.setCountry("ITALY".toCharArray()); + System.out.println(c2.getCountry()); + System.out.println(c1.getCountry()); + } +} diff --git a/Semester 2/Exams/Exam2-Practice1_CalebFontenot/src/main/java/com/calebfontenot/exam2/practice_calebfontenot/Dealership.java b/Semester 2/Exams/Exam2-Practice1_CalebFontenot/src/main/java/com/calebfontenot/exam2/practice_calebfontenot/Dealership.java new file mode 100644 index 0000000..bcf8ac6 --- /dev/null +++ b/Semester 2/Exams/Exam2-Practice1_CalebFontenot/src/main/java/com/calebfontenot/exam2/practice_calebfontenot/Dealership.java @@ -0,0 +1,37 @@ +/* + * 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 com.calebfontenot.exam2.practice_calebfontenot; + +import java.util.ArrayList; +import java.util.Arrays; + +/** + * + * @author caleb + */ +public class Dealership extends ArrayList { + /** Sorts the inherited ArrayList of Automobiles + * into ascending order by vin number. + * @param d the Dealership of Automobiles + */ + public static void sortByVin(Dealership d) { //java.util.Collections.sort() could do all of this in a single line + Object[] dealershipArray = d.toArray(); + Arrays.sort(dealershipArray); + d.clear(); + for (int i = 0; i < dealershipArray.length; ++i) { + d.add((Automobile) dealershipArray[i]); + } + } + public static void main(String[] args) + { + Dealership d = new Dealership(); + + d.add(new Automobile("8", new CountryOfOrigin("USA".toCharArray()))); + d.add(new Automobile("1", new CountryOfOrigin("GERMANY".toCharArray()))); + System.out.println("THE ORIGINAL DEALERSHIP\n" + d); + Dealership.sortByVin(d); + System.out.println("\nTHE SORTED BY VIN DEALERSHIP\n" + d); + } +} diff --git a/Semester 2/Exams/Exam2-Practice1_CalebFontenot/src/main/java/com/calebfontenot/exam2/practice_calebfontenot/Exam2Practice_CalebFontenot.java b/Semester 2/Exams/Exam2-Practice1_CalebFontenot/src/main/java/com/calebfontenot/exam2/practice_calebfontenot/Exam2Practice_CalebFontenot.java new file mode 100644 index 0000000..9dea3f7 --- /dev/null +++ b/Semester 2/Exams/Exam2-Practice1_CalebFontenot/src/main/java/com/calebfontenot/exam2/practice_calebfontenot/Exam2Practice_CalebFontenot.java @@ -0,0 +1,16 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + */ + +package com.calebfontenot.exam2.practice_calebfontenot; + +/** + * + * @author caleb + */ +public class Exam2Practice_CalebFontenot { + + public static void main(String[] args) { + System.out.println("Hello World!"); + } +} diff --git a/Semester 2/Exams/Exam2-Practice1_CalebFontenot/src/main/java/com/calebfontenot/exam2/practice_calebfontenot/Main.java b/Semester 2/Exams/Exam2-Practice1_CalebFontenot/src/main/java/com/calebfontenot/exam2/practice_calebfontenot/Main.java new file mode 100644 index 0000000..8d1c8b6 --- /dev/null +++ b/Semester 2/Exams/Exam2-Practice1_CalebFontenot/src/main/java/com/calebfontenot/exam2/practice_calebfontenot/Main.java @@ -0,0 +1 @@ + diff --git a/Semester 2/Exams/Exam2-Practice2_CalebFontenot/Printed HTMLs/Automobile.html b/Semester 2/Exams/Exam2-Practice2_CalebFontenot/Printed HTMLs/Automobile.html new file mode 100644 index 0000000..ad1e21e --- /dev/null +++ b/Semester 2/Exams/Exam2-Practice2_CalebFontenot/Printed HTMLs/Automobile.html @@ -0,0 +1,125 @@ + + + +Automobile.java + + + + +
/home/caleb/ASDV-Java/Semester 2/Assignments/Exam2-Practice2_CalebFontenot/src/main/java/com/calebfontenot/exam2/practice2_calebfontenot/Automobile.java
+
+/*
+ * 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 com.calebfontenot.exam2.practice2_calebfontenot;
+
+import java.util.Objects;
+
+/**
+ *
+ * @author caleb
+ */
+public class Automobile extends Vehicle implements Cloneable{
+
+    private String make;
+
+    public Automobile(String make)
+    {
+        this.make = make;
+    }
+    public Automobile(String make, String vin)
+    {
+        super(vin);
+        this.make = make;
+    }   
+    public String getMake() { return make; }
+    public void setMake(String make) { this.make = make; }
+    @Override
+    public int compareTo(Vehicle o)
+    {
+        return this.getVin().compareTo(o.getVin());
+    }
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (this == obj) {
+            return true;
+        }
+        if (obj == null) {
+            return false;
+        }
+        if (getClass() != obj.getClass()) {
+            return false;
+        }
+        final Automobile other = (Automobile) obj;
+         boolean isSameObjectType = Objects.equals(this.make, other.make);
+         if (isSameObjectType) {
+             if (this.make.compareTo(other.make) == 0 && (this.getVin().compareTo(other.getVin()) == 0)) {
+                 return true;
+             } else {
+                 return false;
+             }
+         } else {
+             return false;
+         }
+    }
+    @Override
+    protected Object clone() throws CloneNotSupportedException {
+        String make = new String(this.getMake());
+        String vim = new String(this.getVin());
+        Automobile clonedAuto = new Automobile(make, vim);
+        return clonedAuto;
+    }
+
+    @Override
+    public String toString()
+    {
+        return super.toString() + "\n" + "Automobile{" + "make=" + make + '}';
+    }
+    
+    public static void main(String[] args) throws CloneNotSupportedException
+    {
+        Automobile johnsBeemer = new Automobile ("BMW", "vin1BMW");
+        Automobile marysBeemer = new Automobile ("BMW", "vin2BMW");
+        
+        Automobile johnsClonedBeemer = (Automobile) johnsBeemer.clone();
+        
+        System.out.println(johnsBeemer + "\n");
+        System.out.println(marysBeemer + "\n");
+        System.out.println(johnsClonedBeemer + "\n");
+        
+
+         
+        System.out.println("John\'s beemer EQUALS Mary\'s beemer --> " + johnsBeemer.equals(marysBeemer));
+        System.out.println("John\'s beemer EQUALS John\'s beemer --> " + johnsBeemer.equals(johnsClonedBeemer));
+        
+        System.out.println("John\'s beemer COMPARE_TO John\'s cloned beemer --> " + johnsBeemer.compareTo(johnsClonedBeemer));
+        System.out.println("John\'s beemer COMPARE_TO Mary\'s beemer --> " +johnsBeemer.compareTo(marysBeemer));
+        
+        System.out.println("John\'s beemer EQUALS Airplane --> " + johnsBeemer.equals(new Airplane()));
+    }
+}
+
+class Airplane {}
+
+
+ diff --git a/Semester 2/Exams/Exam2-Practice2_CalebFontenot/Printed HTMLs/Vehicle.html b/Semester 2/Exams/Exam2-Practice2_CalebFontenot/Printed HTMLs/Vehicle.html new file mode 100644 index 0000000..012a399 --- /dev/null +++ b/Semester 2/Exams/Exam2-Practice2_CalebFontenot/Printed HTMLs/Vehicle.html @@ -0,0 +1,69 @@ + + + +Vehicle.java + + + + +
/home/caleb/ASDV-Java/Semester 2/Assignments/Exam2-Practice2_CalebFontenot/src/main/java/com/calebfontenot/exam2/practice2_calebfontenot/Vehicle.java
+
+/*
+ * 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 com.calebfontenot.exam2.practice2_calebfontenot;
+
+import java.util.Objects;
+
+/**
+ *
+ * @author caleb
+ */
+abstract public class Vehicle implements Cloneable, Comparable<Vehicle> {
+
+        private String vin;
+        public Vehicle(){}
+        public Vehicle(String vin) {this.vin = vin;}
+        public String getVin() { return vin; }
+        public void setVin(String vin) { this.vin = vin; }
+
+        @Override
+        public String toString()
+        { return "Vehicle{" + "vin=" + vin + '}'; }
+        
+        @Override
+        public boolean equals(Object obj)
+        {
+        if (this == obj) {
+            return true;
+        }
+        if (obj == null) {
+            return false;
+        }
+        if (getClass() != obj.getClass()) {
+            return false;
+        }
+        final Vehicle other = (Vehicle) obj;
+        return Objects.equals(this.vin, other.vin);
+    }
+    
+}
+
+
+ diff --git a/Semester 2/Exams/Exam2-Practice2_CalebFontenot/exam2Programming.pdf b/Semester 2/Exams/Exam2-Practice2_CalebFontenot/exam2Programming.pdf new file mode 100644 index 0000000..51a7c31 Binary files /dev/null and b/Semester 2/Exams/Exam2-Practice2_CalebFontenot/exam2Programming.pdf differ diff --git a/Semester 2/Exams/Exam2-Practice2_CalebFontenot/pom.xml b/Semester 2/Exams/Exam2-Practice2_CalebFontenot/pom.xml new file mode 100644 index 0000000..a03cfc0 --- /dev/null +++ b/Semester 2/Exams/Exam2-Practice2_CalebFontenot/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + com.calebfontenot + Exam2-Practice2_CalebFontenot + 1.0-SNAPSHOT + jar + + UTF-8 + 17 + 17 + com.calebfontenot.exam2.practice2_calebfontenot.Exam2Practice2_CalebFontenot + + \ No newline at end of file diff --git a/Semester 2/Exams/Exam2-Practice2_CalebFontenot/src/main/java/com/calebfontenot/exam2/practice2_calebfontenot/Automobile.java b/Semester 2/Exams/Exam2-Practice2_CalebFontenot/src/main/java/com/calebfontenot/exam2/practice2_calebfontenot/Automobile.java new file mode 100644 index 0000000..a7a8945 --- /dev/null +++ b/Semester 2/Exams/Exam2-Practice2_CalebFontenot/src/main/java/com/calebfontenot/exam2/practice2_calebfontenot/Automobile.java @@ -0,0 +1,94 @@ +/* + * 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 com.calebfontenot.exam2.practice2_calebfontenot; + +import java.util.Objects; + +/** + * + * @author caleb + */ +public class Automobile extends Vehicle implements Cloneable{ + + private String make; + + public Automobile(String make) + { + this.make = make; + } + public Automobile(String make, String vin) + { + super(vin); + this.make = make; + } + public String getMake() { return make; } + public void setMake(String make) { this.make = make; } + @Override + public int compareTo(Vehicle o) + { + return this.getVin().compareTo(o.getVin()); + } + @Override + public boolean equals(Object obj) + { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final Automobile other = (Automobile) obj; + boolean isSameObjectType = Objects.equals(this.make, other.make); + if (isSameObjectType) { + if (this.make.compareTo(other.make) == 0 && (this.getVin().compareTo(other.getVin()) == 0)) { + return true; + } else { + return false; + } + } else { + return false; + } + } + @Override + protected Object clone() throws CloneNotSupportedException { + String make = new String(this.getMake()); + String vim = new String(this.getVin()); + Automobile clonedAuto = new Automobile(make, vim); + return clonedAuto; + } + + @Override + public String toString() + { + return super.toString() + "\n" + "Automobile{" + "make=" + make + '}'; + } + + public static void main(String[] args) throws CloneNotSupportedException + { + Automobile johnsBeemer = new Automobile ("BMW", "vin1BMW"); + Automobile marysBeemer = new Automobile ("BMW", "vin2BMW"); + + Automobile johnsClonedBeemer = (Automobile) johnsBeemer.clone(); + + System.out.println(johnsBeemer + "\n"); + System.out.println(marysBeemer + "\n"); + System.out.println(johnsClonedBeemer + "\n"); + + + + System.out.println("John\'s beemer EQUALS Mary\'s beemer --> " + johnsBeemer.equals(marysBeemer)); + System.out.println("John\'s beemer EQUALS John\'s beemer --> " + johnsBeemer.equals(johnsClonedBeemer)); + + System.out.println("John\'s beemer COMPARE_TO John\'s cloned beemer --> " + johnsBeemer.compareTo(johnsClonedBeemer)); + System.out.println("John\'s beemer COMPARE_TO Mary\'s beemer --> " +johnsBeemer.compareTo(marysBeemer)); + + System.out.println("John\'s beemer EQUALS Airplane --> " + johnsBeemer.equals(new Airplane())); + } +} + +class Airplane {} diff --git a/Semester 2/Exams/Exam2-Practice2_CalebFontenot/src/main/java/com/calebfontenot/exam2/practice2_calebfontenot/Exam2Practice2_CalebFontenot.java b/Semester 2/Exams/Exam2-Practice2_CalebFontenot/src/main/java/com/calebfontenot/exam2/practice2_calebfontenot/Exam2Practice2_CalebFontenot.java new file mode 100644 index 0000000..dccc613 --- /dev/null +++ b/Semester 2/Exams/Exam2-Practice2_CalebFontenot/src/main/java/com/calebfontenot/exam2/practice2_calebfontenot/Exam2Practice2_CalebFontenot.java @@ -0,0 +1,16 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + */ + +package com.calebfontenot.exam2.practice2_calebfontenot; + +/** + * + * @author caleb + */ +public class Exam2Practice2_CalebFontenot { + + public static void main(String[] args) { + System.out.println("Hello World!"); + } +} diff --git a/Semester 2/Exams/Exam2-Practice2_CalebFontenot/src/main/java/com/calebfontenot/exam2/practice2_calebfontenot/Main.java b/Semester 2/Exams/Exam2-Practice2_CalebFontenot/src/main/java/com/calebfontenot/exam2/practice2_calebfontenot/Main.java new file mode 100644 index 0000000..ea3525b --- /dev/null +++ b/Semester 2/Exams/Exam2-Practice2_CalebFontenot/src/main/java/com/calebfontenot/exam2/practice2_calebfontenot/Main.java @@ -0,0 +1,121 @@ +package com.calebfontenot.exam2.practice2_calebfontenot; + +import java.util.Objects; + +/** + * + * @author caleb + */ +public class Automobile extends Vehicle implements Cloneable{ + + private String make; + + public Automobile(String make) + { + this.make = make; + } + public Automobile(String make, String vin) + { + super(vin); + this.make = make; + } + public String getMake() { return make; } + public void setMake(String make) { this.make = make; } + @Override + public int compareTo(Vehicle o) + { + return this.getVin().compareTo(o.getVin()); + } + @Override + public boolean equals(Object obj) + { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final Automobile other = (Automobile) obj; + boolean isSameObjectType = Objects.equals(this.make, other.make); + if (isSameObjectType) { + if (this.make.compareTo(other.make) == 0 && (this.getVin().compareTo(other.getVin()) == 0)) { + return true; + } else { + return false; + } + } else { + return false; + } + } + @Override + protected Object clone() throws CloneNotSupportedException { + String make = new String(this.getMake()); + String vim = new String(this.getVin()); + Automobile clonedAuto = new Automobile(make, vim); + return clonedAuto; + } + + @Override + public String toString() + { + return super.toString() + "\n" + "Automobile{" + "make=" + make + '}'; + } + + public static void main(String[] args) throws CloneNotSupportedException + { + Automobile johnsBeemer = new Automobile ("BMW", "vin1BMW"); + Automobile marysBeemer = new Automobile ("BMW", "vin2BMW"); + + Automobile johnsClonedBeemer = (Automobile) johnsBeemer.clone(); + + System.out.println(johnsBeemer + "\n"); + System.out.println(marysBeemer + "\n"); + System.out.println(johnsClonedBeemer + "\n"); + + + + System.out.println("John\'s beemer EQUALS Mary\'s beemer --> " + johnsBeemer.equals(marysBeemer)); + System.out.println("John\'s beemer EQUALS John\'s beemer --> " + johnsBeemer.equals(johnsClonedBeemer)); + + System.out.println("John\'s beemer COMPARE_TO John\'s cloned beemer --> " + johnsBeemer.compareTo(johnsClonedBeemer)); + System.out.println("John\'s beemer COMPARE_TO Mary\'s beemer --> " +johnsBeemer.compareTo(marysBeemer)); + + System.out.println("John\'s beemer EQUALS Airplane --> " + johnsBeemer.equals(new Airplane())); + } +} + +abstract public class Vehicle implements Cloneable, Comparable { + + private String vin; + public Vehicle(){} + public Vehicle(String vin) {this.vin = vin;} + public String getVin() { return vin; } + public void setVin(String vin) { this.vin = vin; } + + @Override + public String toString() + { return "Vehicle{" + "vin=" + vin + '}'; } + + @Override + public boolean equals(Object obj) + { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final Vehicle other = (Vehicle) obj; + return Objects.equals(this.vin, other.vin); + } + +} + +class Airplane {} + diff --git a/Semester 2/Exams/Exam2-Practice2_CalebFontenot/src/main/java/com/calebfontenot/exam2/practice2_calebfontenot/Vehicle.java b/Semester 2/Exams/Exam2-Practice2_CalebFontenot/src/main/java/com/calebfontenot/exam2/practice2_calebfontenot/Vehicle.java new file mode 100644 index 0000000..79ef7c8 --- /dev/null +++ b/Semester 2/Exams/Exam2-Practice2_CalebFontenot/src/main/java/com/calebfontenot/exam2/practice2_calebfontenot/Vehicle.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 com.calebfontenot.exam2.practice2_calebfontenot; + +import java.util.Objects; + +/** + * + * @author caleb + */ +abstract public class Vehicle implements Cloneable, Comparable { + + private String vin; + public Vehicle(){} + public Vehicle(String vin) {this.vin = vin;} + public String getVin() { return vin; } + public void setVin(String vin) { this.vin = vin; } + + @Override + public String toString() + { return "Vehicle{" + "vin=" + vin + '}'; } + + @Override + public boolean equals(Object obj) + { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final Vehicle other = (Vehicle) obj; + return Objects.equals(this.vin, other.vin); + } + +} diff --git a/Semester 2/Exams/Exam2-Practice2_CalebFontenot/target/classes/com/calebfontenot/exam2/practice2_calebfontenot/Airplane.class b/Semester 2/Exams/Exam2-Practice2_CalebFontenot/target/classes/com/calebfontenot/exam2/practice2_calebfontenot/Airplane.class new file mode 100644 index 0000000..19289df Binary files /dev/null and b/Semester 2/Exams/Exam2-Practice2_CalebFontenot/target/classes/com/calebfontenot/exam2/practice2_calebfontenot/Airplane.class differ diff --git a/Semester 2/Exams/Exam2-Practice2_CalebFontenot/target/classes/com/calebfontenot/exam2/practice2_calebfontenot/Automobile.class b/Semester 2/Exams/Exam2-Practice2_CalebFontenot/target/classes/com/calebfontenot/exam2/practice2_calebfontenot/Automobile.class new file mode 100644 index 0000000..ea8a41c Binary files /dev/null and b/Semester 2/Exams/Exam2-Practice2_CalebFontenot/target/classes/com/calebfontenot/exam2/practice2_calebfontenot/Automobile.class differ diff --git a/Semester 2/Exams/Exam2-Practice2_CalebFontenot/target/classes/com/calebfontenot/exam2/practice2_calebfontenot/Exam2Practice2_CalebFontenot.class b/Semester 2/Exams/Exam2-Practice2_CalebFontenot/target/classes/com/calebfontenot/exam2/practice2_calebfontenot/Exam2Practice2_CalebFontenot.class new file mode 100644 index 0000000..f3dec5e Binary files /dev/null and b/Semester 2/Exams/Exam2-Practice2_CalebFontenot/target/classes/com/calebfontenot/exam2/practice2_calebfontenot/Exam2Practice2_CalebFontenot.class differ diff --git a/Semester 2/Exams/Exam2-Practice2_CalebFontenot/target/classes/com/calebfontenot/exam2/practice2_calebfontenot/Vehicle.class b/Semester 2/Exams/Exam2-Practice2_CalebFontenot/target/classes/com/calebfontenot/exam2/practice2_calebfontenot/Vehicle.class new file mode 100644 index 0000000..57ba9b5 Binary files /dev/null and b/Semester 2/Exams/Exam2-Practice2_CalebFontenot/target/classes/com/calebfontenot/exam2/practice2_calebfontenot/Vehicle.class differ diff --git a/Semester 2/Exams/Exam2-Practice2_CalebFontenot/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/Semester 2/Exams/Exam2-Practice2_CalebFontenot/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..ac5f4fb --- /dev/null +++ b/Semester 2/Exams/Exam2-Practice2_CalebFontenot/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,4 @@ +com/calebfontenot/exam2/practice2_calebfontenot/Automobile.class +com/calebfontenot/exam2/practice2_calebfontenot/Exam2Practice2_CalebFontenot.class +com/calebfontenot/exam2/practice2_calebfontenot/Airplane.class +com/calebfontenot/exam2/practice2_calebfontenot/Vehicle.class diff --git a/Semester 2/Exams/Exam2-Practice2_CalebFontenot/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/Semester 2/Exams/Exam2-Practice2_CalebFontenot/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..72e9527 --- /dev/null +++ b/Semester 2/Exams/Exam2-Practice2_CalebFontenot/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,3 @@ +/home/caleb/ASDV-Java/Semester 2/Assignments/Exam2-Practice2_CalebFontenot/src/main/java/com/calebfontenot/exam2/practice2_calebfontenot/Exam2Practice2_CalebFontenot.java +/home/caleb/ASDV-Java/Semester 2/Assignments/Exam2-Practice2_CalebFontenot/src/main/java/com/calebfontenot/exam2/practice2_calebfontenot/Vehicle.java +/home/caleb/ASDV-Java/Semester 2/Assignments/Exam2-Practice2_CalebFontenot/src/main/java/com/calebfontenot/exam2/practice2_calebfontenot/Automobile.java diff --git a/Semester 2/ZIPs/Exam2-Practice1_CalebFontenot.zip b/Semester 2/ZIPs/Exam2-Practice1_CalebFontenot.zip new file mode 100644 index 0000000..8fa0d5e Binary files /dev/null and b/Semester 2/ZIPs/Exam2-Practice1_CalebFontenot.zip differ diff --git a/Semester 2/ZIPs/Exam2-Practice2_CalebFontenot.zip b/Semester 2/ZIPs/Exam2-Practice2_CalebFontenot.zip new file mode 100644 index 0000000..92a585c Binary files /dev/null and b/Semester 2/ZIPs/Exam2-Practice2_CalebFontenot.zip differ diff --git a/Semester 2/ZIPs/JavaFX_CalebFontenot.zip b/Semester 2/ZIPs/JavaFX_CalebFontenot.zip index 2bb7d89..7fe7004 100644 Binary files a/Semester 2/ZIPs/JavaFX_CalebFontenot.zip and b/Semester 2/ZIPs/JavaFX_CalebFontenot.zip differ