diff --git a/ZIPs/Lab 2/ComputeExpression.html b/ZIPs/Lab 2/ComputeExpression.html new file mode 100644 index 0000000..dff6f03 --- /dev/null +++ b/ZIPs/Lab 2/ComputeExpression.html @@ -0,0 +1,44 @@ + + + +ComputeExpression.java + + + + +
/home/caleb/NetBeansProjects/ADSV Java/Lab2CalebFontenot/lab2CalebFontenot/src/main/java/ComputeExpression.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
+ */
+
+/**
+ *
+ * @author caleb
+ */
+public class ComputeExpression { 
+  public static void main(String[] args) { 
+    System.out.print("(10.5 + 2 * 3) / (45 – 3.5) = ");
+    System.out.println((10.5 + 2 * 3) / (45 - 3.5));
+  }
+}
+
+
+
+ diff --git a/ZIPs/Lab 2/ShowLogicErrors.html b/ZIPs/Lab 2/ShowLogicErrors.html new file mode 100644 index 0000000..a47ae14 --- /dev/null +++ b/ZIPs/Lab 2/ShowLogicErrors.html @@ -0,0 +1,43 @@ + + + +ShowLogicErrors.java + + + + +
/home/caleb/NetBeansProjects/ADSV Java/Lab2CalebFontenot/lab2CalebFontenot/src/main/java/ShowLogicErrors.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
+ */
+
+/**
+ *
+ * @author caleb
+ */
+public class ShowLogicErrors {
+  public static void main(String[] args) {
+    System.out.print("Celsius 35 is Fahrenheit degree ");
+    System.out.println((9.0 / 5) * 35 + 32);
+  }
+}
+
+
+ diff --git a/ZIPs/Lab 2/ShowRuntimeErrors.html b/ZIPs/Lab 2/ShowRuntimeErrors.html new file mode 100644 index 0000000..29bbdde --- /dev/null +++ b/ZIPs/Lab 2/ShowRuntimeErrors.html @@ -0,0 +1,42 @@ + + + +ShowRuntimeErrors.java + + + + +
/home/caleb/NetBeansProjects/ADSV Java/Lab2CalebFontenot/lab2CalebFontenot/src/main/java/ShowRuntimeErrors.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
+ */
+
+/**
+ *
+ * @author caleb
+ */
+// ShowRuntimeErrors.java: Program contains runtime errors
+public class ShowRuntimeErrors {
+  public static void main(String[] args) {
+    System.out.println(1 / 0);
+  }
+}
+
+
+ diff --git a/ZIPs/Lab 2/ShowSyntaxErrors.html b/ZIPs/Lab 2/ShowSyntaxErrors.html new file mode 100644 index 0000000..4930ec8 --- /dev/null +++ b/ZIPs/Lab 2/ShowSyntaxErrors.html @@ -0,0 +1,43 @@ + + + +ShowSyntaxErrors.java + + + + +
/home/caleb/NetBeansProjects/ADSV Java/Lab2CalebFontenot/lab2CalebFontenot/src/main/java/ShowSyntaxErrors.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
+ */
+
+/**
+ *
+ * @author caleb
+ */
+public class ShowSyntaxErrors {
+
+    public static void main(String[] args)
+    {
+        System.out.println("Welcome to Java");
+  }
+}
+
+
+ diff --git a/ZIPs/Lab 2/WelvomeWithThreeMessages.html b/ZIPs/Lab 2/WelvomeWithThreeMessages.html new file mode 100644 index 0000000..d2b5b7c --- /dev/null +++ b/ZIPs/Lab 2/WelvomeWithThreeMessages.html @@ -0,0 +1,44 @@ + + + +WelcomeWithThreeMessages.java + + + + +
/home/caleb/NetBeansProjects/ADSV Java/Lab2CalebFontenot/lab2CalebFontenot/src/main/java/WelcomeWithThreeMessages.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
+ */
+
+/**
+ *
+ * @author caleb
+ */
+public class WelcomeWithThreeMessages {
+    public static void main(String[] args)
+    {
+        System.out.println("Programming is fun!");
+        System.out.println("Fundamentals First");
+        System.out.println("Problem Driven");
+    }
+}
+
+
+ diff --git a/ZIPs/Lab 2/lab2CalebFontenot.zip b/ZIPs/Lab 2/lab2CalebFontenot.zip new file mode 100644 index 0000000..3dd1bfb Binary files /dev/null and b/ZIPs/Lab 2/lab2CalebFontenot.zip differ diff --git a/ZIPs/Lab 3-1/.~lock.Lab3-f22.docx# b/ZIPs/Lab 3-1/.~lock.Lab3-f22.docx# new file mode 100644 index 0000000..8e20436 --- /dev/null +++ b/ZIPs/Lab 3-1/.~lock.Lab3-f22.docx# @@ -0,0 +1 @@ +,caleb,caleb-gaming-laptop-archlinux,24.08.2022 09:17,file:///home/caleb/.config/libreoffice/4; \ No newline at end of file diff --git a/ZIPs/Lab 3-1/Lab3-f22.docx b/ZIPs/Lab 3-1/Lab3-f22.docx new file mode 100644 index 0000000..66cb2c2 Binary files /dev/null and b/ZIPs/Lab 3-1/Lab3-f22.docx differ diff --git a/ZIPs/Lab 3-1/Lab3-f22.odt b/ZIPs/Lab 3-1/Lab3-f22.odt new file mode 100644 index 0000000..80bd697 Binary files /dev/null and b/ZIPs/Lab 3-1/Lab3-f22.odt differ diff --git a/ZIPs/Lab 3-1/Lab3.html b/ZIPs/Lab 3-1/Lab3.html new file mode 100644 index 0000000..1b22148 --- /dev/null +++ b/ZIPs/Lab 3-1/Lab3.html @@ -0,0 +1,70 @@ + + + +Lab3.java + + + + +
/home/caleb/NetBeansProjects/ADSV Java/Lab3_1_CalebFontenot/src/main/java/com/calebfontenot/lab3_1_calebfontenot/Lab3.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.lab3_1_calebfontenot;
+import java.util.Scanner;
+/**
+ *
+ * @author caleb
+ */
+public class Lab3 {
+    public static void main(String[] args)
+    {
+        // Create a scanner object
+        Scanner input = new Scanner(System.in);
+        
+        // Prompt for hight in feet
+        System.out.print("Enter the height (feet): ");
+        double height;
+        height = input.nextDouble();
+        
+        // Prompt for width in feet
+        System.out.print("Enter the width (feet):");
+        double width;
+        width = input.nextDouble();
+        
+        // Calculate the area
+        double area;
+        area = height * width;
+        // Print area calculated
+        System.out.println("Calculated area is "+area);
+        //create constants
+        final double GALLONS_PER_SQUARE_FEET = 150.0;
+        
+        // calculate the gallons
+        double gallons;
+        gallons = area/GALLONS_PER_SQUARE_FEET;
+        //calculate the number of gallons needed to paint the wall  
+        System.out.println("The amount of paint is " + gallons +" gallons.");
+        
+    }
+}
+
+
+ diff --git a/ZIPs/Lab 3-1/Lab3_1_CalebFontenot.zip b/ZIPs/Lab 3-1/Lab3_1_CalebFontenot.zip new file mode 100644 index 0000000..871941d Binary files /dev/null and b/ZIPs/Lab 3-1/Lab3_1_CalebFontenot.zip differ diff --git a/ZIPs/Lab 3-1/MilesToKilometers.html b/ZIPs/Lab 3-1/MilesToKilometers.html new file mode 100644 index 0000000..14c77df --- /dev/null +++ b/ZIPs/Lab 3-1/MilesToKilometers.html @@ -0,0 +1,57 @@ + + + +MilesToKilometers.java + + + + +
/home/caleb/NetBeansProjects/ADSV Java/Lab3_1_CalebFontenot/src/main/java/com/calebfontenot/lab3_1_calebfontenot/MilesToKilometers.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.lab3_1_calebfontenot;
+
+import java.util.Scanner;
+
+/**
+ *
+ * @author caleb
+ */
+public class MilesToKilometers {
+    public static void main(String[] args)
+    {
+        double miles;
+        double km;
+        Scanner scanner = new Scanner(System.in);
+        
+        //> 1. Prompt the user to enter the number of miles
+        System.out.println("Please enter miles to convert into kilometers");
+        //> 2. Read the miles and store it into a variable
+        miles = scanner.nextDouble();
+        //> 3. Calculate the KM from the entered miles
+        km = miles * 1.67;
+        //> 4. Display the result
+        System.out.println("You entered "+miles+" miles which is "+km+" kilometers");
+    }
+}
+
+
+ diff --git a/ZIPs/Lab 3-1/RunwayLength Table.docx b/ZIPs/Lab 3-1/RunwayLength Table.docx new file mode 100644 index 0000000..2315234 Binary files /dev/null and b/ZIPs/Lab 3-1/RunwayLength Table.docx differ diff --git a/ZIPs/Lab 3-1/RunwayLength.html b/ZIPs/Lab 3-1/RunwayLength.html new file mode 100644 index 0000000..60463e6 --- /dev/null +++ b/ZIPs/Lab 3-1/RunwayLength.html @@ -0,0 +1,67 @@ + + + +RunwayLength.java + + + + +
/home/caleb/NetBeansProjects/ADSV Java/Lab3_1_CalebFontenot/src/main/java/com/calebfontenot/lab3_1_calebfontenot/RunwayLength.java
+
+package com.calebfontenot.lab3_1_calebfontenot;
+
+import java.util.Scanner;
+
+/*
+ * 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
+ */
+
+/**
+ *
+ * @author caleb
+ */
+public class RunwayLength {
+    public static void main(String[] args)
+    {
+        
+        //Define data objects
+        double length;
+        double acceleration;
+        double velocity;
+        
+        //Create scanner
+        Scanner input = new Scanner(System.in);
+        
+        //Prompt for input
+        System.out.print("Enter velocity: ");
+        velocity = input.nextDouble();
+        System.out.print("Enter acceleration: ");
+        acceleration = input.nextDouble();
+        
+        //Calculate
+        length = Math.pow(velocity, 2) / (2 * acceleration);
+        
+        //Print calculation
+        System.out.println("The minimum runway length for this airplane is "+length);
+    }
+}
+
+
+ diff --git a/ZIPs/Lab 3-1/Test Table.docx b/ZIPs/Lab 3-1/Test Table.docx new file mode 100644 index 0000000..49b29c9 Binary files /dev/null and b/ZIPs/Lab 3-1/Test Table.docx differ diff --git a/ZIPs/Lab 3/Exercise01_04.html b/ZIPs/Lab 3/Exercise01_04.html new file mode 100644 index 0000000..5cf75c8 --- /dev/null +++ b/ZIPs/Lab 3/Exercise01_04.html @@ -0,0 +1,47 @@ + + + +Exercise01_04.java + + + + +
/home/caleb/NetBeansProjects/ADSV Java/Lab3CalebFontenot/src/main/java/Exercise01_04.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
+ */
+
+/**
+ *
+ * @author caleb
+ */
+public class Exercise01_04 {
+
+    public static void main(String[] args)
+    {
+        System.out.println("a a^2 a^3");
+        System.out.println("1 1 1");
+        System.out.println("2 4 8");
+        System.out.println("3 9 27");
+        System.out.println("4 16 64");
+    }
+}
+
+
+ diff --git a/ZIPs/Lab 3/Exercise01_06.html b/ZIPs/Lab 3/Exercise01_06.html new file mode 100644 index 0000000..ca4330a --- /dev/null +++ b/ZIPs/Lab 3/Exercise01_06.html @@ -0,0 +1,43 @@ + + + +Exercise01_06.java + + + + +
/home/caleb/NetBeansProjects/ADSV Java/Lab3CalebFontenot/src/main/java/Exercise01_06.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
+ */
+
+/**
+ *
+ * @author caleb
+ */
+public class Exercise01_06 {
+
+    public static void main(String[] args)
+    {
+        System.out.println(1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9);
+    }
+}
+
+
+ diff --git a/ZIPs/Lab 3/Exercise01_07.html b/ZIPs/Lab 3/Exercise01_07.html new file mode 100644 index 0000000..b0af5fd --- /dev/null +++ b/ZIPs/Lab 3/Exercise01_07.html @@ -0,0 +1,43 @@ + + + +Exercise01_07.java + + + + +
/home/caleb/NetBeansProjects/ADSV Java/Lab3CalebFontenot/src/main/java/Exercise01_07.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
+ */
+
+/**
+ *
+ * @author caleb
+ */
+public class Exercise01_07 {
+    public static void main(String[] args)
+    {
+        System.out.println(4 * (1.0 - (1.0/3) + (1.0/5) - (1.0/7) + (1.0/9) - (1.0/11)));
+        System.out.println(4 * (1.0 - (1.0/3) + (1.0/5) - (1.0/7) + (1.0/9) - (1.0/11) + (1.0/13)));
+    }
+}
+
+
+ diff --git a/ZIPs/Lab 3/Exercise01_11.html b/ZIPs/Lab 3/Exercise01_11.html new file mode 100644 index 0000000..c15cf6c --- /dev/null +++ b/ZIPs/Lab 3/Exercise01_11.html @@ -0,0 +1,52 @@ + + + +Exercise01_11.java + + + + +
/home/caleb/NetBeansProjects/ADSV Java/Lab3CalebFontenot/src/main/java/Exercise01_11.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
+ */
+
+/**
+ *
+ * @author caleb
+ */
+public class Exercise01_11 {
+
+    public static void main(String[] args)
+    {
+        double Population = 312032486.0;
+        for (int i = 1; i <= 5; i++) {
+            //One birth every 7 seconds
+            Population += ((60 * 60 * 24 * 365) / 7.0);
+            //One death every 13 seconds
+            Population -= ((60 * 60 * 24 * 365) / 13.0);
+            //One new immigrant every 45 seconds
+            Population += ((60 * 60 * 24 * 365) / 45.0);
+            System.out.println(Population);
+        }
+    }
+}
+
+
+ diff --git a/ZIPs/Lab 3/Lab3CalebFontenot.zip b/ZIPs/Lab 3/Lab3CalebFontenot.zip new file mode 100644 index 0000000..ac933fc Binary files /dev/null and b/ZIPs/Lab 3/Lab3CalebFontenot.zip differ diff --git a/ZIPs/Lab2CalebFontenot.zip b/ZIPs/Lab2CalebFontenot.zip new file mode 100644 index 0000000..c5c0c5d Binary files /dev/null and b/ZIPs/Lab2CalebFontenot.zip differ diff --git a/ZIPs/Lab3-3/Lab3-3CalebFontenot.zip b/ZIPs/Lab3-3/Lab3-3CalebFontenot.zip new file mode 100644 index 0000000..a09be62 Binary files /dev/null and b/ZIPs/Lab3-3/Lab3-3CalebFontenot.zip differ diff --git a/ZIPs/Lab3-3/SalesTax.html b/ZIPs/Lab3-3/SalesTax.html new file mode 100644 index 0000000..9884370 --- /dev/null +++ b/ZIPs/Lab3-3/SalesTax.html @@ -0,0 +1,52 @@ + + + +SalesTax.java + + + + +
/home/caleb/NetBeansProjects/ADSV Java/Lab4_1/src/main/java/com/calebfontenot/lab4_1/SalesTax.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.lab4_1;
+
+/**
+ *
+ * @author caleb
+ */
+import java.util.Scanner;
+
+public class SalesTax {
+  public static void main(String[] args) {
+    Scanner input = new Scanner(System.in);
+
+    System.out.print("Enter purchase amount: ");
+    double purchaseAmount = input.nextDouble();
+    
+    double tax = purchaseAmount * 0.06;
+    System.out.println("Sales tax is " + (int)(tax * 100) / 100.0);
+  }
+}
+
+
+
+ diff --git a/ZIPs/Lab4/Debug.html b/ZIPs/Lab4/Debug.html new file mode 100644 index 0000000..6f94b17 --- /dev/null +++ b/ZIPs/Lab4/Debug.html @@ -0,0 +1,45 @@ + + + +Debug1.java + + + + +
/home/caleb/NetBeansProjects/ADSV Java/lab4_CalebFontenot/src/main/java/com/calebfontenot/lab4_calebfontenot/Debug1.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.lab4_calebfontenot;
+
+/**
+ *
+ * @author caleb
+ */
+public class Debug1 {
+    public static void main(String[] args)
+    {
+        int i = 1;
+        int j = i * i * i;
+        System.out.println( j );
+    }
+}
+
+
+ diff --git a/ZIPs/Lab4/Debug2.html b/ZIPs/Lab4/Debug2.html new file mode 100644 index 0000000..0457c3e --- /dev/null +++ b/ZIPs/Lab4/Debug2.html @@ -0,0 +1,46 @@ + + + +Debug2.java + + + + +
/home/caleb/NetBeansProjects/ADSV Java/lab4_CalebFontenot/src/main/java/com/calebfontenot/lab4_calebfontenot/Debug2.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.lab4_calebfontenot;
+
+/**
+ *
+ * @author caleb
+ */
+public class Debug2 {
+    public static void main(String[] args)
+    {
+        
+        int i = 9;
+        int j = (int)((5.0 / 6) * (i * 4));
+        System.out.println(j);
+    }
+}
+
+
+ diff --git a/ZIPs/Lab4/Debug3.html b/ZIPs/Lab4/Debug3.html new file mode 100644 index 0000000..b1f7f7d --- /dev/null +++ b/ZIPs/Lab4/Debug3.html @@ -0,0 +1,43 @@ + + + +Debug3.java + + + + +
/home/caleb/NetBeansProjects/ADSV Java/lab4_CalebFontenot/src/main/java/com/calebfontenot/lab4_calebfontenot/Debug3.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.lab4_calebfontenot;
+
+/**
+ *
+ * @author caleb
+ */
+public class Debug3 {
+    public static void main(String[] args)
+    {
+        System.out.println((long)2147483647 + 1);
+    }
+}
+
+
+ diff --git a/ZIPs/Lab4/Debug5.html b/ZIPs/Lab4/Debug5.html new file mode 100644 index 0000000..e5406be --- /dev/null +++ b/ZIPs/Lab4/Debug5.html @@ -0,0 +1,44 @@ + + + +Debug5.java + + + + +
/home/caleb/NetBeansProjects/ADSV Java/lab4_CalebFontenot/src/main/java/com/calebfontenot/lab4_calebfontenot/Debug5.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.lab4_calebfontenot;
+
+/**
+ *
+ * @author caleb
+ */
+public class Debug5 {
+    public static void main(String[] args)
+    {
+        System.out.println("1 + 2 is "+ (1 + 2));
+    }
+}
+
+
+ diff --git a/ZIPs/Lab4/Lab4_CalebFontenot.html b/ZIPs/Lab4/Lab4_CalebFontenot.html new file mode 100644 index 0000000..6693fe6 --- /dev/null +++ b/ZIPs/Lab4/Lab4_CalebFontenot.html @@ -0,0 +1,61 @@ + + + +Lab4_CalebFontenot.java + + + + +
/home/caleb/NetBeansProjects/ADSV Java/lab4_CalebFontenot/src/main/java/com/calebfontenot/lab4_calebfontenot/Lab4_CalebFontenot.java
+
+/*
+ * 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.lab4_calebfontenot;
+
+import java.util.Scanner;
+
+/**
+ *
+ * @author caleb
+ */
+public class Lab4_CalebFontenot {
+
+    public static void main(String[] args) {
+        // Setup Scanner;
+        Scanner input = new Scanner(System.in);
+        
+        System.out.println("Enter i, j, x, and y: ");
+        int i = input.nextInt();
+        int j = input.nextInt();
+        double x = input.nextDouble();
+        double y = input.nextDouble();
+        //int i = 11,
+        //    j = 22;
+        //double x = 11.11,
+        //       y = 22.22;
+        
+        // Changed addition to division
+        System.out.println("\n" + i + " / " + j + " = " + (i / j));
+        System.out.println("\n" + x + " / " + y + " = " + (x / y));
+    }
+}
+
+
+ diff --git a/ZIPs/Lab4/payroll.html b/ZIPs/Lab4/payroll.html new file mode 100644 index 0000000..53dce73 --- /dev/null +++ b/ZIPs/Lab4/payroll.html @@ -0,0 +1,92 @@ + + + +payroll.java + + + + +
/home/caleb/NetBeansProjects/ADSV Java/lab4_CalebFontenot/src/main/java/com/calebfontenot/lab4_calebfontenot/payroll.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.lab4_calebfontenot;
+
+import java.text.DecimalFormat;
+import java.util.Scanner;
+
+/**
+ *
+ * @author caleb
+ */
+public class payroll {
+
+    public static void main(String[] args)
+    {
+        // Create Scanner
+        Scanner input = new Scanner(System.in);
+
+        // Define vars
+        String employeeName;
+        double hoursWorked;
+        double hourlyPayRate;
+        double federalTaxWithholdingRate;
+        double stateTaxWithholdingRate;
+        double grossPay;        
+        double federalWithholding;
+        double stateWithholding;
+        double totalDeduction;
+        
+        // Prompt for input
+        System.out.print("Enter employee's name: ");
+        employeeName = input.next();
+        System.out.print("Enter the number of hours worked in a week: ");
+        hoursWorked = input.nextDouble();
+        System.out.print("Enter the hourly pay rate: $");
+        hourlyPayRate = input.nextDouble();
+        System.out.print("Enter the federal tax witholding rate (as a decimal, please!): ");
+        federalTaxWithholdingRate = input.nextDouble();
+        System.out.print("Enter the state tax withholding rate (as a decimal, please!): ");
+        stateTaxWithholdingRate = input.nextDouble();
+        System.out.println(""); //empty space
+        
+        // Setup Decimal fomatting
+        DecimalFormat df = new DecimalFormat("#0.00");
+        
+        // Calculate
+        grossPay = (hoursWorked * hourlyPayRate);
+        federalWithholding = (grossPay * federalTaxWithholdingRate);
+        stateWithholding = (grossPay * stateTaxWithholdingRate);
+        totalDeduction = (grossPay - (federalWithholding + stateWithholding));
+                
+        // Print output
+        System.out.println("Employee Name: "+employeeName);
+        System.out.println("Hours Worked: "+hoursWorked);
+        System.out.println("Pay Rate: $"+ df.format(hourlyPayRate));
+        System.out.println("Gross Pay: $"+df.format(grossPay));
+        System.out.println("Deductions:");
+        System.out.println("\t"+"Federal Withholding ("+ (federalTaxWithholdingRate * 100.0)+"%):$"+df.format(federalWithholding));
+        System.out.println("\t"+"State Withholding ("+ (stateTaxWithholdingRate * 100.0)+"%):$"+df.format(stateWithholding));
+        System.out.println("Total Deduction: $"+df.format(totalDeduction));
+    }
+}
+
+
+ diff --git a/ZIPs/Lab4_CalebFontenot.zip b/ZIPs/Lab4_CalebFontenot.zip new file mode 100644 index 0000000..242698a Binary files /dev/null and b/ZIPs/Lab4_CalebFontenot.zip differ diff --git a/ZIPs/Lab5/Lab5_CalebFontenot.zip b/ZIPs/Lab5/Lab5_CalebFontenot.zip new file mode 100644 index 0000000..a3ce2c9 Binary files /dev/null and b/ZIPs/Lab5/Lab5_CalebFontenot.zip differ diff --git a/ZIPs/Lab5/Operators.html b/ZIPs/Lab5/Operators.html new file mode 100644 index 0000000..dcda694 --- /dev/null +++ b/ZIPs/Lab5/Operators.html @@ -0,0 +1,76 @@ + + + +Operators.java + + + + +
/home/caleb/NetBeansProjects/ADSV Java/lab5_CalebFontenot/src/main/java/com/calebfontenot/lab5_calebfontenot/Operators.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.lab5_calebfontenot;
+
+/**
+ *
+ * @author caleb
+ */
+public class Operators {
+    public static void main(String[] args)
+    {
+        int x = 8; int y = 15; double d = 2;
+        
+        //1. Increment x by 2;
+            //add code here
+        x += 2;
+            
+        //2. Increment y by 5 using the += operator
+            //add code here
+        y += 5;
+            
+       //3. Increment d by 1 using the ++ operator
+            //add code here
+       d++;
+       
+       //4. Modify the expression below to print z1 = 1.5 and not 0.0
+       double z1 = ((double) x /(double) y ) * d++;
+       System.out.println("z1: " + z1 );
+       
+       //5. Modify the expresion below the print z2 = 2.5 and not 0.0
+       double z2 = ((double) x /(double) y ) * ++d;
+       System.out.println("z2: " + z2 );
+        
+       /* 6. Declare a variable z3 of type double and modify the 
+       right hand side of the expression you built in step 5 for the
+       expression to evaluate 2.0.
+       Assign the evaluation to varible z3
+       */
+       double z3 = ((double) x /(double) y * (d - 1));
+        //add code here
+        System.out.println("z3: "+ z3 );
+        
+        System.out.println("x=" + x + " y=" + y + " d=" + d +
+                " z1="+ z1 + " z2=" +z2 + " z3=" +z3);
+    }
+}
+
+
+ diff --git a/ZIPs/Lab5/Swap.html b/ZIPs/Lab5/Swap.html new file mode 100644 index 0000000..0f935eb --- /dev/null +++ b/ZIPs/Lab5/Swap.html @@ -0,0 +1,64 @@ + + + +Swap.java + + + + +
/home/caleb/NetBeansProjects/ADSV Java/lab5_CalebFontenot/src/main/java/com/calebfontenot/lab5_calebfontenot/Swap.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.lab5_calebfontenot;
+
+import java.util.Scanner;
+
+/**
+ *
+ * @author caleb
+ */
+public class Swap {
+    public static void main(String[] args)
+    {
+        // Create scanner
+        Scanner input = new Scanner(System.in);
+        
+        // Define vars
+        double base,
+               power,
+               output;
+        
+        // Prompt for input
+        System.out.println("Enter the base to calculate: ");
+        base = input.nextDouble();
+        System.out.println("Enter the power to calculate: ");
+        power = input.nextDouble();
+        
+        // Calculate
+        output = Math.pow(base, power);
+        
+        // Print result
+        System.out.println(base+"^"+power+" = "+ output);
+    }
+}
+
+
+ diff --git a/ZIPs/Lab5/WhatsYourName.html b/ZIPs/Lab5/WhatsYourName.html new file mode 100644 index 0000000..f75f480 --- /dev/null +++ b/ZIPs/Lab5/WhatsYourName.html @@ -0,0 +1,59 @@ + + + +WhatsYourName.java + + + + +
/home/caleb/NetBeansProjects/ADSV Java/lab5_CalebFontenot/src/main/java/com/calebfontenot/lab5_calebfontenot/WhatsYourName.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.lab5_calebfontenot;
+
+import java.util.Scanner;
+
+/**
+ *
+ * @author caleb
+ */
+public class WhatsYourName {
+    public static void main(String[] args)
+    {
+        // Create Scanner
+        Scanner input = new Scanner(System.in);
+        
+        // Declare vars
+        String firstName,
+               lastName;
+        
+        // Prompt for input
+        System.out.print("What's your name? (Enter first and last) ");
+        firstName = input.next();
+        lastName = input.next();
+
+        // Print output
+        System.out.println(firstName + " " + lastName + " is a beautiful name!");
+
+    }
+}
+
+
+ diff --git a/ZIPs/Lab5/WhatsYourSSN.html b/ZIPs/Lab5/WhatsYourSSN.html new file mode 100644 index 0000000..dc2b19d --- /dev/null +++ b/ZIPs/Lab5/WhatsYourSSN.html @@ -0,0 +1,56 @@ + + + +WhatsYourSSN.java + + + + +
/home/caleb/NetBeansProjects/ADSV Java/lab5_CalebFontenot/src/main/java/com/calebfontenot/lab5_calebfontenot/WhatsYourSSN.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.lab5_calebfontenot;
+
+import java.util.Scanner;
+
+/**
+ *
+ * @author caleb
+ */
+public class WhatsYourSSN {
+    public static void main(String[] args)
+    {
+        // Create Scanner
+        Scanner input = new Scanner(System.in);
+        
+        // Declare vars
+        String ssn;
+        
+        // Prompt for input
+        System.out.print("What's your SSN? ");
+        ssn = input.next();
+
+        // Print output
+        System.out.println(ssn + " is your SSN.");
+    }
+}
+
+
+ diff --git a/ZIPs/LabClass_Sep6_CalebFontenot/ComputeTax.html b/ZIPs/LabClass_Sep6_CalebFontenot/ComputeTax.html new file mode 100644 index 0000000..570cde2 --- /dev/null +++ b/ZIPs/LabClass_Sep6_CalebFontenot/ComputeTax.html @@ -0,0 +1,97 @@ + + + +ComputeTax.java + + + + +
/home/caleb/NetBeansProjects/ADSV Java/LabClass_Sep6_CalebFontenot/src/main/java/com/calebfontenot/labclass_sep6_calebfontenot/ComputeTax.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.labclass_sep6_calebfontenot;
+
+/**
+ *
+ * @author caleb
+ */
+import java.util.Scanner;
+
+public class ComputeTax {
+
+    public static void main(String[] args)
+    {
+        // Create a Scanner
+        Scanner input = new Scanner(System.in);
+
+        // Prompt the user to enter filing status
+        System.out.print("(0-single filer, 1-married jointly or "
+                + "qualifying widow(er), 2-married separately, 3-head of "
+                + "household) Enter the filing status: ");
+
+        int status = input.nextInt();
+
+        // Prompt the user to enter taxable income
+        System.out.print("Enter the taxable income: ");
+        double income = input.nextDouble();
+
+        // Compute tax
+        double tax = 0;
+
+        if (status == 0) { // Compute tax for single filers
+            if (income <= 8350) {
+                tax = income * 0.10;
+            } else if (income <= 33950) {
+                tax = 8350 * 0.10 + (income - 8350) * 0.15;
+            } else if (income <= 82250) {
+                tax = 8350 * 0.10 + (33950 - 8350) * 0.15
+                        + (income - 33950) * 0.25;
+            } else if (income <= 171550) {
+                tax = 8350 * 0.10 + (33950 - 8350) * 0.15
+                        + (82250 - 33950) * 0.25 + (income - 82250) * 0.28;
+            } else if (income <= 372950) {
+                tax = 8350 * 0.10 + (33950 - 8350) * 0.15
+                        + (82250 - 33950) * 0.25 + (171550 - 82250) * 0.28
+                        + (income - 171550) * 0.33;
+            } else {
+                tax = 8350 * 0.10 + (33950 - 8350) * 0.15
+                        + (82250 - 33950) * 0.25 + (171550 - 82250) * 0.28
+                        + (372950 - 171550) * 0.33 + (income - 372950) * 0.35;
+            }
+        } else if (status == 1) { // Compute tax for married file jointly
+            // Left as exercise in Programming Exercise 3.13
+        } else if (status == 2) { // Compute tax for married separately
+            // Left as exercise in Programming Exercise 3.13
+        } else if (status == 3) { // Compute tax for head of household
+            // Left as exercise in Programming Exercise 3.13
+        } else {
+            System.out.println("Error: invalid status");
+            System.exit(1);
+        }
+
+        // Display the result
+        System.out.println("Tax is " + (int) (tax * 100) / 100.0);
+    }
+}
+
+
+ diff --git a/ZIPs/LabClass_Sep6_CalebFontenot/LabClass_Sep6_CalebFontenot.zip b/ZIPs/LabClass_Sep6_CalebFontenot/LabClass_Sep6_CalebFontenot.zip new file mode 100644 index 0000000..0297580 Binary files /dev/null and b/ZIPs/LabClass_Sep6_CalebFontenot/LabClass_Sep6_CalebFontenot.zip differ diff --git a/ZIPs/LabClass_Sep6_CalebFontenot/SimpleIfDemo.html b/ZIPs/LabClass_Sep6_CalebFontenot/SimpleIfDemo.html new file mode 100644 index 0000000..aef2cdb --- /dev/null +++ b/ZIPs/LabClass_Sep6_CalebFontenot/SimpleIfDemo.html @@ -0,0 +1,57 @@ + + + +SimpleIfDemo.java + + + + +
/home/caleb/NetBeansProjects/ADSV Java/LabClass_Sep6_CalebFontenot/src/main/java/com/calebfontenot/labclass_sep6_calebfontenot/SimpleIfDemo.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.labclass_sep6_calebfontenot;
+
+import java.util.Scanner;
+
+/**
+ *
+ * @author caleb
+ */
+public class SimpleIfDemo {
+
+    public static void main(String[] args)
+    {
+        Scanner input = new Scanner(System.in);
+        System.out.print("Enter an integer: ");
+        int number = input.nextInt();
+
+        if (number % 5 == 0) {
+            System.out.println("HiFive");
+        }
+
+        if (number % 2 == 0) {
+            System.out.println("HiEven");
+        }
+    }
+}
+
+
+