new semester, new repo structure
This commit is contained in:
BIN
Semester 1/Exams/ExamPractice/exam1Programming-2-1.pdf
Normal file
BIN
Semester 1/Exams/ExamPractice/exam1Programming-2-1.pdf
Normal file
Binary file not shown.
14
Semester 1/Exams/ExamPractice/pom.xml
Normal file
14
Semester 1/Exams/ExamPractice/pom.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.calebfontenot</groupId>
|
||||
<artifactId>ExamPractice</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<maven.compiler.source>18</maven.compiler.source>
|
||||
<maven.compiler.target>18</maven.compiler.target>
|
||||
<exec.mainClass>com.calebfontenot.exampractice.ExamPractice</exec.mainClass>
|
||||
</properties>
|
||||
</project>
|
@@ -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);
|
||||
}
|
||||
}
|
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user