More reorganizing
This commit is contained in:
parent
729cb2e986
commit
cba0c80bb4
44
ZIPs/Lab 2/ComputeExpression.html
Normal file
44
ZIPs/Lab 2/ComputeExpression.html
Normal file
@ -0,0 +1,44 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>ComputeExpression.java</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<style type="text/css">
|
||||
<!--
|
||||
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
table {color: #888888; background-color: #313335; font-family: monospace}
|
||||
.ST1 {color: #808080; font-family: monospace; font-weight: bold}
|
||||
.comment {color: #808080}
|
||||
.whitespace {color: #505050}
|
||||
.ST2 {color: #ffc66d; font-family: monospace; font-style: italic}
|
||||
.ST3 {color: #9876aa; font-family: monospace; font-style: italic}
|
||||
.string {color: #6a8759}
|
||||
.number {color: #6897bb}
|
||||
.ST0 {color: #287bde}
|
||||
.literal {color: #cc7832}
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table width="100%"><tr><td align="center">/home/caleb/NetBeansProjects/ADSV Java/Lab2CalebFontenot/lab2CalebFontenot/src/main/java/ComputeExpression.java</td></tr></table>
|
||||
<pre>
|
||||
<span class="comment">/*</span>
|
||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt</span><span class="comment"> to change this license</span>
|
||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java</span><span class="comment"> to edit this template</span>
|
||||
<span class="comment"> */</span>
|
||||
|
||||
<span class="comment">/**</span>
|
||||
<span class="comment"> *</span>
|
||||
<span class="comment"> * </span><span class="ST1">@author</span> <span class="comment">caleb</span>
|
||||
<span class="comment">*/</span>
|
||||
<span class="literal">public</span> <span class="literal">class</span> ComputeExpression {
|
||||
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST2">main</span>(String[] args) {
|
||||
System.<span class="ST3">out</span>.print(<span class="string">"</span><span class="string">(10.5 + 2 * 3) / (45 – 3.5) = </span><span class="string">"</span>);
|
||||
System.<span class="ST3">out</span>.println((<span class="number">10.5</span> + <span class="number">2</span> * <span class="number">3</span>) / (<span class="number">45</span> - <span class="number">3.5</span>));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</pre></body>
|
||||
</html>
|
43
ZIPs/Lab 2/ShowLogicErrors.html
Normal file
43
ZIPs/Lab 2/ShowLogicErrors.html
Normal file
@ -0,0 +1,43 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>ShowLogicErrors.java</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<style type="text/css">
|
||||
<!--
|
||||
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
table {color: #888888; background-color: #313335; font-family: monospace}
|
||||
.ST1 {color: #808080; font-family: monospace; font-weight: bold}
|
||||
.comment {color: #808080}
|
||||
.whitespace {color: #505050}
|
||||
.ST2 {color: #ffc66d; font-family: monospace; font-style: italic}
|
||||
.ST3 {color: #9876aa; font-family: monospace; font-style: italic}
|
||||
.string {color: #6a8759}
|
||||
.number {color: #6897bb}
|
||||
.ST0 {color: #287bde}
|
||||
.literal {color: #cc7832}
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table width="100%"><tr><td align="center">/home/caleb/NetBeansProjects/ADSV Java/Lab2CalebFontenot/lab2CalebFontenot/src/main/java/ShowLogicErrors.java</td></tr></table>
|
||||
<pre>
|
||||
<span class="comment">/*</span>
|
||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt</span><span class="comment"> to change this license</span>
|
||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java</span><span class="comment"> to edit this template</span>
|
||||
<span class="comment"> */</span>
|
||||
|
||||
<span class="comment">/**</span>
|
||||
<span class="comment"> *</span>
|
||||
<span class="comment"> * </span><span class="ST1">@author</span> <span class="comment">caleb</span>
|
||||
<span class="comment">*/</span>
|
||||
<span class="literal">public</span> <span class="literal">class</span> ShowLogicErrors {
|
||||
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST2">main</span>(String[] args) {
|
||||
System.<span class="ST3">out</span>.print(<span class="string">"</span><span class="string">Celsius 35 is Fahrenheit degree </span><span class="string">"</span>);
|
||||
System.<span class="ST3">out</span>.println((<span class="number">9.0</span> / <span class="number">5</span>) * <span class="number">35</span> + <span class="number">32</span>);
|
||||
}
|
||||
}
|
||||
|
||||
</pre></body>
|
||||
</html>
|
42
ZIPs/Lab 2/ShowRuntimeErrors.html
Normal file
42
ZIPs/Lab 2/ShowRuntimeErrors.html
Normal file
@ -0,0 +1,42 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>ShowRuntimeErrors.java</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<style type="text/css">
|
||||
<!--
|
||||
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
table {color: #888888; background-color: #313335; font-family: monospace}
|
||||
.ST1 {color: #808080; font-family: monospace; font-weight: bold}
|
||||
.comment {color: #808080}
|
||||
.whitespace {color: #505050}
|
||||
.ST2 {color: #ffc66d; font-family: monospace; font-style: italic}
|
||||
.ST3 {color: #9876aa; font-family: monospace; font-style: italic}
|
||||
.number {color: #6897bb}
|
||||
.ST0 {color: #287bde}
|
||||
.literal {color: #cc7832}
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table width="100%"><tr><td align="center">/home/caleb/NetBeansProjects/ADSV Java/Lab2CalebFontenot/lab2CalebFontenot/src/main/java/ShowRuntimeErrors.java</td></tr></table>
|
||||
<pre>
|
||||
<span class="comment">/*</span>
|
||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt</span><span class="comment"> to change this license</span>
|
||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java</span><span class="comment"> to edit this template</span>
|
||||
<span class="comment"> */</span>
|
||||
|
||||
<span class="comment">/**</span>
|
||||
<span class="comment"> *</span>
|
||||
<span class="comment"> * </span><span class="ST1">@author</span> <span class="comment">caleb</span>
|
||||
<span class="comment">*/</span>
|
||||
<span class="comment">// ShowRuntimeErrors.java: Program contains runtime errors</span>
|
||||
<span class="literal">public</span> <span class="literal">class</span> ShowRuntimeErrors {
|
||||
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST2">main</span>(String[] args) {
|
||||
System.<span class="ST3">out</span>.println(<span class="number">1</span> / <span class="number">0</span>);
|
||||
}
|
||||
}
|
||||
|
||||
</pre></body>
|
||||
</html>
|
43
ZIPs/Lab 2/ShowSyntaxErrors.html
Normal file
43
ZIPs/Lab 2/ShowSyntaxErrors.html
Normal file
@ -0,0 +1,43 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>ShowSyntaxErrors.java</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<style type="text/css">
|
||||
<!--
|
||||
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
table {color: #888888; background-color: #313335; font-family: monospace}
|
||||
.ST1 {color: #808080; font-family: monospace; font-weight: bold}
|
||||
.comment {color: #808080}
|
||||
.whitespace {color: #505050}
|
||||
.ST2 {color: #ffc66d; font-family: monospace; font-style: italic}
|
||||
.ST3 {color: #9876aa; font-family: monospace; font-style: italic}
|
||||
.string {color: #6a8759}
|
||||
.ST0 {color: #287bde}
|
||||
.literal {color: #cc7832}
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table width="100%"><tr><td align="center">/home/caleb/NetBeansProjects/ADSV Java/Lab2CalebFontenot/lab2CalebFontenot/src/main/java/ShowSyntaxErrors.java</td></tr></table>
|
||||
<pre>
|
||||
<span class="comment">/*</span>
|
||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt</span><span class="comment"> to change this license</span>
|
||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java</span><span class="comment"> to edit this template</span>
|
||||
<span class="comment"> */</span>
|
||||
|
||||
<span class="comment">/**</span>
|
||||
<span class="comment"> *</span>
|
||||
<span class="comment"> * </span><span class="ST1">@author</span> <span class="comment">caleb</span>
|
||||
<span class="comment">*/</span>
|
||||
<span class="literal">public</span> <span class="literal">class</span> ShowSyntaxErrors {
|
||||
|
||||
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST2">main</span>(String[] args)
|
||||
{
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">Welcome to Java</span><span class="string">"</span>);
|
||||
}
|
||||
}
|
||||
|
||||
</pre></body>
|
||||
</html>
|
44
ZIPs/Lab 2/WelvomeWithThreeMessages.html
Normal file
44
ZIPs/Lab 2/WelvomeWithThreeMessages.html
Normal file
@ -0,0 +1,44 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>WelcomeWithThreeMessages.java</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<style type="text/css">
|
||||
<!--
|
||||
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
table {color: #888888; background-color: #313335; font-family: monospace}
|
||||
.ST1 {color: #808080; font-family: monospace; font-weight: bold}
|
||||
.comment {color: #808080}
|
||||
.whitespace {color: #505050}
|
||||
.ST2 {color: #ffc66d; font-family: monospace; font-style: italic}
|
||||
.ST3 {color: #9876aa; font-family: monospace; font-style: italic}
|
||||
.string {color: #6a8759}
|
||||
.ST0 {color: #287bde}
|
||||
.literal {color: #cc7832}
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table width="100%"><tr><td align="center">/home/caleb/NetBeansProjects/ADSV Java/Lab2CalebFontenot/lab2CalebFontenot/src/main/java/WelcomeWithThreeMessages.java</td></tr></table>
|
||||
<pre>
|
||||
<span class="comment">/*</span>
|
||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt</span><span class="comment"> to change this license</span>
|
||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java</span><span class="comment"> to edit this template</span>
|
||||
<span class="comment"> */</span>
|
||||
|
||||
<span class="comment">/**</span>
|
||||
<span class="comment"> *</span>
|
||||
<span class="comment"> * </span><span class="ST1">@author</span> <span class="comment">caleb</span>
|
||||
<span class="comment">*/</span>
|
||||
<span class="literal">public</span> <span class="literal">class</span> WelcomeWithThreeMessages {
|
||||
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST2">main</span>(String[] args)
|
||||
{
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">Programming is fun!</span><span class="string">"</span>);
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">Fundamentals First</span><span class="string">"</span>);
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">Problem Driven</span><span class="string">"</span>);
|
||||
}
|
||||
}
|
||||
|
||||
</pre></body>
|
||||
</html>
|
BIN
ZIPs/Lab 2/lab2CalebFontenot.zip
Normal file
BIN
ZIPs/Lab 2/lab2CalebFontenot.zip
Normal file
Binary file not shown.
1
ZIPs/Lab 3-1/.~lock.Lab3-f22.docx#
Normal file
1
ZIPs/Lab 3-1/.~lock.Lab3-f22.docx#
Normal file
@ -0,0 +1 @@
|
||||
,caleb,caleb-gaming-laptop-archlinux,24.08.2022 09:17,file:///home/caleb/.config/libreoffice/4;
|
BIN
ZIPs/Lab 3-1/Lab3-f22.docx
Normal file
BIN
ZIPs/Lab 3-1/Lab3-f22.docx
Normal file
Binary file not shown.
BIN
ZIPs/Lab 3-1/Lab3-f22.odt
Normal file
BIN
ZIPs/Lab 3-1/Lab3-f22.odt
Normal file
Binary file not shown.
70
ZIPs/Lab 3-1/Lab3.html
Normal file
70
ZIPs/Lab 3-1/Lab3.html
Normal file
@ -0,0 +1,70 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Lab3.java</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<style type="text/css">
|
||||
<!--
|
||||
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
table {color: #888888; background-color: #313335; font-family: monospace}
|
||||
.ST1 {color: #808080; font-family: monospace; font-weight: bold}
|
||||
.comment {color: #808080}
|
||||
.whitespace {color: #505050}
|
||||
.ST2 {color: #ffc66d; font-family: monospace; font-style: italic}
|
||||
.ST3 {color: #9876aa; font-family: monospace; font-style: italic}
|
||||
.string {color: #6a8759}
|
||||
.number {color: #6897bb}
|
||||
.ST0 {color: #287bde}
|
||||
.literal {color: #cc7832}
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table width="100%"><tr><td align="center">/home/caleb/NetBeansProjects/ADSV Java/Lab3_1_CalebFontenot/src/main/java/com/calebfontenot/lab3_1_calebfontenot/Lab3.java</td></tr></table>
|
||||
<pre>
|
||||
<span class="comment">/*</span>
|
||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt</span><span class="comment"> to change this license</span>
|
||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java</span><span class="comment"> to edit this template</span>
|
||||
<span class="comment"> */</span>
|
||||
<span class="literal">package</span> com.calebfontenot.lab3_1_calebfontenot;
|
||||
<span class="literal">import</span> java.util.Scanner;
|
||||
<span class="comment">/**</span>
|
||||
<span class="comment"> *</span>
|
||||
<span class="comment"> * </span><span class="ST1">@author</span> <span class="comment">caleb</span>
|
||||
<span class="comment">*/</span>
|
||||
<span class="literal">public</span> <span class="literal">class</span> Lab3 {
|
||||
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST2">main</span>(String[] args)
|
||||
{
|
||||
<span class="comment">// Create a scanner object</span>
|
||||
Scanner input = <span class="literal">new</span> Scanner(System.<span class="ST3">in</span>);
|
||||
|
||||
<span class="comment">// Prompt for hight in feet</span>
|
||||
System.<span class="ST3">out</span>.print(<span class="string">"</span><span class="string">Enter the height (feet): </span><span class="string">"</span>);
|
||||
<span class="literal">double</span> height;
|
||||
height = input.nextDouble();
|
||||
|
||||
<span class="comment">// Prompt for width in feet</span>
|
||||
System.<span class="ST3">out</span>.print(<span class="string">"</span><span class="string">Enter the width (feet):</span><span class="string">"</span>);
|
||||
<span class="literal">double</span> width;
|
||||
width = input.nextDouble();
|
||||
|
||||
<span class="comment">// Calculate the area</span>
|
||||
<span class="literal">double</span> area;
|
||||
area = height * width;
|
||||
<span class="comment">// Print area calculated</span>
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">Calculated area is </span><span class="string">"</span>+area);
|
||||
<span class="comment">//create constants</span>
|
||||
<span class="literal">final</span> <span class="literal">double</span> GALLONS_PER_SQUARE_FEET = <span class="number">150.0</span>;
|
||||
|
||||
<span class="comment">// calculate the gallons</span>
|
||||
<span class="literal">double</span> gallons;
|
||||
gallons = area/GALLONS_PER_SQUARE_FEET;
|
||||
<span class="comment">//calculate the number of gallons needed to paint the wall </span>
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">The amount of paint is </span><span class="string">"</span> + gallons +<span class="string">"</span><span class="string"> gallons.</span><span class="string">"</span>);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
</pre></body>
|
||||
</html>
|
BIN
ZIPs/Lab 3-1/Lab3_1_CalebFontenot.zip
Normal file
BIN
ZIPs/Lab 3-1/Lab3_1_CalebFontenot.zip
Normal file
Binary file not shown.
57
ZIPs/Lab 3-1/MilesToKilometers.html
Normal file
57
ZIPs/Lab 3-1/MilesToKilometers.html
Normal file
@ -0,0 +1,57 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>MilesToKilometers.java</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<style type="text/css">
|
||||
<!--
|
||||
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
table {color: #888888; background-color: #313335; font-family: monospace}
|
||||
.ST1 {color: #808080; font-family: monospace; font-weight: bold}
|
||||
.comment {color: #808080}
|
||||
.whitespace {color: #505050}
|
||||
.ST2 {color: #ffc66d; font-family: monospace; font-style: italic}
|
||||
.ST3 {color: #9876aa; font-family: monospace; font-style: italic}
|
||||
.string {color: #6a8759}
|
||||
.number {color: #6897bb}
|
||||
.ST0 {color: #287bde}
|
||||
.literal {color: #cc7832}
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table width="100%"><tr><td align="center">/home/caleb/NetBeansProjects/ADSV Java/Lab3_1_CalebFontenot/src/main/java/com/calebfontenot/lab3_1_calebfontenot/MilesToKilometers.java</td></tr></table>
|
||||
<pre>
|
||||
<span class="comment">/*</span>
|
||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt</span><span class="comment"> to change this license</span>
|
||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java</span><span class="comment"> to edit this template</span>
|
||||
<span class="comment"> */</span>
|
||||
<span class="literal">package</span> com.calebfontenot.lab3_1_calebfontenot;
|
||||
|
||||
<span class="literal">import</span> java.util.Scanner;
|
||||
|
||||
<span class="comment">/**</span>
|
||||
<span class="comment"> *</span>
|
||||
<span class="comment"> * </span><span class="ST1">@author</span> <span class="comment">caleb</span>
|
||||
<span class="comment">*/</span>
|
||||
<span class="literal">public</span> <span class="literal">class</span> MilesToKilometers {
|
||||
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST2">main</span>(String[] args)
|
||||
{
|
||||
<span class="literal">double</span> miles;
|
||||
<span class="literal">double</span> km;
|
||||
Scanner scanner = <span class="literal">new</span> Scanner(System.<span class="ST3">in</span>);
|
||||
|
||||
<span class="comment">//> 1. Prompt the user to enter the number of miles</span>
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">Please enter miles to convert into kilometers</span><span class="string">"</span>);
|
||||
<span class="comment">//> 2. Read the miles and store it into a variable</span>
|
||||
miles = scanner.nextDouble();
|
||||
<span class="comment">//> 3. Calculate the KM from the entered miles</span>
|
||||
km = miles * <span class="number">1.67</span>;
|
||||
<span class="comment">//> 4. Display the result</span>
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">You entered </span><span class="string">"</span>+miles+<span class="string">"</span><span class="string"> miles which is </span><span class="string">"</span>+km+<span class="string">"</span><span class="string"> kilometers</span><span class="string">"</span>);
|
||||
}
|
||||
}
|
||||
|
||||
</pre></body>
|
||||
</html>
|
BIN
ZIPs/Lab 3-1/RunwayLength Table.docx
Normal file
BIN
ZIPs/Lab 3-1/RunwayLength Table.docx
Normal file
Binary file not shown.
67
ZIPs/Lab 3-1/RunwayLength.html
Normal file
67
ZIPs/Lab 3-1/RunwayLength.html
Normal file
@ -0,0 +1,67 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>RunwayLength.java</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<style type="text/css">
|
||||
<!--
|
||||
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
table {color: #888888; background-color: #313335; font-family: monospace}
|
||||
.ST1 {color: #808080; font-family: monospace; font-weight: bold}
|
||||
.whitespace {color: #505050}
|
||||
.comment {color: #808080}
|
||||
.ST2 {color: #ffc66d; font-family: monospace; font-style: italic}
|
||||
.ST3 {color: #9876aa; font-family: monospace; font-style: italic}
|
||||
.string {color: #6a8759}
|
||||
.number {color: #6897bb}
|
||||
.ST0 {color: #287bde}
|
||||
.ST4 {font-family: monospace; font-style: italic}
|
||||
.literal {color: #cc7832}
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table width="100%"><tr><td align="center">/home/caleb/NetBeansProjects/ADSV Java/Lab3_1_CalebFontenot/src/main/java/com/calebfontenot/lab3_1_calebfontenot/RunwayLength.java</td></tr></table>
|
||||
<pre>
|
||||
<span class="literal">package</span> com.calebfontenot.lab3_1_calebfontenot;
|
||||
|
||||
<span class="literal">import</span> java.util.Scanner;
|
||||
|
||||
<span class="comment">/*</span>
|
||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt</span><span class="comment"> to change this license</span>
|
||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java</span><span class="comment"> to edit this template</span>
|
||||
<span class="comment"> */</span>
|
||||
|
||||
<span class="comment">/**</span>
|
||||
<span class="comment"> *</span>
|
||||
<span class="comment"> * </span><span class="ST1">@author</span> <span class="comment">caleb</span>
|
||||
<span class="comment">*/</span>
|
||||
<span class="literal">public</span> <span class="literal">class</span> RunwayLength {
|
||||
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST2">main</span>(String[] args)
|
||||
{
|
||||
|
||||
<span class="comment">//Define data objects</span>
|
||||
<span class="literal">double</span> length;
|
||||
<span class="literal">double</span> acceleration;
|
||||
<span class="literal">double</span> velocity;
|
||||
|
||||
<span class="comment">//Create scanner</span>
|
||||
Scanner input = <span class="literal">new</span> Scanner(System.<span class="ST3">in</span>);
|
||||
|
||||
<span class="comment">//Prompt for input</span>
|
||||
System.<span class="ST3">out</span>.print(<span class="string">"</span><span class="string">Enter velocity: </span><span class="string">"</span>);
|
||||
velocity = input.nextDouble();
|
||||
System.<span class="ST3">out</span>.print(<span class="string">"</span><span class="string">Enter acceleration: </span><span class="string">"</span>);
|
||||
acceleration = input.nextDouble();
|
||||
|
||||
<span class="comment">//Calculate</span>
|
||||
length = Math.<span class="ST4">pow</span>(velocity, <span class="number">2</span>) / (<span class="number">2</span> * acceleration);
|
||||
|
||||
<span class="comment">//Print calculation</span>
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">The minimum runway length for this airplane is </span><span class="string">"</span>+length);
|
||||
}
|
||||
}
|
||||
|
||||
</pre></body>
|
||||
</html>
|
BIN
ZIPs/Lab 3-1/Test Table.docx
Normal file
BIN
ZIPs/Lab 3-1/Test Table.docx
Normal file
Binary file not shown.
47
ZIPs/Lab 3/Exercise01_04.html
Normal file
47
ZIPs/Lab 3/Exercise01_04.html
Normal file
@ -0,0 +1,47 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Exercise01_04.java</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<style type="text/css">
|
||||
<!--
|
||||
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
table {color: #888888; background-color: #313335; font-family: monospace}
|
||||
.ST1 {color: #808080; font-family: monospace; font-weight: bold}
|
||||
.comment {color: #808080}
|
||||
.whitespace {color: #505050}
|
||||
.ST2 {color: #ffc66d; font-family: monospace; font-style: italic}
|
||||
.ST3 {color: #9876aa; font-family: monospace; font-style: italic}
|
||||
.string {color: #6a8759}
|
||||
.ST0 {color: #287bde}
|
||||
.literal {color: #cc7832}
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table width="100%"><tr><td align="center">/home/caleb/NetBeansProjects/ADSV Java/Lab3CalebFontenot/src/main/java/Exercise01_04.java</td></tr></table>
|
||||
<pre>
|
||||
<span class="comment">/*</span>
|
||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt</span><span class="comment"> to change this license</span>
|
||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java</span><span class="comment"> to edit this template</span>
|
||||
<span class="comment"> */</span>
|
||||
|
||||
<span class="comment">/**</span>
|
||||
<span class="comment"> *</span>
|
||||
<span class="comment"> * </span><span class="ST1">@author</span> <span class="comment">caleb</span>
|
||||
<span class="comment">*/</span>
|
||||
<span class="literal">public</span> <span class="literal">class</span> Exercise01_04 {
|
||||
|
||||
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST2">main</span>(String[] args)
|
||||
{
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">a a^2 a^3</span><span class="string">"</span>);
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">1 1 1</span><span class="string">"</span>);
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">2 4 8</span><span class="string">"</span>);
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">3 9 27</span><span class="string">"</span>);
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">4 16 64</span><span class="string">"</span>);
|
||||
}
|
||||
}
|
||||
|
||||
</pre></body>
|
||||
</html>
|
43
ZIPs/Lab 3/Exercise01_06.html
Normal file
43
ZIPs/Lab 3/Exercise01_06.html
Normal file
@ -0,0 +1,43 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Exercise01_06.java</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<style type="text/css">
|
||||
<!--
|
||||
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
table {color: #888888; background-color: #313335; font-family: monospace}
|
||||
.ST1 {color: #808080; font-family: monospace; font-weight: bold}
|
||||
.comment {color: #808080}
|
||||
.whitespace {color: #505050}
|
||||
.ST2 {color: #ffc66d; font-family: monospace; font-style: italic}
|
||||
.ST3 {color: #9876aa; font-family: monospace; font-style: italic}
|
||||
.number {color: #6897bb}
|
||||
.ST0 {color: #287bde}
|
||||
.literal {color: #cc7832}
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table width="100%"><tr><td align="center">/home/caleb/NetBeansProjects/ADSV Java/Lab3CalebFontenot/src/main/java/Exercise01_06.java</td></tr></table>
|
||||
<pre>
|
||||
<span class="comment">/*</span>
|
||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt</span><span class="comment"> to change this license</span>
|
||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java</span><span class="comment"> to edit this template</span>
|
||||
<span class="comment"> */</span>
|
||||
|
||||
<span class="comment">/**</span>
|
||||
<span class="comment"> *</span>
|
||||
<span class="comment"> * </span><span class="ST1">@author</span> <span class="comment">caleb</span>
|
||||
<span class="comment">*/</span>
|
||||
<span class="literal">public</span> <span class="literal">class</span> Exercise01_06 {
|
||||
|
||||
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST2">main</span>(String[] args)
|
||||
{
|
||||
System.<span class="ST3">out</span>.println(<span class="number">1</span> + <span class="number">2</span> + <span class="number">3</span> + <span class="number">4</span> + <span class="number">5</span> + <span class="number">6</span> + <span class="number">7</span> + <span class="number">8</span> + <span class="number">9</span>);
|
||||
}
|
||||
}
|
||||
|
||||
</pre></body>
|
||||
</html>
|
43
ZIPs/Lab 3/Exercise01_07.html
Normal file
43
ZIPs/Lab 3/Exercise01_07.html
Normal file
@ -0,0 +1,43 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Exercise01_07.java</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<style type="text/css">
|
||||
<!--
|
||||
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
table {color: #888888; background-color: #313335; font-family: monospace}
|
||||
.ST1 {color: #808080; font-family: monospace; font-weight: bold}
|
||||
.comment {color: #808080}
|
||||
.whitespace {color: #505050}
|
||||
.ST2 {color: #ffc66d; font-family: monospace; font-style: italic}
|
||||
.ST3 {color: #9876aa; font-family: monospace; font-style: italic}
|
||||
.number {color: #6897bb}
|
||||
.ST0 {color: #287bde}
|
||||
.literal {color: #cc7832}
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table width="100%"><tr><td align="center">/home/caleb/NetBeansProjects/ADSV Java/Lab3CalebFontenot/src/main/java/Exercise01_07.java</td></tr></table>
|
||||
<pre>
|
||||
<span class="comment">/*</span>
|
||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt</span><span class="comment"> to change this license</span>
|
||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java</span><span class="comment"> to edit this template</span>
|
||||
<span class="comment"> */</span>
|
||||
|
||||
<span class="comment">/**</span>
|
||||
<span class="comment"> *</span>
|
||||
<span class="comment"> * </span><span class="ST1">@author</span> <span class="comment">caleb</span>
|
||||
<span class="comment">*/</span>
|
||||
<span class="literal">public</span> <span class="literal">class</span> Exercise01_07 {
|
||||
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST2">main</span>(String[] args)
|
||||
{
|
||||
System.<span class="ST3">out</span>.println(<span class="number">4</span> * (<span class="number">1.0</span> - (<span class="number">1.0</span>/<span class="number">3</span>) + (<span class="number">1.0</span>/<span class="number">5</span>) - (<span class="number">1.0</span>/<span class="number">7</span>) + (<span class="number">1.0</span>/<span class="number">9</span>) - (<span class="number">1.0</span>/<span class="number">11</span>)));
|
||||
System.<span class="ST3">out</span>.println(<span class="number">4</span> * (<span class="number">1.0</span> - (<span class="number">1.0</span>/<span class="number">3</span>) + (<span class="number">1.0</span>/<span class="number">5</span>) - (<span class="number">1.0</span>/<span class="number">7</span>) + (<span class="number">1.0</span>/<span class="number">9</span>) - (<span class="number">1.0</span>/<span class="number">11</span>) + (<span class="number">1.0</span>/<span class="number">13</span>)));
|
||||
}
|
||||
}
|
||||
|
||||
</pre></body>
|
||||
</html>
|
52
ZIPs/Lab 3/Exercise01_11.html
Normal file
52
ZIPs/Lab 3/Exercise01_11.html
Normal file
@ -0,0 +1,52 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Exercise01_11.java</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<style type="text/css">
|
||||
<!--
|
||||
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
table {color: #888888; background-color: #313335; font-family: monospace}
|
||||
.ST1 {color: #808080; font-family: monospace; font-weight: bold}
|
||||
.comment {color: #808080}
|
||||
.whitespace {color: #505050}
|
||||
.ST2 {color: #ffc66d; font-family: monospace; font-style: italic}
|
||||
.ST3 {color: #9876aa; font-family: monospace; font-style: italic}
|
||||
.number {color: #6897bb}
|
||||
.ST0 {color: #287bde}
|
||||
.literal {color: #cc7832}
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table width="100%"><tr><td align="center">/home/caleb/NetBeansProjects/ADSV Java/Lab3CalebFontenot/src/main/java/Exercise01_11.java</td></tr></table>
|
||||
<pre>
|
||||
<span class="comment">/*</span>
|
||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt</span><span class="comment"> to change this license</span>
|
||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java</span><span class="comment"> to edit this template</span>
|
||||
<span class="comment"> */</span>
|
||||
|
||||
<span class="comment">/**</span>
|
||||
<span class="comment"> *</span>
|
||||
<span class="comment"> * </span><span class="ST1">@author</span> <span class="comment">caleb</span>
|
||||
<span class="comment">*/</span>
|
||||
<span class="literal">public</span> <span class="literal">class</span> Exercise01_11 {
|
||||
|
||||
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST2">main</span>(String[] args)
|
||||
{
|
||||
<span class="literal">double</span> Population = <span class="number">312032486.0</span>;
|
||||
<span class="literal">for</span> (<span class="literal">int</span> i = <span class="number">1</span>; i <= <span class="number">5</span>; i++) {
|
||||
<span class="comment">//One birth every 7 seconds</span>
|
||||
Population += ((<span class="number">60</span> * <span class="number">60</span> * <span class="number">24</span> * <span class="number">365</span>) / <span class="number">7.0</span>);
|
||||
<span class="comment">//One death every 13 seconds</span>
|
||||
Population -= ((<span class="number">60</span> * <span class="number">60</span> * <span class="number">24</span> * <span class="number">365</span>) / <span class="number">13.0</span>);
|
||||
<span class="comment">//One new immigrant every 45 seconds</span>
|
||||
Population += ((<span class="number">60</span> * <span class="number">60</span> * <span class="number">24</span> * <span class="number">365</span>) / <span class="number">45.0</span>);
|
||||
System.<span class="ST3">out</span>.println(Population);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</pre></body>
|
||||
</html>
|
BIN
ZIPs/Lab 3/Lab3CalebFontenot.zip
Normal file
BIN
ZIPs/Lab 3/Lab3CalebFontenot.zip
Normal file
Binary file not shown.
BIN
ZIPs/Lab2CalebFontenot.zip
Normal file
BIN
ZIPs/Lab2CalebFontenot.zip
Normal file
Binary file not shown.
BIN
ZIPs/Lab3-3/Lab3-3CalebFontenot.zip
Normal file
BIN
ZIPs/Lab3-3/Lab3-3CalebFontenot.zip
Normal file
Binary file not shown.
52
ZIPs/Lab3-3/SalesTax.html
Normal file
52
ZIPs/Lab3-3/SalesTax.html
Normal file
@ -0,0 +1,52 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>SalesTax.java</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<style type="text/css">
|
||||
<!--
|
||||
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
table {color: #888888; background-color: #313335; font-family: monospace}
|
||||
.ST1 {color: #808080; font-family: monospace; font-weight: bold}
|
||||
.comment {color: #808080}
|
||||
.whitespace {color: #505050}
|
||||
.ST2 {color: #ffc66d; font-family: monospace; font-style: italic}
|
||||
.ST3 {color: #9876aa; font-family: monospace; font-style: italic}
|
||||
.string {color: #6a8759}
|
||||
.number {color: #6897bb}
|
||||
.ST0 {color: #287bde}
|
||||
.literal {color: #cc7832}
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table width="100%"><tr><td align="center">/home/caleb/NetBeansProjects/ADSV Java/Lab4_1/src/main/java/com/calebfontenot/lab4_1/SalesTax.java</td></tr></table>
|
||||
<pre>
|
||||
<span class="comment">/*</span>
|
||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt</span><span class="comment"> to change this license</span>
|
||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java</span><span class="comment"> to edit this template</span>
|
||||
<span class="comment"> */</span>
|
||||
<span class="literal">package</span> com.calebfontenot.lab4_1;
|
||||
|
||||
<span class="comment">/**</span>
|
||||
<span class="comment"> *</span>
|
||||
<span class="comment"> * </span><span class="ST1">@author</span> <span class="comment">caleb</span>
|
||||
<span class="comment">*/</span>
|
||||
<span class="literal">import</span> java.util.Scanner;
|
||||
|
||||
<span class="literal">public</span> <span class="literal">class</span> SalesTax {
|
||||
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST2">main</span>(String[] args) {
|
||||
Scanner input = <span class="literal">new</span> Scanner(System.<span class="ST3">in</span>);
|
||||
|
||||
System.<span class="ST3">out</span>.print(<span class="string">"</span><span class="string">Enter purchase amount: </span><span class="string">"</span>);
|
||||
<span class="literal">double</span> purchaseAmount = input.nextDouble();
|
||||
|
||||
<span class="literal">double</span> tax = purchaseAmount * <span class="number">0.06</span>;
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">Sales tax is </span><span class="string">"</span> + (<span class="literal">int</span>)(tax * <span class="number">100</span>) / <span class="number">100.0</span>);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</pre></body>
|
||||
</html>
|
45
ZIPs/Lab4/Debug.html
Normal file
45
ZIPs/Lab4/Debug.html
Normal file
@ -0,0 +1,45 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Debug1.java</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<style type="text/css">
|
||||
<!--
|
||||
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
table {color: #888888; background-color: #313335; font-family: monospace}
|
||||
.ST1 {color: #808080; font-family: monospace; font-weight: bold}
|
||||
.comment {color: #808080}
|
||||
.whitespace {color: #505050}
|
||||
.ST2 {color: #ffc66d; font-family: monospace; font-style: italic}
|
||||
.ST3 {color: #9876aa; font-family: monospace; font-style: italic}
|
||||
.number {color: #6897bb}
|
||||
.ST0 {color: #287bde}
|
||||
.literal {color: #cc7832}
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table width="100%"><tr><td align="center">/home/caleb/NetBeansProjects/ADSV Java/lab4_CalebFontenot/src/main/java/com/calebfontenot/lab4_calebfontenot/Debug1.java</td></tr></table>
|
||||
<pre>
|
||||
<span class="comment">/*</span>
|
||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt</span><span class="comment"> to change this license</span>
|
||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java</span><span class="comment"> to edit this template</span>
|
||||
<span class="comment"> */</span>
|
||||
<span class="literal">package</span> com.calebfontenot.lab4_calebfontenot;
|
||||
|
||||
<span class="comment">/**</span>
|
||||
<span class="comment"> *</span>
|
||||
<span class="comment"> * </span><span class="ST1">@author</span> <span class="comment">caleb</span>
|
||||
<span class="comment">*/</span>
|
||||
<span class="literal">public</span> <span class="literal">class</span> Debug1 {
|
||||
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST2">main</span>(String[] args)
|
||||
{
|
||||
<span class="literal">int</span> i = <span class="number">1</span>;
|
||||
<span class="literal">int</span> j = i * i * i;
|
||||
System.<span class="ST3">out</span>.println( j );
|
||||
}
|
||||
}
|
||||
|
||||
</pre></body>
|
||||
</html>
|
46
ZIPs/Lab4/Debug2.html
Normal file
46
ZIPs/Lab4/Debug2.html
Normal file
@ -0,0 +1,46 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Debug2.java</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<style type="text/css">
|
||||
<!--
|
||||
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
table {color: #888888; background-color: #313335; font-family: monospace}
|
||||
.ST1 {color: #808080; font-family: monospace; font-weight: bold}
|
||||
.comment {color: #808080}
|
||||
.whitespace {color: #505050}
|
||||
.ST2 {color: #ffc66d; font-family: monospace; font-style: italic}
|
||||
.ST3 {color: #9876aa; font-family: monospace; font-style: italic}
|
||||
.number {color: #6897bb}
|
||||
.ST0 {color: #287bde}
|
||||
.literal {color: #cc7832}
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table width="100%"><tr><td align="center">/home/caleb/NetBeansProjects/ADSV Java/lab4_CalebFontenot/src/main/java/com/calebfontenot/lab4_calebfontenot/Debug2.java</td></tr></table>
|
||||
<pre>
|
||||
<span class="comment">/*</span>
|
||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt</span><span class="comment"> to change this license</span>
|
||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java</span><span class="comment"> to edit this template</span>
|
||||
<span class="comment"> */</span>
|
||||
<span class="literal">package</span> com.calebfontenot.lab4_calebfontenot;
|
||||
|
||||
<span class="comment">/**</span>
|
||||
<span class="comment"> *</span>
|
||||
<span class="comment"> * </span><span class="ST1">@author</span> <span class="comment">caleb</span>
|
||||
<span class="comment">*/</span>
|
||||
<span class="literal">public</span> <span class="literal">class</span> Debug2 {
|
||||
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST2">main</span>(String[] args)
|
||||
{
|
||||
|
||||
<span class="literal">int</span> i = <span class="number">9</span>;
|
||||
<span class="literal">int</span> j = (<span class="literal">int</span>)((<span class="number">5.0</span> / <span class="number">6</span>) * (i * <span class="number">4</span>));
|
||||
System.<span class="ST3">out</span>.println(j);
|
||||
}
|
||||
}
|
||||
|
||||
</pre></body>
|
||||
</html>
|
43
ZIPs/Lab4/Debug3.html
Normal file
43
ZIPs/Lab4/Debug3.html
Normal file
@ -0,0 +1,43 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Debug3.java</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<style type="text/css">
|
||||
<!--
|
||||
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
table {color: #888888; background-color: #313335; font-family: monospace}
|
||||
.ST1 {color: #808080; font-family: monospace; font-weight: bold}
|
||||
.comment {color: #808080}
|
||||
.whitespace {color: #505050}
|
||||
.ST2 {color: #ffc66d; font-family: monospace; font-style: italic}
|
||||
.ST3 {color: #9876aa; font-family: monospace; font-style: italic}
|
||||
.number {color: #6897bb}
|
||||
.ST0 {color: #287bde}
|
||||
.literal {color: #cc7832}
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table width="100%"><tr><td align="center">/home/caleb/NetBeansProjects/ADSV Java/lab4_CalebFontenot/src/main/java/com/calebfontenot/lab4_calebfontenot/Debug3.java</td></tr></table>
|
||||
<pre>
|
||||
<span class="comment">/*</span>
|
||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt</span><span class="comment"> to change this license</span>
|
||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java</span><span class="comment"> to edit this template</span>
|
||||
<span class="comment"> */</span>
|
||||
<span class="literal">package</span> com.calebfontenot.lab4_calebfontenot;
|
||||
|
||||
<span class="comment">/**</span>
|
||||
<span class="comment"> *</span>
|
||||
<span class="comment"> * </span><span class="ST1">@author</span> <span class="comment">caleb</span>
|
||||
<span class="comment">*/</span>
|
||||
<span class="literal">public</span> <span class="literal">class</span> Debug3 {
|
||||
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST2">main</span>(String[] args)
|
||||
{
|
||||
System.<span class="ST3">out</span>.println((<span class="literal">long</span>)<span class="number">2147483647</span> + <span class="number">1</span>);
|
||||
}
|
||||
}
|
||||
|
||||
</pre></body>
|
||||
</html>
|
44
ZIPs/Lab4/Debug5.html
Normal file
44
ZIPs/Lab4/Debug5.html
Normal file
@ -0,0 +1,44 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Debug5.java</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<style type="text/css">
|
||||
<!--
|
||||
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
table {color: #888888; background-color: #313335; font-family: monospace}
|
||||
.ST1 {color: #808080; font-family: monospace; font-weight: bold}
|
||||
.comment {color: #808080}
|
||||
.whitespace {color: #505050}
|
||||
.ST2 {color: #ffc66d; font-family: monospace; font-style: italic}
|
||||
.ST3 {color: #9876aa; font-family: monospace; font-style: italic}
|
||||
.string {color: #6a8759}
|
||||
.number {color: #6897bb}
|
||||
.ST0 {color: #287bde}
|
||||
.literal {color: #cc7832}
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table width="100%"><tr><td align="center">/home/caleb/NetBeansProjects/ADSV Java/lab4_CalebFontenot/src/main/java/com/calebfontenot/lab4_calebfontenot/Debug5.java</td></tr></table>
|
||||
<pre>
|
||||
<span class="comment">/*</span>
|
||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt</span><span class="comment"> to change this license</span>
|
||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java</span><span class="comment"> to edit this template</span>
|
||||
<span class="comment"> */</span>
|
||||
<span class="literal">package</span> com.calebfontenot.lab4_calebfontenot;
|
||||
|
||||
<span class="comment">/**</span>
|
||||
<span class="comment"> *</span>
|
||||
<span class="comment"> * </span><span class="ST1">@author</span> <span class="comment">caleb</span>
|
||||
<span class="comment">*/</span>
|
||||
<span class="literal">public</span> <span class="literal">class</span> Debug5 {
|
||||
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST2">main</span>(String[] args)
|
||||
{
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">1 + 2 is </span><span class="string">"</span>+ (<span class="number">1</span> + <span class="number">2</span>));
|
||||
}
|
||||
}
|
||||
|
||||
</pre></body>
|
||||
</html>
|
61
ZIPs/Lab4/Lab4_CalebFontenot.html
Normal file
61
ZIPs/Lab4/Lab4_CalebFontenot.html
Normal file
@ -0,0 +1,61 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Lab4_CalebFontenot.java</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<style type="text/css">
|
||||
<!--
|
||||
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
table {color: #888888; background-color: #313335; font-family: monospace}
|
||||
.ST1 {color: #808080; font-family: monospace; font-weight: bold}
|
||||
.comment {color: #808080}
|
||||
.whitespace {color: #505050}
|
||||
.ST2 {color: #ffc66d; font-family: monospace; font-style: italic}
|
||||
.ST3 {color: #9876aa; font-family: monospace; font-style: italic}
|
||||
.string {color: #6a8759}
|
||||
.ST0 {color: #287bde}
|
||||
.literal {color: #cc7832}
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table width="100%"><tr><td align="center">/home/caleb/NetBeansProjects/ADSV Java/lab4_CalebFontenot/src/main/java/com/calebfontenot/lab4_calebfontenot/Lab4_CalebFontenot.java</td></tr></table>
|
||||
<pre>
|
||||
<span class="comment">/*</span>
|
||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt</span><span class="comment"> to change this license</span>
|
||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Project/Maven2/JavaApp/src/main/java/$</span><span class="comment">{packagePath}/${mainClassName}.java to edit this template</span>
|
||||
<span class="comment"> */</span>
|
||||
|
||||
<span class="literal">package</span> com.calebfontenot.lab4_calebfontenot;
|
||||
|
||||
<span class="literal">import</span> java.util.Scanner;
|
||||
|
||||
<span class="comment">/**</span>
|
||||
<span class="comment"> *</span>
|
||||
<span class="comment"> * </span><span class="ST1">@author</span> <span class="comment">caleb</span>
|
||||
<span class="comment">*/</span>
|
||||
<span class="literal">public</span> <span class="literal">class</span> Lab4_CalebFontenot {
|
||||
|
||||
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST2">main</span>(String[] args) {
|
||||
<span class="comment">// Setup Scanner;</span>
|
||||
Scanner input = <span class="literal">new</span> Scanner(System.<span class="ST3">in</span>);
|
||||
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">Enter i, j, x, and y: </span><span class="string">"</span>);
|
||||
<span class="literal">int</span> i = input.nextInt();
|
||||
<span class="literal">int</span> j = input.nextInt();
|
||||
<span class="literal">double</span> x = input.nextDouble();
|
||||
<span class="literal">double</span> y = input.nextDouble();
|
||||
<span class="comment">//int i = 11,</span>
|
||||
<span class="comment">// j = 22;</span>
|
||||
<span class="comment">//double x = 11.11,</span>
|
||||
<span class="comment">// y = 22.22;</span>
|
||||
|
||||
<span class="comment">// Changed addition to division</span>
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="literal">\n</span><span class="string">"</span> + i + <span class="string">"</span><span class="string"> / </span><span class="string">"</span> + j + <span class="string">"</span><span class="string"> = </span><span class="string">"</span> + (i / j));
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="literal">\n</span><span class="string">"</span> + x + <span class="string">"</span><span class="string"> / </span><span class="string">"</span> + y + <span class="string">"</span><span class="string"> = </span><span class="string">"</span> + (x / y));
|
||||
}
|
||||
}
|
||||
|
||||
</pre></body>
|
||||
</html>
|
92
ZIPs/Lab4/payroll.html
Normal file
92
ZIPs/Lab4/payroll.html
Normal file
@ -0,0 +1,92 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>payroll.java</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<style type="text/css">
|
||||
<!--
|
||||
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
table {color: #888888; background-color: #313335; font-family: monospace}
|
||||
.ST1 {color: #808080; font-family: monospace; font-weight: bold}
|
||||
.comment {color: #808080}
|
||||
.whitespace {color: #505050}
|
||||
.ST2 {color: #ffc66d; font-family: monospace; font-style: italic}
|
||||
.ST3 {color: #9876aa; font-family: monospace; font-style: italic}
|
||||
.string {color: #6a8759}
|
||||
.number {color: #6897bb}
|
||||
.ST0 {color: #287bde}
|
||||
.literal {color: #cc7832}
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table width="100%"><tr><td align="center">/home/caleb/NetBeansProjects/ADSV Java/lab4_CalebFontenot/src/main/java/com/calebfontenot/lab4_calebfontenot/payroll.java</td></tr></table>
|
||||
<pre>
|
||||
<span class="comment">/*</span>
|
||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt</span><span class="comment"> to change this license</span>
|
||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java</span><span class="comment"> to edit this template</span>
|
||||
<span class="comment"> */</span>
|
||||
<span class="literal">package</span> com.calebfontenot.lab4_calebfontenot;
|
||||
|
||||
<span class="literal">import</span> java.text.DecimalFormat;
|
||||
<span class="literal">import</span> java.util.Scanner;
|
||||
|
||||
<span class="comment">/**</span>
|
||||
<span class="comment"> *</span>
|
||||
<span class="comment"> * </span><span class="ST1">@author</span> <span class="comment">caleb</span>
|
||||
<span class="comment">*/</span>
|
||||
<span class="literal">public</span> <span class="literal">class</span> payroll {
|
||||
|
||||
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST2">main</span>(String[] args)
|
||||
{
|
||||
<span class="comment">// Create Scanner</span>
|
||||
Scanner input = <span class="literal">new</span> Scanner(System.<span class="ST3">in</span>);
|
||||
|
||||
<span class="comment">// Define vars</span>
|
||||
String employeeName;
|
||||
<span class="literal">double</span> hoursWorked;
|
||||
<span class="literal">double</span> hourlyPayRate;
|
||||
<span class="literal">double</span> federalTaxWithholdingRate;
|
||||
<span class="literal">double</span> stateTaxWithholdingRate;
|
||||
<span class="literal">double</span> grossPay;
|
||||
<span class="literal">double</span> federalWithholding;
|
||||
<span class="literal">double</span> stateWithholding;
|
||||
<span class="literal">double</span> totalDeduction;
|
||||
|
||||
<span class="comment">// Prompt for input</span>
|
||||
System.<span class="ST3">out</span>.print(<span class="string">"</span><span class="string">Enter employee's name: </span><span class="string">"</span>);
|
||||
employeeName = input.next();
|
||||
System.<span class="ST3">out</span>.print(<span class="string">"</span><span class="string">Enter the number of hours worked in a week: </span><span class="string">"</span>);
|
||||
hoursWorked = input.nextDouble();
|
||||
System.<span class="ST3">out</span>.print(<span class="string">"</span><span class="string">Enter the hourly pay rate: $</span><span class="string">"</span>);
|
||||
hourlyPayRate = input.nextDouble();
|
||||
System.<span class="ST3">out</span>.print(<span class="string">"</span><span class="string">Enter the federal tax witholding rate (as a decimal, please!): </span><span class="string">"</span>);
|
||||
federalTaxWithholdingRate = input.nextDouble();
|
||||
System.<span class="ST3">out</span>.print(<span class="string">"</span><span class="string">Enter the state tax withholding rate (as a decimal, please!): </span><span class="string">"</span>);
|
||||
stateTaxWithholdingRate = input.nextDouble();
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">"</span>); <span class="comment">//empty space</span>
|
||||
|
||||
<span class="comment">// Setup Decimal fomatting</span>
|
||||
DecimalFormat df = <span class="literal">new</span> DecimalFormat(<span class="string">"</span><span class="string">#0.00</span><span class="string">"</span>);
|
||||
|
||||
<span class="comment">// Calculate</span>
|
||||
grossPay = (hoursWorked * hourlyPayRate);
|
||||
federalWithholding = (grossPay * federalTaxWithholdingRate);
|
||||
stateWithholding = (grossPay * stateTaxWithholdingRate);
|
||||
totalDeduction = (grossPay - (federalWithholding + stateWithholding));
|
||||
|
||||
<span class="comment">// Print output</span>
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">Employee Name: </span><span class="string">"</span>+employeeName);
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">Hours Worked: </span><span class="string">"</span>+hoursWorked);
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">Pay Rate: $</span><span class="string">"</span>+ df.format(hourlyPayRate));
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">Gross Pay: $</span><span class="string">"</span>+df.format(grossPay));
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">Deductions:</span><span class="string">"</span>);
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="literal">\t</span><span class="string">"</span>+<span class="string">"</span><span class="string">Federal Withholding (</span><span class="string">"</span>+ (federalTaxWithholdingRate * <span class="number">100.0</span>)+<span class="string">"</span><span class="string">%):$</span><span class="string">"</span>+df.format(federalWithholding));
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="literal">\t</span><span class="string">"</span>+<span class="string">"</span><span class="string">State Withholding (</span><span class="string">"</span>+ (stateTaxWithholdingRate * <span class="number">100.0</span>)+<span class="string">"</span><span class="string">%):$</span><span class="string">"</span>+df.format(stateWithholding));
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">Total Deduction: $</span><span class="string">"</span>+df.format(totalDeduction));
|
||||
}
|
||||
}
|
||||
|
||||
</pre></body>
|
||||
</html>
|
BIN
ZIPs/Lab4_CalebFontenot.zip
Normal file
BIN
ZIPs/Lab4_CalebFontenot.zip
Normal file
Binary file not shown.
BIN
ZIPs/Lab5/Lab5_CalebFontenot.zip
Normal file
BIN
ZIPs/Lab5/Lab5_CalebFontenot.zip
Normal file
Binary file not shown.
76
ZIPs/Lab5/Operators.html
Normal file
76
ZIPs/Lab5/Operators.html
Normal file
@ -0,0 +1,76 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Operators.java</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<style type="text/css">
|
||||
<!--
|
||||
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
table {color: #888888; background-color: #313335; font-family: monospace}
|
||||
.ST1 {color: #808080; font-family: monospace; font-weight: bold}
|
||||
.comment {color: #808080}
|
||||
.whitespace {color: #505050}
|
||||
.ST2 {color: #ffc66d; font-family: monospace; font-style: italic}
|
||||
.ST3 {color: #9876aa; font-family: monospace; font-style: italic}
|
||||
.number {color: #6897bb}
|
||||
.string {color: #6a8759}
|
||||
.ST0 {color: #287bde}
|
||||
.literal {color: #cc7832}
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table width="100%"><tr><td align="center">/home/caleb/NetBeansProjects/ADSV Java/lab5_CalebFontenot/src/main/java/com/calebfontenot/lab5_calebfontenot/Operators.java</td></tr></table>
|
||||
<pre>
|
||||
<span class="comment">/*</span>
|
||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt</span><span class="comment"> to change this license</span>
|
||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java</span><span class="comment"> to edit this template</span>
|
||||
<span class="comment"> */</span>
|
||||
<span class="literal">package</span> com.calebfontenot.lab5_calebfontenot;
|
||||
|
||||
<span class="comment">/**</span>
|
||||
<span class="comment"> *</span>
|
||||
<span class="comment"> * </span><span class="ST1">@author</span> <span class="comment">caleb</span>
|
||||
<span class="comment">*/</span>
|
||||
<span class="literal">public</span> <span class="literal">class</span> Operators {
|
||||
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST2">main</span>(String[] args)
|
||||
{
|
||||
<span class="literal">int</span> x = <span class="number">8</span>; <span class="literal">int</span> y = <span class="number">15</span>; <span class="literal">double</span> d = <span class="number">2</span>;
|
||||
|
||||
<span class="comment">//1. Increment x by 2;</span>
|
||||
<span class="comment">//add code here</span>
|
||||
x += <span class="number">2</span>;
|
||||
|
||||
<span class="comment">//2. Increment y by 5 using the += operator</span>
|
||||
<span class="comment">//add code here</span>
|
||||
y += <span class="number">5</span>;
|
||||
|
||||
<span class="comment">//3. Increment d by 1 using the ++ operator</span>
|
||||
<span class="comment">//add code here</span>
|
||||
d++;
|
||||
|
||||
<span class="comment">//4. Modify the expression below to print z1 = 1.5 and not 0.0</span>
|
||||
<span class="literal">double</span> z1 = ((<span class="literal">double</span>) x /(<span class="literal">double</span>) y ) * d++;
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">z1: </span><span class="string">"</span> + z1 );
|
||||
|
||||
<span class="comment">//5. Modify the expresion below the print z2 = 2.5 and not 0.0</span>
|
||||
<span class="literal">double</span> z2 = ((<span class="literal">double</span>) x /(<span class="literal">double</span>) y ) * ++d;
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">z2: </span><span class="string">"</span> + z2 );
|
||||
|
||||
<span class="comment">/* 6. Declare a variable z3 of type double and modify the </span>
|
||||
<span class="comment"> right hand side of the expression you built in step 5 for the</span>
|
||||
<span class="comment"> expression to evaluate 2.0.</span>
|
||||
<span class="comment"> Assign the evaluation to varible z3</span>
|
||||
<span class="comment"> */</span>
|
||||
<span class="literal">double</span> z3 = ((<span class="literal">double</span>) x /(<span class="literal">double</span>) y * (d - <span class="number">1</span>));
|
||||
<span class="comment">//add code here</span>
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">z3: </span><span class="string">"</span>+ z3 );
|
||||
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">x=</span><span class="string">"</span> + x + <span class="string">"</span><span class="string"> y=</span><span class="string">"</span> + y + <span class="string">"</span><span class="string"> d=</span><span class="string">"</span> + d +
|
||||
<span class="string">"</span><span class="string"> z1=</span><span class="string">"</span>+ z1 + <span class="string">"</span><span class="string"> z2=</span><span class="string">"</span> +z2 + <span class="string">"</span><span class="string"> z3=</span><span class="string">"</span> +z3);
|
||||
}
|
||||
}
|
||||
|
||||
</pre></body>
|
||||
</html>
|
64
ZIPs/Lab5/Swap.html
Normal file
64
ZIPs/Lab5/Swap.html
Normal file
@ -0,0 +1,64 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Swap.java</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<style type="text/css">
|
||||
<!--
|
||||
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
table {color: #888888; background-color: #313335; font-family: monospace}
|
||||
.ST1 {color: #808080; font-family: monospace; font-weight: bold}
|
||||
.comment {color: #808080}
|
||||
.whitespace {color: #505050}
|
||||
.ST2 {color: #ffc66d; font-family: monospace; font-style: italic}
|
||||
.ST3 {color: #9876aa; font-family: monospace; font-style: italic}
|
||||
.string {color: #6a8759}
|
||||
.ST0 {color: #287bde}
|
||||
.ST4 {font-family: monospace; font-style: italic}
|
||||
.literal {color: #cc7832}
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table width="100%"><tr><td align="center">/home/caleb/NetBeansProjects/ADSV Java/lab5_CalebFontenot/src/main/java/com/calebfontenot/lab5_calebfontenot/Swap.java</td></tr></table>
|
||||
<pre>
|
||||
<span class="comment">/*</span>
|
||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt</span><span class="comment"> to change this license</span>
|
||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java</span><span class="comment"> to edit this template</span>
|
||||
<span class="comment"> */</span>
|
||||
<span class="literal">package</span> com.calebfontenot.lab5_calebfontenot;
|
||||
|
||||
<span class="literal">import</span> java.util.Scanner;
|
||||
|
||||
<span class="comment">/**</span>
|
||||
<span class="comment"> *</span>
|
||||
<span class="comment"> * </span><span class="ST1">@author</span> <span class="comment">caleb</span>
|
||||
<span class="comment">*/</span>
|
||||
<span class="literal">public</span> <span class="literal">class</span> Swap {
|
||||
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST2">main</span>(String[] args)
|
||||
{
|
||||
<span class="comment">// Create scanner</span>
|
||||
Scanner input = <span class="literal">new</span> Scanner(System.<span class="ST3">in</span>);
|
||||
|
||||
<span class="comment">// Define vars</span>
|
||||
<span class="literal">double</span> base,
|
||||
power,
|
||||
output;
|
||||
|
||||
<span class="comment">// Prompt for input</span>
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">Enter the base to calculate: </span><span class="string">"</span>);
|
||||
base = input.nextDouble();
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">Enter the power to calculate: </span><span class="string">"</span>);
|
||||
power = input.nextDouble();
|
||||
|
||||
<span class="comment">// Calculate</span>
|
||||
output = Math.<span class="ST4">pow</span>(base, power);
|
||||
|
||||
<span class="comment">// Print result</span>
|
||||
System.<span class="ST3">out</span>.println(base+<span class="string">"</span><span class="string">^</span><span class="string">"</span>+power+<span class="string">"</span><span class="string"> = </span><span class="string">"</span>+ output);
|
||||
}
|
||||
}
|
||||
|
||||
</pre></body>
|
||||
</html>
|
59
ZIPs/Lab5/WhatsYourName.html
Normal file
59
ZIPs/Lab5/WhatsYourName.html
Normal file
@ -0,0 +1,59 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>WhatsYourName.java</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<style type="text/css">
|
||||
<!--
|
||||
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
table {color: #888888; background-color: #313335; font-family: monospace}
|
||||
.ST1 {color: #808080; font-family: monospace; font-weight: bold}
|
||||
.comment {color: #808080}
|
||||
.whitespace {color: #505050}
|
||||
.ST2 {color: #ffc66d; font-family: monospace; font-style: italic}
|
||||
.ST3 {color: #9876aa; font-family: monospace; font-style: italic}
|
||||
.string {color: #6a8759}
|
||||
.ST0 {color: #287bde}
|
||||
.literal {color: #cc7832}
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table width="100%"><tr><td align="center">/home/caleb/NetBeansProjects/ADSV Java/lab5_CalebFontenot/src/main/java/com/calebfontenot/lab5_calebfontenot/WhatsYourName.java</td></tr></table>
|
||||
<pre>
|
||||
<span class="comment">/*</span>
|
||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt</span><span class="comment"> to change this license</span>
|
||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java</span><span class="comment"> to edit this template</span>
|
||||
<span class="comment"> */</span>
|
||||
<span class="literal">package</span> com.calebfontenot.lab5_calebfontenot;
|
||||
|
||||
<span class="literal">import</span> java.util.Scanner;
|
||||
|
||||
<span class="comment">/**</span>
|
||||
<span class="comment"> *</span>
|
||||
<span class="comment"> * </span><span class="ST1">@author</span> <span class="comment">caleb</span>
|
||||
<span class="comment">*/</span>
|
||||
<span class="literal">public</span> <span class="literal">class</span> WhatsYourName {
|
||||
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST2">main</span>(String[] args)
|
||||
{
|
||||
<span class="comment">// Create Scanner</span>
|
||||
Scanner input = <span class="literal">new</span> Scanner(System.<span class="ST3">in</span>);
|
||||
|
||||
<span class="comment">// Declare vars</span>
|
||||
String firstName,
|
||||
lastName;
|
||||
|
||||
<span class="comment">// Prompt for input</span>
|
||||
System.<span class="ST3">out</span>.print(<span class="string">"</span><span class="string">What's your name? (Enter first and last) </span><span class="string">"</span>);
|
||||
firstName = input.next();
|
||||
lastName = input.next();
|
||||
|
||||
<span class="comment">// Print output</span>
|
||||
System.<span class="ST3">out</span>.println(firstName + <span class="string">"</span> <span class="string">"</span> + lastName + <span class="string">"</span><span class="string"> is a beautiful name!</span><span class="string">"</span>);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
</pre></body>
|
||||
</html>
|
56
ZIPs/Lab5/WhatsYourSSN.html
Normal file
56
ZIPs/Lab5/WhatsYourSSN.html
Normal file
@ -0,0 +1,56 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>WhatsYourSSN.java</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<style type="text/css">
|
||||
<!--
|
||||
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
table {color: #888888; background-color: #313335; font-family: monospace}
|
||||
.ST1 {color: #808080; font-family: monospace; font-weight: bold}
|
||||
.comment {color: #808080}
|
||||
.whitespace {color: #505050}
|
||||
.ST2 {color: #ffc66d; font-family: monospace; font-style: italic}
|
||||
.ST3 {color: #9876aa; font-family: monospace; font-style: italic}
|
||||
.string {color: #6a8759}
|
||||
.ST0 {color: #287bde}
|
||||
.literal {color: #cc7832}
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table width="100%"><tr><td align="center">/home/caleb/NetBeansProjects/ADSV Java/lab5_CalebFontenot/src/main/java/com/calebfontenot/lab5_calebfontenot/WhatsYourSSN.java</td></tr></table>
|
||||
<pre>
|
||||
<span class="comment">/*</span>
|
||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt</span><span class="comment"> to change this license</span>
|
||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java</span><span class="comment"> to edit this template</span>
|
||||
<span class="comment"> */</span>
|
||||
<span class="literal">package</span> com.calebfontenot.lab5_calebfontenot;
|
||||
|
||||
<span class="literal">import</span> java.util.Scanner;
|
||||
|
||||
<span class="comment">/**</span>
|
||||
<span class="comment"> *</span>
|
||||
<span class="comment"> * </span><span class="ST1">@author</span> <span class="comment">caleb</span>
|
||||
<span class="comment">*/</span>
|
||||
<span class="literal">public</span> <span class="literal">class</span> WhatsYourSSN {
|
||||
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST2">main</span>(String[] args)
|
||||
{
|
||||
<span class="comment">// Create Scanner</span>
|
||||
Scanner input = <span class="literal">new</span> Scanner(System.<span class="ST3">in</span>);
|
||||
|
||||
<span class="comment">// Declare vars</span>
|
||||
String ssn;
|
||||
|
||||
<span class="comment">// Prompt for input</span>
|
||||
System.<span class="ST3">out</span>.print(<span class="string">"</span><span class="string">What's your SSN? </span><span class="string">"</span>);
|
||||
ssn = input.next();
|
||||
|
||||
<span class="comment">// Print output</span>
|
||||
System.<span class="ST3">out</span>.println(ssn + <span class="string">"</span><span class="string"> is your SSN.</span><span class="string">"</span>);
|
||||
}
|
||||
}
|
||||
|
||||
</pre></body>
|
||||
</html>
|
97
ZIPs/LabClass_Sep6_CalebFontenot/ComputeTax.html
Normal file
97
ZIPs/LabClass_Sep6_CalebFontenot/ComputeTax.html
Normal file
@ -0,0 +1,97 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>ComputeTax.java</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<style type="text/css">
|
||||
<!--
|
||||
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
table {color: #888888; background-color: #313335; font-family: monospace}
|
||||
.ST1 {color: #808080; font-family: monospace; font-weight: bold}
|
||||
.comment {color: #808080}
|
||||
.whitespace {color: #505050}
|
||||
.ST2 {color: #ffc66d; font-family: monospace; font-style: italic}
|
||||
.ST3 {color: #9876aa; font-family: monospace; font-style: italic}
|
||||
.string {color: #6a8759}
|
||||
.number {color: #6897bb}
|
||||
.ST0 {color: #287bde}
|
||||
.ST4 {font-family: monospace; font-style: italic}
|
||||
.literal {color: #cc7832}
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table width="100%"><tr><td align="center">/home/caleb/NetBeansProjects/ADSV Java/LabClass_Sep6_CalebFontenot/src/main/java/com/calebfontenot/labclass_sep6_calebfontenot/ComputeTax.java</td></tr></table>
|
||||
<pre>
|
||||
<span class="comment">/*</span>
|
||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt</span><span class="comment"> to change this license</span>
|
||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java</span><span class="comment"> to edit this template</span>
|
||||
<span class="comment"> */</span>
|
||||
<span class="literal">package</span> com.calebfontenot.labclass_sep6_calebfontenot;
|
||||
|
||||
<span class="comment">/**</span>
|
||||
<span class="comment"> *</span>
|
||||
<span class="comment"> * </span><span class="ST1">@author</span> <span class="comment">caleb</span>
|
||||
<span class="comment">*/</span>
|
||||
<span class="literal">import</span> java.util.Scanner;
|
||||
|
||||
<span class="literal">public</span> <span class="literal">class</span> ComputeTax {
|
||||
|
||||
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST2">main</span>(String[] args)
|
||||
{
|
||||
<span class="comment">// Create a Scanner</span>
|
||||
Scanner input = <span class="literal">new</span> Scanner(System.<span class="ST3">in</span>);
|
||||
|
||||
<span class="comment">// Prompt the user to enter filing status</span>
|
||||
System.<span class="ST3">out</span>.print(<span class="string">"</span><span class="string">(0-single filer, 1-married jointly or </span><span class="string">"</span>
|
||||
+ <span class="string">"</span><span class="string">qualifying widow(er), 2-married separately, 3-head of </span><span class="string">"</span>
|
||||
+ <span class="string">"</span><span class="string">household) Enter the filing status: </span><span class="string">"</span>);
|
||||
|
||||
<span class="literal">int</span> status = input.nextInt();
|
||||
|
||||
<span class="comment">// Prompt the user to enter taxable income</span>
|
||||
System.<span class="ST3">out</span>.print(<span class="string">"</span><span class="string">Enter the taxable income: </span><span class="string">"</span>);
|
||||
<span class="literal">double</span> income = input.nextDouble();
|
||||
|
||||
<span class="comment">// Compute tax</span>
|
||||
<span class="literal">double</span> tax = <span class="number">0</span>;
|
||||
|
||||
<span class="literal">if</span> (status == <span class="number">0</span>) { <span class="comment">// Compute tax for single filers</span>
|
||||
<span class="literal">if</span> (income <= <span class="number">8350</span>) {
|
||||
tax = income * <span class="number">0.10</span>;
|
||||
} <span class="literal">else</span> <span class="literal">if</span> (income <= <span class="number">33950</span>) {
|
||||
tax = <span class="number">8350</span> * <span class="number">0.10</span> + (income - <span class="number">8350</span>) * <span class="number">0.15</span>;
|
||||
} <span class="literal">else</span> <span class="literal">if</span> (income <= <span class="number">82250</span>) {
|
||||
tax = <span class="number">8350</span> * <span class="number">0.10</span> + (<span class="number">33950</span> - <span class="number">8350</span>) * <span class="number">0.15</span>
|
||||
+ (income - <span class="number">33950</span>) * <span class="number">0.25</span>;
|
||||
} <span class="literal">else</span> <span class="literal">if</span> (income <= <span class="number">171550</span>) {
|
||||
tax = <span class="number">8350</span> * <span class="number">0.10</span> + (<span class="number">33950</span> - <span class="number">8350</span>) * <span class="number">0.15</span>
|
||||
+ (<span class="number">82250</span> - <span class="number">33950</span>) * <span class="number">0.25</span> + (income - <span class="number">82250</span>) * <span class="number">0.28</span>;
|
||||
} <span class="literal">else</span> <span class="literal">if</span> (income <= <span class="number">372950</span>) {
|
||||
tax = <span class="number">8350</span> * <span class="number">0.10</span> + (<span class="number">33950</span> - <span class="number">8350</span>) * <span class="number">0.15</span>
|
||||
+ (<span class="number">82250</span> - <span class="number">33950</span>) * <span class="number">0.25</span> + (<span class="number">171550</span> - <span class="number">82250</span>) * <span class="number">0.28</span>
|
||||
+ (income - <span class="number">171550</span>) * <span class="number">0.33</span>;
|
||||
} <span class="literal">else</span> {
|
||||
tax = <span class="number">8350</span> * <span class="number">0.10</span> + (<span class="number">33950</span> - <span class="number">8350</span>) * <span class="number">0.15</span>
|
||||
+ (<span class="number">82250</span> - <span class="number">33950</span>) * <span class="number">0.25</span> + (<span class="number">171550</span> - <span class="number">82250</span>) * <span class="number">0.28</span>
|
||||
+ (<span class="number">372950</span> - <span class="number">171550</span>) * <span class="number">0.33</span> + (income - <span class="number">372950</span>) * <span class="number">0.35</span>;
|
||||
}
|
||||
} <span class="literal">else</span> <span class="literal">if</span> (status == <span class="number">1</span>) { <span class="comment">// Compute tax for married file jointly</span>
|
||||
<span class="comment">// Left as exercise in Programming Exercise 3.13</span>
|
||||
} <span class="literal">else</span> <span class="literal">if</span> (status == <span class="number">2</span>) { <span class="comment">// Compute tax for married separately</span>
|
||||
<span class="comment">// Left as exercise in Programming Exercise 3.13</span>
|
||||
} <span class="literal">else</span> <span class="literal">if</span> (status == <span class="number">3</span>) { <span class="comment">// Compute tax for head of household</span>
|
||||
<span class="comment">// Left as exercise in Programming Exercise 3.13</span>
|
||||
} <span class="literal">else</span> {
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">Error: invalid status</span><span class="string">"</span>);
|
||||
System.<span class="ST4">exit</span>(<span class="number">1</span>);
|
||||
}
|
||||
|
||||
<span class="comment">// Display the result</span>
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">Tax is </span><span class="string">"</span> + (<span class="literal">int</span>) (tax * <span class="number">100</span>) / <span class="number">100.0</span>);
|
||||
}
|
||||
}
|
||||
|
||||
</pre></body>
|
||||
</html>
|
BIN
ZIPs/LabClass_Sep6_CalebFontenot/LabClass_Sep6_CalebFontenot.zip
Normal file
BIN
ZIPs/LabClass_Sep6_CalebFontenot/LabClass_Sep6_CalebFontenot.zip
Normal file
Binary file not shown.
57
ZIPs/LabClass_Sep6_CalebFontenot/SimpleIfDemo.html
Normal file
57
ZIPs/LabClass_Sep6_CalebFontenot/SimpleIfDemo.html
Normal file
@ -0,0 +1,57 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>SimpleIfDemo.java</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<style type="text/css">
|
||||
<!--
|
||||
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
table {color: #888888; background-color: #313335; font-family: monospace}
|
||||
.ST1 {color: #808080; font-family: monospace; font-weight: bold}
|
||||
.comment {color: #808080}
|
||||
.whitespace {color: #505050}
|
||||
.ST2 {color: #ffc66d; font-family: monospace; font-style: italic}
|
||||
.ST3 {color: #9876aa; font-family: monospace; font-style: italic}
|
||||
.string {color: #6a8759}
|
||||
.number {color: #6897bb}
|
||||
.ST0 {color: #287bde}
|
||||
.literal {color: #cc7832}
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table width="100%"><tr><td align="center">/home/caleb/NetBeansProjects/ADSV Java/LabClass_Sep6_CalebFontenot/src/main/java/com/calebfontenot/labclass_sep6_calebfontenot/SimpleIfDemo.java</td></tr></table>
|
||||
<pre>
|
||||
<span class="comment">/*</span>
|
||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt</span><span class="comment"> to change this license</span>
|
||||
<span class="comment"> * Click </span><span class="ST0">nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java</span><span class="comment"> to edit this template</span>
|
||||
<span class="comment"> */</span>
|
||||
<span class="literal">package</span> com.calebfontenot.labclass_sep6_calebfontenot;
|
||||
|
||||
<span class="literal">import</span> java.util.Scanner;
|
||||
|
||||
<span class="comment">/**</span>
|
||||
<span class="comment"> *</span>
|
||||
<span class="comment"> * </span><span class="ST1">@author</span> <span class="comment">caleb</span>
|
||||
<span class="comment">*/</span>
|
||||
<span class="literal">public</span> <span class="literal">class</span> SimpleIfDemo {
|
||||
|
||||
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST2">main</span>(String[] args)
|
||||
{
|
||||
Scanner input = <span class="literal">new</span> Scanner(System.<span class="ST3">in</span>);
|
||||
System.<span class="ST3">out</span>.print(<span class="string">"</span><span class="string">Enter an integer: </span><span class="string">"</span>);
|
||||
<span class="literal">int</span> number = input.nextInt();
|
||||
|
||||
<span class="literal">if</span> (number % <span class="number">5</span> == <span class="number">0</span>) {
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">HiFive</span><span class="string">"</span>);
|
||||
}
|
||||
|
||||
<span class="literal">if</span> (number % <span class="number">2</span> == <span class="number">0</span>) {
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">HiEven</span><span class="string">"</span>);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</pre></body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user