diff --git a/.gitignore b/.gitignore
index 348d561..fdbdff1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,3 +7,6 @@
/MP2_CalebFontenot/target/
/lab8_CalebFontenot/target/
/lab9_CalebFontenot/target/
+/ExamPractice/target/
+/Exam1_CalebFontenot/target/
+/Exam1Practice_CalebFontenot/target/
diff --git a/Exam1Practice_CalebFontenot/DayOfTheWeek.html b/Exam1Practice_CalebFontenot/DayOfTheWeek.html
new file mode 100755
index 0000000..223d43a
--- /dev/null
+++ b/Exam1Practice_CalebFontenot/DayOfTheWeek.html
@@ -0,0 +1,86 @@
+
+
+
+DayOfTheWeek.java
+
+
+
+
+C:\Users\ar114\Documents\NetBeansProjects\Exam1_CalebFontenot\src\main\java\com\calebfontenot\exam1_calebfontenot\DayOfTheWeek.java |
+
+
+nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt
+nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java
+
+package com.calebfontenot.exam1_calebfontenot;
+
+import java.util.Scanner;
+
+
+
+@author
+
+public class DayOfTheWeek {
+ public static void main(String[] args) {
+ Scanner input = new Scanner(System.in);
+ System.out.print("\n\n Enter year (e.g. 2008): ");
+ int year = input.nextInt();
+ System.out.print("Enter month 1-12: ");
+ int month = input.nextInt();
+ if (month == 1) {
+ month = 13;
+ year = year - 1;
+ }
+ else if (month == 2) {
+ month = 14;
+ year = year - 1;
+ }
+ System.out.println("Enter the day of the month: 1-31: ");
+ int dayOfMonth = input.nextInt();
+
+ int j = year / 100;
+ int k = year % 100;
+
+ int dayOfWeek = (dayOfMonth
+ + 26 * (month + 1) / 10 + k + k / 4 + j / 4 + 5 * j) % 7;
+ if (dayOfWeek == 0) {
+ System.out.println("Day of the week is Saturday");
+ }
+ else if (dayOfWeek == 1) {
+ System.out.println("Day of the week is Sunday");
+ }
+ else if (dayOfWeek == 2) {
+ System.out.println("Day of the week is Monday");
+ }
+ else if (dayOfWeek == 3) {
+ System.out.println("Day of the week is Tuesday");
+ }
+ else if (dayOfWeek == 4) {
+ System.out.println("Day of the week is Wednesday");
+ }
+ else if (dayOfWeek == 5) {
+ System.out.println("Day of the week is Thursday");
+ }
+ else if (dayOfWeek == 6) {
+ System.out.println("Day of the week is Friday");
+ }
+ }
+}
+
+
+
diff --git a/Exam1Practice_CalebFontenot/RandomMonth.html b/Exam1Practice_CalebFontenot/RandomMonth.html
new file mode 100755
index 0000000..b388295
--- /dev/null
+++ b/Exam1Practice_CalebFontenot/RandomMonth.html
@@ -0,0 +1,71 @@
+
+
+
+RandomMonth.java
+
+
+
+
+C:\Users\ar114\Documents\NetBeansProjects\Exam1_CalebFontenot\src\main\java\com\calebfontenot\exam1_calebfontenot\RandomMonth.java |
+
+
+nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt
+nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java
+
+package com.calebfontenot.exam1_calebfontenot;
+
+
+
+@author
+
+public class RandomMonth {
+
+ public static void main(String[] args) {
+ int number = (int) (Math.random() * 12 + 1);
+ System.out.println("Random generated number is: " + number);
+ switch (number) {
+ case 1:
+ System.out.println("Month is January"); break;
+ case 2:
+ System.out.println("Month is February"); break;
+ case 3:
+ System.out.println("Month is March"); break;
+ case 4:
+ System.out.println("Month is April"); break;
+ case 5:
+ System.out.println("Month is May"); break;
+ case 6:
+ System.out.println("Month is June"); break;
+ case 7:
+ System.out.println("Month is July"); break;
+ case 8:
+ System.out.println("Month is August"); break;
+ case 9:
+ System.out.println("Month is September"); break;
+ case 10:
+ System.out.println("Month is October"); break;
+ case 11:
+ System.out.println("Month is November"); break;
+ case 12:
+ System.out.println("Month is December"); break;
+ }
+ }
+}
+
+
+
diff --git a/Exam1Practice_CalebFontenot/TrianglePerimeter.html b/Exam1Practice_CalebFontenot/TrianglePerimeter.html
new file mode 100755
index 0000000..86bf399
--- /dev/null
+++ b/Exam1Practice_CalebFontenot/TrianglePerimeter.html
@@ -0,0 +1,61 @@
+
+
+
+TrianglePerimeter.java
+
+
+
+
+C:\Users\ar114\Documents\NetBeansProjects\Exam1_CalebFontenot\src\main\java\com\calebfontenot\exam1_calebfontenot\TrianglePerimeter.java |
+
+
+nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt
+nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java
+
+package com.calebfontenot.exam1_calebfontenot;
+
+import java.util.Scanner;
+
+
+
+@author
+
+public class TrianglePerimeter {
+ public static void main(String[] args) {
+
+ Scanner input = new Scanner(System.in);
+
+
+ int triEdge1, triEdge2, triEdge3;
+
+
+ System.out.print("Enter 3 edges for a triangle: ");
+ triEdge1 = input.nextInt();
+ triEdge2 = input.nextInt();
+ triEdge3 = input.nextInt();
+
+
+ System.out.println(((triEdge1 + triEdge2) > triEdge3) ||
+ ((triEdge1 + triEdge3) > triEdge2) ||
+ ((triEdge2 + triEdge3) > triEdge1) ?
+ "Input is valid" : "Invalid Input");
+
+ }
+}
+
+
+
diff --git a/Exam1Practice_CalebFontenot/pom.xml b/Exam1Practice_CalebFontenot/pom.xml
new file mode 100755
index 0000000..1db546b
--- /dev/null
+++ b/Exam1Practice_CalebFontenot/pom.xml
@@ -0,0 +1,14 @@
+
+
+ 4.0.0
+ com.calebfontenot.exam1_calebfontenot
+ Exam1_CalebFontenot
+ 1.0-SNAPSHOT
+ jar
+
+ UTF-8
+ 11
+ 11
+ com.calebfontenot.exam1_calebfontenot.Exam1_CalebFontenot
+
+
\ No newline at end of file
diff --git a/Exam1Practice_CalebFontenot/src/main/java/com/calebfontenot/exam1_calebfontenot/DayOfTheWeek.java b/Exam1Practice_CalebFontenot/src/main/java/com/calebfontenot/exam1_calebfontenot/DayOfTheWeek.java
new file mode 100755
index 0000000..711eca2
--- /dev/null
+++ b/Exam1Practice_CalebFontenot/src/main/java/com/calebfontenot/exam1_calebfontenot/DayOfTheWeek.java
@@ -0,0 +1,58 @@
+/*
+ * 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.exam1_calebfontenot;
+
+import java.util.Scanner;
+
+/**
+ *
+ * @author ar114
+ */
+public class DayOfTheWeek {
+ public static void main(String[] args) {
+ Scanner input = new Scanner(System.in);
+ System.out.print("\n\n Enter year (e.g. 2008): ");
+ int year = input.nextInt();
+ System.out.print("Enter month 1-12: ");
+ int month = input.nextInt();
+ if (month == 1) {
+ month = 13;
+ year = year - 1;
+ }
+ else if (month == 2) {
+ month = 14;
+ year = year - 1;
+ }
+ System.out.println("Enter the day of the month: 1-31: ");
+ int dayOfMonth = input.nextInt();
+
+ int j = year / 100;
+ int k = year % 100;
+
+ int dayOfWeek = (dayOfMonth
+ + 26 * (month + 1) / 10 + k + k / 4 + j / 4 + 5 * j) % 7;
+ if (dayOfWeek == 0) {
+ System.out.println("Day of the week is Saturday");
+ }
+ else if (dayOfWeek == 1) {
+ System.out.println("Day of the week is Sunday");
+ }
+ else if (dayOfWeek == 2) {
+ System.out.println("Day of the week is Monday");
+ }
+ else if (dayOfWeek == 3) {
+ System.out.println("Day of the week is Tuesday");
+ }
+ else if (dayOfWeek == 4) {
+ System.out.println("Day of the week is Wednesday");
+ }
+ else if (dayOfWeek == 5) {
+ System.out.println("Day of the week is Thursday");
+ }
+ else if (dayOfWeek == 6) {
+ System.out.println("Day of the week is Friday");
+ }
+ }
+}
diff --git a/Exam1Practice_CalebFontenot/src/main/java/com/calebfontenot/exam1_calebfontenot/Exam1_CalebFontenot.java b/Exam1Practice_CalebFontenot/src/main/java/com/calebfontenot/exam1_calebfontenot/Exam1_CalebFontenot.java
new file mode 100755
index 0000000..f57403a
--- /dev/null
+++ b/Exam1Practice_CalebFontenot/src/main/java/com/calebfontenot/exam1_calebfontenot/Exam1_CalebFontenot.java
@@ -0,0 +1,17 @@
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Project/Maven2/JavaApp/src/main/java/${packagePath}/${mainClassName}.java to edit this template
+ */
+
+package com.calebfontenot.exam1_calebfontenot;
+
+/**
+ *
+ * @author ar114
+ */
+public class Exam1_CalebFontenot {
+
+ public static void main(String[] args) {
+ System.out.println("Hello World!");
+ }
+}
diff --git a/Exam1Practice_CalebFontenot/src/main/java/com/calebfontenot/exam1_calebfontenot/RandomMonth.java b/Exam1Practice_CalebFontenot/src/main/java/com/calebfontenot/exam1_calebfontenot/RandomMonth.java
new file mode 100755
index 0000000..c364d16
--- /dev/null
+++ b/Exam1Practice_CalebFontenot/src/main/java/com/calebfontenot/exam1_calebfontenot/RandomMonth.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 com.calebfontenot.exam1_calebfontenot;
+
+/**
+ *
+ * @author ar114
+ */
+public class RandomMonth {
+
+ public static void main(String[] args) {
+ int number = (int) (Math.random() * 12 + 1);
+ System.out.println("Random generated number is: " + number);
+ switch (number) {
+ case 1:
+ System.out.println("Month is January"); break;
+ case 2:
+ System.out.println("Month is February"); break;
+ case 3:
+ System.out.println("Month is March"); break;
+ case 4:
+ System.out.println("Month is April"); break;
+ case 5:
+ System.out.println("Month is May"); break;
+ case 6:
+ System.out.println("Month is June"); break;
+ case 7:
+ System.out.println("Month is July"); break;
+ case 8:
+ System.out.println("Month is August"); break;
+ case 9:
+ System.out.println("Month is September"); break;
+ case 10:
+ System.out.println("Month is October"); break;
+ case 11:
+ System.out.println("Month is November"); break;
+ case 12:
+ System.out.println("Month is December"); break;
+ }
+ }
+}
diff --git a/Exam1Practice_CalebFontenot/src/main/java/com/calebfontenot/exam1_calebfontenot/TrianglePerimeter.java b/Exam1Practice_CalebFontenot/src/main/java/com/calebfontenot/exam1_calebfontenot/TrianglePerimeter.java
new file mode 100755
index 0000000..7ad2e83
--- /dev/null
+++ b/Exam1Practice_CalebFontenot/src/main/java/com/calebfontenot/exam1_calebfontenot/TrianglePerimeter.java
@@ -0,0 +1,34 @@
+/*
+ * 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.exam1_calebfontenot;
+
+import java.util.Scanner;
+
+/**
+ *
+ * @author ar114
+ */
+public class TrianglePerimeter {
+ public static void main(String[] args) {
+ // Create scanner
+ Scanner input = new Scanner(System.in);
+
+ // Define variables
+ int triEdge1, triEdge2, triEdge3;
+
+ // Prompt for input
+ System.out.print("Enter 3 edges for a triangle: ");
+ triEdge1 = input.nextInt();
+ triEdge2 = input.nextInt();
+ triEdge3 = input.nextInt();
+
+ // Compute and print output
+ System.out.println(((triEdge1 + triEdge2) > triEdge3) ||
+ ((triEdge1 + triEdge3) > triEdge2) ||
+ ((triEdge2 + triEdge3) > triEdge1) ?
+ "Input is valid" : "Invalid Input");
+
+ }
+}
diff --git a/ExamPractice/exam1Programming-2-1.pdf b/ExamPractice/exam1Programming-2-1.pdf
new file mode 100644
index 0000000..08327e8
Binary files /dev/null and b/ExamPractice/exam1Programming-2-1.pdf differ
diff --git a/ExamPractice/pom.xml b/ExamPractice/pom.xml
new file mode 100644
index 0000000..da04d2d
--- /dev/null
+++ b/ExamPractice/pom.xml
@@ -0,0 +1,14 @@
+
+
+ 4.0.0
+ com.calebfontenot
+ ExamPractice
+ 1.0-SNAPSHOT
+ jar
+
+ UTF-8
+ 18
+ 18
+ com.calebfontenot.exampractice.ExamPractice
+
+
\ No newline at end of file
diff --git a/ExamPractice/src/main/java/com/calebfontenot/exampractice/AscendingOrderOf3.java b/ExamPractice/src/main/java/com/calebfontenot/exampractice/AscendingOrderOf3.java
new file mode 100644
index 0000000..dd7c300
--- /dev/null
+++ b/ExamPractice/src/main/java/com/calebfontenot/exampractice/AscendingOrderOf3.java
@@ -0,0 +1,68 @@
+/*
+ * 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.exampractice;
+
+import java.util.Scanner;
+
+/**
+ *
+ * @author caleb
+ */
+public class AscendingOrderOf3 {
+ public static void main(String[] args)
+ {
+ // Create scanner
+ Scanner input = new Scanner(System.in);
+
+ //Define variables
+ int x, y, z;
+ int firstNumber=-1, secondNumber=-1, thirdNumber=-1;
+ // Prompt for input
+ System.out.print("Enter a 3 integers: ");
+ x = input.nextInt();
+ y = input.nextInt();
+ z = input.nextInt();
+
+ // Compute!
+ if (x <= y && x <= z) {// Check if x is greater than y && y is greater than z
+ System.out.println("1st if condition met");
+ firstNumber = x;
+ if (y <= z) {
+ secondNumber = y;
+ thirdNumber = z;
+ }
+ else {
+ secondNumber = z;
+ thirdNumber = y;
+ }
+ }
+ if (y <= x && y <= z) {
+ System.out.println("2nd if condition met");
+ firstNumber = y;
+ if (x <= z) {
+ secondNumber = x;
+ thirdNumber = z;
+ }
+ else {
+ secondNumber = z;
+ thirdNumber = x;
+ }
+ }
+ if (z <= y && z <= x) {
+ System.out.println("3rd if condition met");
+ firstNumber = z;
+ if (z <= x) {
+ secondNumber = y;
+ thirdNumber = x;
+ }
+ else {
+ secondNumber = x;
+ thirdNumber = y;
+ }
+ }
+ // Output
+ System.out.println(firstNumber + ", " + secondNumber + ", " + thirdNumber);
+ }
+}
diff --git a/ExamPractice/src/main/java/com/calebfontenot/exampractice/ExamPractice.java b/ExamPractice/src/main/java/com/calebfontenot/exampractice/ExamPractice.java
new file mode 100644
index 0000000..5a9aa75
--- /dev/null
+++ b/ExamPractice/src/main/java/com/calebfontenot/exampractice/ExamPractice.java
@@ -0,0 +1,23 @@
+/*
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
+ * Click nbfs://nbhost/SystemFileSystem/Templates/Project/Maven2/JavaApp/src/main/java/${packagePath}/${mainClassName}.java to edit this template
+ */
+package com.calebfontenot.exampractice;
+
+/**
+ *
+ * @author caleb
+ */
+public class ExamPractice {
+
+ public static void main(String[] args)
+ {
+ int numberPicker;
+ char letter;
+ while (true) {
+ numberPicker = (int) (Math.random() * 0x7F);
+ letter = (char) numberPicker;
+ System.out.println(letter);
+ }
+ }
+}
diff --git a/mavenproject1/src/main/java/com/mycompany/mavenproject1/LogicalExpression.java b/mavenproject1/src/main/java/com/mycompany/mavenproject1/LogicalExpression.java
index 02c8ab9..df5ca94 100644
--- a/mavenproject1/src/main/java/com/mycompany/mavenproject1/LogicalExpression.java
+++ b/mavenproject1/src/main/java/com/mycompany/mavenproject1/LogicalExpression.java
@@ -21,7 +21,7 @@ public class LogicalExpression {
System.out.print(x < 100 && x > 1 || (x < 0)); //correct
System.out.print(": " + x);
- if (x >= 150 && hasCycled == false) {
+ if (x >= 150 & hasCycled == false) {
hasCycled = true;
} else if (x <= -10) {
hasCycled = false;
diff --git a/mavenproject1/src/main/java/com/mycompany/mavenproject1/Mavenproject1.java b/mavenproject1/src/main/java/com/mycompany/mavenproject1/Mavenproject1.java
index 6e3c79d..6eff504 100644
--- a/mavenproject1/src/main/java/com/mycompany/mavenproject1/Mavenproject1.java
+++ b/mavenproject1/src/main/java/com/mycompany/mavenproject1/Mavenproject1.java
@@ -2,7 +2,6 @@
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Project/Maven2/JavaApp/src/main/java/${packagePath}/${mainClassName}.java to edit this template
*/
-
package com.mycompany.mavenproject1;
/**
@@ -11,7 +10,16 @@ package com.mycompany.mavenproject1;
*/
public class Mavenproject1 {
- public static void main(String[] args) {
- System.out.println(0 ^ 0);
+ public static void main(String[] args)
+ {
+ int x = 10;
+ int y = 1;
+
+ System.out.println(x ^ y); // result is 11
+ System.out.println(x & y); //result is 0
+ System.out.println(x | y); // result is 11
+ System.out.println(0 ^ 1); // result is 1
+ System.out.println(1 ^ 1); // result is 0
+ System.out.println(0 ^ 0); // result is 11
}
}
diff --git a/mavenproject1/target/classes/com/mycompany/mavenproject1/ByteOverFlow.class b/mavenproject1/target/classes/com/mycompany/mavenproject1/ByteOverFlow.class
index 221fb7d..df4dbb6 100644
Binary files a/mavenproject1/target/classes/com/mycompany/mavenproject1/ByteOverFlow.class and b/mavenproject1/target/classes/com/mycompany/mavenproject1/ByteOverFlow.class differ
diff --git a/mavenproject1/target/classes/com/mycompany/mavenproject1/LogicalExpression.class b/mavenproject1/target/classes/com/mycompany/mavenproject1/LogicalExpression.class
index f5547ce..e30795e 100644
Binary files a/mavenproject1/target/classes/com/mycompany/mavenproject1/LogicalExpression.class and b/mavenproject1/target/classes/com/mycompany/mavenproject1/LogicalExpression.class differ
diff --git a/mavenproject1/target/classes/com/mycompany/mavenproject1/Mavenproject1.class b/mavenproject1/target/classes/com/mycompany/mavenproject1/Mavenproject1.class
index 241d677..00555c6 100644
Binary files a/mavenproject1/target/classes/com/mycompany/mavenproject1/Mavenproject1.class and b/mavenproject1/target/classes/com/mycompany/mavenproject1/Mavenproject1.class differ
diff --git a/mavenproject1/target/classes/com/mycompany/mavenproject1/NotDemo.class b/mavenproject1/target/classes/com/mycompany/mavenproject1/NotDemo.class
index 2beb0c7..acfb62c 100644
Binary files a/mavenproject1/target/classes/com/mycompany/mavenproject1/NotDemo.class and b/mavenproject1/target/classes/com/mycompany/mavenproject1/NotDemo.class differ
diff --git a/mavenproject1/target/classes/com/mycompany/mavenproject1/PrePostIncrement.class b/mavenproject1/target/classes/com/mycompany/mavenproject1/PrePostIncrement.class
index 36a5746..aabdfe0 100644
Binary files a/mavenproject1/target/classes/com/mycompany/mavenproject1/PrePostIncrement.class and b/mavenproject1/target/classes/com/mycompany/mavenproject1/PrePostIncrement.class differ
diff --git a/mavenproject1/target/maven-archiver/pom.properties b/mavenproject1/target/maven-archiver/pom.properties
new file mode 100644
index 0000000..534a1d2
--- /dev/null
+++ b/mavenproject1/target/maven-archiver/pom.properties
@@ -0,0 +1,5 @@
+#Generated by Maven
+#Tue Sep 27 12:01:14 CDT 2022
+artifactId=mavenproject1
+groupId=com.mycompany
+version=1.0-SNAPSHOT
diff --git a/mavenproject1/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/mavenproject1/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
index 89a45b1..4fbea4a 100644
--- a/mavenproject1/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
+++ b/mavenproject1/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
@@ -1,2 +1,5 @@
-/home/caleb/NetBeansProjects/mavenproject1/src/main/java/com/mycompany/mavenproject1/Mavenproject1.java
-/home/caleb/NetBeansProjects/mavenproject1/src/main/java/com/mycompany/mavenproject1/ByteOverFlow.java
+/home/caleb/NetBeansProjects/ADSV Java/mavenproject1/src/main/java/com/mycompany/mavenproject1/LogicalExpression.java
+/home/caleb/NetBeansProjects/ADSV Java/mavenproject1/src/main/java/com/mycompany/mavenproject1/ByteOverFlow.java
+/home/caleb/NetBeansProjects/ADSV Java/mavenproject1/src/main/java/com/mycompany/mavenproject1/PrePostIncrement.java
+/home/caleb/NetBeansProjects/ADSV Java/mavenproject1/src/main/java/com/mycompany/mavenproject1/Mavenproject1.java
+/home/caleb/NetBeansProjects/ADSV Java/mavenproject1/src/main/java/com/mycompany/mavenproject1/NotDemo.java
diff --git a/mavenproject1/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst b/mavenproject1/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst
new file mode 100644
index 0000000..e69de29
diff --git a/mavenproject1/target/mavenproject1-1.0-SNAPSHOT.jar b/mavenproject1/target/mavenproject1-1.0-SNAPSHOT.jar
new file mode 100644
index 0000000..cfdb37d
Binary files /dev/null and b/mavenproject1/target/mavenproject1-1.0-SNAPSHOT.jar differ