new semester, new repo structure

This commit is contained in:
2023-01-10 11:59:05 -06:00
parent 0a76658f85
commit ba6de6e18e
725 changed files with 1199 additions and 103 deletions

View 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.lab5_calebfontenot</groupId>
<artifactId>lab5_CalebFontenot</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.lab5_calebfontenot.Lab5_CalebFontenot</exec.mainClass>
</properties>
</project>

View File

@@ -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.lab5_calebfontenot;
/**
*
* @author caleb
*/
public class Lab5_CalebFontenot {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}

View File

@@ -0,0 +1,48 @@
/*
* 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);
}
}

View File

@@ -0,0 +1,36 @@
/*
* 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);
}
}

View File

@@ -0,0 +1,32 @@
/*
* 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!");
}
}

View File

@@ -0,0 +1,29 @@
/*
* 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.");
}
}