diff --git a/.gitignore b/.gitignore index b54dff1..1028231 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /lab4_CalebFontenot/target/ /lab5_CalebFontenot/target/ /LabClass_Sep6_CalebFontenot/target/ +/lab6_CalebFontenot/target/ diff --git a/lab6_CalebFontenot/lab6-1-1.pdf b/lab6_CalebFontenot/lab6-1-1.pdf new file mode 100644 index 0000000..126cee9 Binary files /dev/null and b/lab6_CalebFontenot/lab6-1-1.pdf differ diff --git a/lab6_CalebFontenot/pom.xml b/lab6_CalebFontenot/pom.xml new file mode 100644 index 0000000..270dd67 --- /dev/null +++ b/lab6_CalebFontenot/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + com.calebfontenot.lab6_calebfontenot + lab6_CalebFontenot + 1.0-SNAPSHOT + jar + + UTF-8 + 18 + 18 + com.calebfontenot.lab6_calebfontenot.Lab6_CalebFontenot + + \ No newline at end of file diff --git a/lab6_CalebFontenot/src/main/java/com/calebfontenot/lab6_calebfontenot/If1.java b/lab6_CalebFontenot/src/main/java/com/calebfontenot/lab6_calebfontenot/If1.java new file mode 100644 index 0000000..6aa6a17 --- /dev/null +++ b/lab6_CalebFontenot/src/main/java/com/calebfontenot/lab6_calebfontenot/If1.java @@ -0,0 +1,28 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package com.calebfontenot.lab6_calebfontenot; + +import java.util.Scanner; + +/** + * + * @author caleb + */ +public class If1 { + public static void main(String[] args) + { + System.out.println("Please type a positive number: "); + + /* + Observe that the varible scan is eliminated + Explanation: We create a new object by using "new Scanner" and + then the DOT (.) nextInt() uses that new object (new varibale) to read + */ + int number = new Scanner(System.in).nextInt(); + + if ( number >= 0 ) + System.out.println("You typed a positive number! It was number " + number + "!"); + } +} diff --git a/lab6_CalebFontenot/src/main/java/com/calebfontenot/lab6_calebfontenot/Lab6_CalebFontenot.java b/lab6_CalebFontenot/src/main/java/com/calebfontenot/lab6_calebfontenot/Lab6_CalebFontenot.java new file mode 100644 index 0000000..79b808d --- /dev/null +++ b/lab6_CalebFontenot/src/main/java/com/calebfontenot/lab6_calebfontenot/Lab6_CalebFontenot.java @@ -0,0 +1,25 @@ +/* + * 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.lab6_calebfontenot; + +import java.util.Scanner; + +/** + * + * @author caleb + */ +public class Lab6_CalebFontenot { + + public static void main(String[] args) + { + System.out.println("Please type a positive number: "); + Scanner scan = new Scanner(System.in); + int number = scan.nextInt(); + + if (number >= 0) { + System.out.println("You typed a positive number! It was number " + number + "!"); + } + } +} diff --git a/lab6_CalebFontenot/src/main/java/com/calebfontenot/lab6_calebfontenot/Triangle.java b/lab6_CalebFontenot/src/main/java/com/calebfontenot/lab6_calebfontenot/Triangle.java new file mode 100644 index 0000000..0bfba8a --- /dev/null +++ b/lab6_CalebFontenot/src/main/java/com/calebfontenot/lab6_calebfontenot/Triangle.java @@ -0,0 +1,13 @@ +/* + * 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.lab6_calebfontenot; + +/** + * + * @author caleb + */ +public class Triangle { + +}