From 121f8ed3e1cd8ea4e42845dcee0f0b20118e3883 Mon Sep 17 00:00:00 2001 From: Caleb Fontenot Date: Tue, 20 Sep 2022 10:52:53 -0500 Subject: [PATCH] lab9 --- .gitignore | 1 + lab9_CalebFontenot/pom.xml | 14 ++++++ .../Lab9_CalebFontenot.java | 17 +++++++ .../lab9_calebfontenot/MinimumOf3.java | 46 +++++++++++++++++++ 4 files changed, 78 insertions(+) create mode 100644 lab9_CalebFontenot/pom.xml create mode 100644 lab9_CalebFontenot/src/main/java/com/calebfontenot/lab9_calebfontenot/Lab9_CalebFontenot.java create mode 100644 lab9_CalebFontenot/src/main/java/com/calebfontenot/lab9_calebfontenot/MinimumOf3.java diff --git a/.gitignore b/.gitignore index df7c619..348d561 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ /lab7_CalebFontenot/target/ /MP2_CalebFontenot/target/ /lab8_CalebFontenot/target/ +/lab9_CalebFontenot/target/ diff --git a/lab9_CalebFontenot/pom.xml b/lab9_CalebFontenot/pom.xml new file mode 100644 index 0000000..2cb3603 --- /dev/null +++ b/lab9_CalebFontenot/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + com.calebfontenot + lab9_CalebFontenot + 1.0-SNAPSHOT + jar + + UTF-8 + 18 + 18 + com.calebfontenot.lab9_calebfontenot.Lab9_CalebFontenot + + \ No newline at end of file diff --git a/lab9_CalebFontenot/src/main/java/com/calebfontenot/lab9_calebfontenot/Lab9_CalebFontenot.java b/lab9_CalebFontenot/src/main/java/com/calebfontenot/lab9_calebfontenot/Lab9_CalebFontenot.java new file mode 100644 index 0000000..1be6e57 --- /dev/null +++ b/lab9_CalebFontenot/src/main/java/com/calebfontenot/lab9_calebfontenot/Lab9_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.lab9_calebfontenot; + +/** + * + * @author caleb + */ +public class Lab9_CalebFontenot { + + public static void main(String[] args) { + System.out.println("Hello World!"); + } +} diff --git a/lab9_CalebFontenot/src/main/java/com/calebfontenot/lab9_calebfontenot/MinimumOf3.java b/lab9_CalebFontenot/src/main/java/com/calebfontenot/lab9_calebfontenot/MinimumOf3.java new file mode 100644 index 0000000..d561639 --- /dev/null +++ b/lab9_CalebFontenot/src/main/java/com/calebfontenot/lab9_calebfontenot/MinimumOf3.java @@ -0,0 +1,46 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.calebfontenot.lab9_calebfontenot; + +import java.util.Scanner; + +/** + * + * @author ASDV2 + */ +public class MinimumOf3 { + + public static void main(String[] args) + { + Scanner scan = new Scanner(System.in); + + System.out.println("Please neter 3 numbers to find the minimum of the 3:"); + int x = scan.nextInt(); + int y = scan.nextInt(); + int z = scan.nextInt(); + + /* + if ( x < y ) + if ( x < z ) + System.out.println("minimum= " + x); + else + System.out.println("minimum= " + z); + else if ( y < z ) + System.out.println("minimum= " + y); + else + System.out.println("minimum= " + z); + + */ + System.out.println( + (x < y) + ? (x < z) ? "minimum= " + x + : "minimum= " + z + : (y < z) ? "minimum= " + y : "minimum= " + z + ); + + } + +}