Reorganize repository

This commit is contained in:
2022-09-29 09:47:57 -05:00
parent bb527bf234
commit 729cb2e986
323 changed files with 67 additions and 0 deletions

View File

@@ -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);
}
}

View File

@@ -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);
}
}
}