lab12 is a butt
modified: .gitignore new file: Assignments/lab11_ForLoop_CalebFontenot/Menu2.html new file: Assignments/lab11_ForLoop_CalebFontenot/MenuDoWhile.html new file: Assignments/lab11_ForLoop_CalebFontenot/MenuFor.html new file: Assignments/lab11_ForLoop_CalebFontenot/build.xml new file: Assignments/lab11_ForLoop_CalebFontenot/manifest.mf new file: Assignments/lab11_ForLoop_CalebFontenot/nbproject/build-impl.xml new file: Assignments/lab11_ForLoop_CalebFontenot/nbproject/genfiles.properties new file: Assignments/lab11_ForLoop_CalebFontenot/nbproject/project.properties new file: Assignments/lab11_ForLoop_CalebFontenot/nbproject/project.xml new file: Assignments/lab11_ForLoop_CalebFontenot/src/lab11_forloop_calebfontenot/Lab11_ForLoop_CalebFontenot.java new file: Assignments/lab11_ForLoop_CalebFontenot/src/lab11_forloop_calebfontenot/Menu2.java new file: Assignments/lab11_ForLoop_CalebFontenot/src/lab11_forloop_calebfontenot/MenuDoWhile.java new file: Assignments/lab11_ForLoop_CalebFontenot/src/lab11_forloop_calebfontenot/MenuFor.java new file: Assignments/lab11_ForLoop_CalebFontenot/src/lab11_forloop_calebfontenot/TestBreak.java new file: Assignments/lab11_ForLoop_CalebFontenot/src/lab11_forloop_calebfontenot/TestContinue.java new file: Assignments/lab11_ForLoop_CalebFontenot/src/lab11_forloop_calebfontenot/TestContinue1.java new file: Assignments/lab12_CalebFontenot/build.xml new file: Assignments/lab12_CalebFontenot/lab12-2-1.pdf new file: Assignments/lab12_CalebFontenot/manifest.mf new file: Assignments/lab12_CalebFontenot/nbproject/build-impl.xml new file: Assignments/lab12_CalebFontenot/nbproject/genfiles.properties new file: Assignments/lab12_CalebFontenot/nbproject/project.properties new file: Assignments/lab12_CalebFontenot/nbproject/project.xml new file: Assignments/lab12_CalebFontenot/src/lab12_calebfontenot/ForNested1.java new file: Assignments/lab12_CalebFontenot/src/lab12_calebfontenot/Lab12_CalebFontenot.java new file: Assignments/lab12_CalebFontenot/src/lab12_calebfontenot/NestedForPatternA.java new file: Assignments/lab12_CalebFontenot/src/lab12_calebfontenot/NestedForPatternB.java new file: Assignments/lab12_CalebFontenot/src/lab12_calebfontenot/NestedWhilePatternC.java new file: Assignments/lab12_CalebFontenot/src/lab12_calebfontenot/WhileNested2.java new file: Assignments/lab12_CalebFontenot/src/lab12_calebfontenot/WhileNested3.java new file: ZIPs/lab11_ForLoop_CalebFontenot.zip
This commit is contained in:
parent
4b777cc8dd
commit
97ebbb64d4
5
.gitignore
vendored
5
.gitignore
vendored
@ -18,3 +18,8 @@
|
||||
/Assignments/InClassOct6th/build/
|
||||
/Assignments/lab11_CalebFontenot/nbproject/private/
|
||||
/Assignments/lab11_CalebFontenot/build/
|
||||
/Assignments/lab11_ForLoop_CalebFontenot/nbproject/private/
|
||||
/Assignments/lab11_ForLoop_CalebFontenot/build/
|
||||
/Assignments/lab12_CalebFontenot/nbproject/private/
|
||||
/Assignments/lab12_CalebFontenot/build/
|
||||
|
||||
|
71
Assignments/lab11_ForLoop_CalebFontenot/Menu2.html
Normal file
71
Assignments/lab11_ForLoop_CalebFontenot/Menu2.html
Normal file
@ -0,0 +1,71 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Menu2.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}
|
||||
.literal {color: #cc7832}
|
||||
.ST4 {font-family: monospace; font-style: italic}
|
||||
.ST0 {color: #287bde}
|
||||
.string {color: #6a8759}
|
||||
.number {color: #6897bb}
|
||||
.comment {color: #808080}
|
||||
.whitespace {color: #505050}
|
||||
.ST2 {color: #ffc66d; font-family: monospace; font-style: italic}
|
||||
.ST3 {color: #9876aa; font-family: monospace; font-style: italic}
|
||||
.ST1 {color: #808080; font-family: monospace; font-weight: bold}
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table width="100%"><tr><td align="center">/home/caleb/ASDV-Java/Assignments/lab11_ForLoop_CalebFontenot/src/lab11_forloop_calebfontenot/Menu2.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> lab11_forloop_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> Menu2 {
|
||||
|
||||
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST2">main</span>(String[] args)
|
||||
{
|
||||
Scanner scan = <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="literal">\n</span><span class="string">Q/q: to quit</span><span class="string">"</span>);
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">1: to calculate the square of a number</span><span class="string">"</span>);
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">2: to calculate the square root of a number</span><span class="string">"</span>);
|
||||
String s = scan.next();<span class="comment">//2. INITIALIZATION OF THE CONDITION</span>
|
||||
|
||||
<span class="literal">while</span> (s.charAt(<span class="number">0</span>) != <span class="string">'</span><span class="string">Q</span><span class="string">'</span> && s.charAt(<span class="number">0</span>) != <span class="string">'</span><span class="string">q</span><span class="string">'</span>)<span class="comment">//1. THE CONDITION</span>
|
||||
{
|
||||
<span class="literal">if</span> (s.charAt(<span class="number">0</span>) == <span class="string">'</span><span class="string">1</span><span class="string">'</span> || s.charAt(<span class="number">0</span>) == <span class="string">'</span><span class="string">2</span><span class="string">'</span>) {
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">enter the number:</span><span class="string">"</span>);
|
||||
<span class="literal">double</span> number = scan.nextDouble();
|
||||
System.<span class="ST3">out</span>.println((s.charAt(<span class="number">0</span>) == <span class="string">'</span><span class="string">1</span><span class="string">'</span>)
|
||||
? <span class="string">"</span><span class="string">the square : </span><span class="string">"</span> + (number * number)
|
||||
: <span class="string">"</span><span class="string">the square root : </span><span class="string">"</span> + Math.<span class="ST4">pow</span>(number, <span class="number">0</span><span class="number">.5</span>));
|
||||
} <span class="literal">else</span> <span class="literal">if</span> (s.charAt(<span class="number">0</span>) != <span class="string">'</span><span class="string">Q</span><span class="string">'</span> && s.charAt(<span class="number">0</span>) != <span class="string">'</span><span class="string">q</span><span class="string">'</span>) {
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">invalid character</span><span class="string">"</span>);
|
||||
}
|
||||
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="literal">\n</span><span class="string">Q/q: to quit</span><span class="string">"</span>);
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">1: to calculate the square of a number</span><span class="string">"</span>);
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">2: to calculate the square root of a number</span><span class="string">"</span>);
|
||||
s = scan.next();<span class="comment">//3.UPDATE OF THE CONDITION</span>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</pre></body>
|
||||
</html>
|
71
Assignments/lab11_ForLoop_CalebFontenot/MenuDoWhile.html
Normal file
71
Assignments/lab11_ForLoop_CalebFontenot/MenuDoWhile.html
Normal file
@ -0,0 +1,71 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>MenuDoWhile.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}
|
||||
.literal {color: #cc7832}
|
||||
.ST4 {font-family: monospace; font-style: italic}
|
||||
.ST0 {color: #287bde}
|
||||
.string {color: #6a8759}
|
||||
.number {color: #6897bb}
|
||||
.comment {color: #808080}
|
||||
.whitespace {color: #505050}
|
||||
.ST2 {color: #ffc66d; font-family: monospace; font-style: italic}
|
||||
.ST3 {color: #9876aa; font-family: monospace; font-style: italic}
|
||||
.ST1 {color: #808080; font-family: monospace; font-weight: bold}
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table width="100%"><tr><td align="center">/home/caleb/ASDV-Java/Assignments/lab11_ForLoop_CalebFontenot/src/lab11_forloop_calebfontenot/MenuDoWhile.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> lab11_forloop_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> MenuDoWhile {
|
||||
|
||||
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST2">main</span>(String[] args)
|
||||
{
|
||||
Scanner scan = <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="literal">\n</span><span class="string">Q/q: to quit</span><span class="string">"</span>);
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">1: to calculate the square of a number</span><span class="string">"</span>);
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">2: to calculate the square root of a number</span><span class="string">"</span>);
|
||||
String s = scan.next();<span class="comment">//2. INITIALIZATION OF THE CONDITION</span>
|
||||
|
||||
<span class="literal">do</span>
|
||||
{
|
||||
<span class="literal">if</span> (s.charAt(<span class="number">0</span>) == <span class="string">'</span><span class="string">1</span><span class="string">'</span> || s.charAt(<span class="number">0</span>) == <span class="string">'</span><span class="string">2</span><span class="string">'</span>) {
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">enter the number:</span><span class="string">"</span>);
|
||||
<span class="literal">double</span> number = scan.nextDouble();
|
||||
System.<span class="ST3">out</span>.println((s.charAt(<span class="number">0</span>) == <span class="string">'</span><span class="string">1</span><span class="string">'</span>)
|
||||
? <span class="string">"</span><span class="string">the square : </span><span class="string">"</span> + (number * number)
|
||||
: <span class="string">"</span><span class="string">the square root : </span><span class="string">"</span> + Math.<span class="ST4">pow</span>(number, <span class="number">0</span><span class="number">.5</span>));
|
||||
} <span class="literal">else</span> <span class="literal">if</span> (s.charAt(<span class="number">0</span>) != <span class="string">'</span><span class="string">Q</span><span class="string">'</span> && s.charAt(<span class="number">0</span>) != <span class="string">'</span><span class="string">q</span><span class="string">'</span>) {
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">invalid character</span><span class="string">"</span>);
|
||||
}
|
||||
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="literal">\n</span><span class="string">Q/q: to quit</span><span class="string">"</span>);
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">1: to calculate the square of a number</span><span class="string">"</span>);
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">2: to calculate the square root of a number</span><span class="string">"</span>);
|
||||
s = scan.next();<span class="comment">//3.UPDATE OF THE CONDITION</span>
|
||||
} <span class="literal">while</span> (s.charAt(<span class="number">0</span>) != <span class="string">'</span><span class="string">Q</span><span class="string">'</span> && s.charAt(<span class="number">0</span>) != <span class="string">'</span><span class="string">q</span><span class="string">'</span>); <span class="comment">//1. THE CONDITION</span>
|
||||
}
|
||||
}
|
||||
|
||||
</pre></body>
|
||||
</html>
|
70
Assignments/lab11_ForLoop_CalebFontenot/MenuFor.html
Normal file
70
Assignments/lab11_ForLoop_CalebFontenot/MenuFor.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>MenuFor.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}
|
||||
.literal {color: #cc7832}
|
||||
.ST4 {font-family: monospace; font-style: italic}
|
||||
.ST0 {color: #287bde}
|
||||
.string {color: #6a8759}
|
||||
.number {color: #6897bb}
|
||||
.comment {color: #808080}
|
||||
.whitespace {color: #505050}
|
||||
.ST2 {color: #ffc66d; font-family: monospace; font-style: italic}
|
||||
.ST3 {color: #9876aa; font-family: monospace; font-style: italic}
|
||||
.ST1 {color: #808080; font-family: monospace; font-weight: bold}
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table width="100%"><tr><td align="center">/home/caleb/ASDV-Java/Assignments/lab11_ForLoop_CalebFontenot/src/lab11_forloop_calebfontenot/MenuFor.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> lab11_forloop_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> MenuFor {
|
||||
|
||||
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST2">main</span>(String[] args)
|
||||
{
|
||||
Scanner scan = <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="literal">\n</span><span class="string">Q/q: to quit</span><span class="string">"</span>);
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">1: to calculate the square of a number</span><span class="string">"</span>);
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">2: to calculate the square root of a number</span><span class="string">"</span>);
|
||||
<span class="literal">for</span> (String s = scan.next();
|
||||
s.charAt(<span class="number">0</span>) != <span class="string">'</span><span class="string">Q</span><span class="string">'</span> && s.charAt(<span class="number">0</span>) != <span class="string">'</span><span class="string">q</span><span class="string">'</span>;
|
||||
s = scan.next())
|
||||
{
|
||||
<span class="literal">if</span> (s.charAt(<span class="number">0</span>) == <span class="string">'</span><span class="string">1</span><span class="string">'</span> || s.charAt(<span class="number">0</span>) == <span class="string">'</span><span class="string">2</span><span class="string">'</span>) {
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">enter the number:</span><span class="string">"</span>);
|
||||
<span class="literal">double</span> number = scan.nextDouble();
|
||||
System.<span class="ST3">out</span>.println((s.charAt(<span class="number">0</span>) == <span class="string">'</span><span class="string">1</span><span class="string">'</span>)
|
||||
? <span class="string">"</span><span class="string">the square : </span><span class="string">"</span> + (number * number)
|
||||
: <span class="string">"</span><span class="string">the square root : </span><span class="string">"</span> + Math.<span class="ST4">pow</span>(number, <span class="number">0</span><span class="number">.5</span>));
|
||||
} <span class="literal">else</span> <span class="literal">if</span> (s.charAt(<span class="number">0</span>) != <span class="string">'</span><span class="string">Q</span><span class="string">'</span> && s.charAt(<span class="number">0</span>) != <span class="string">'</span><span class="string">q</span><span class="string">'</span>) {
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">invalid character</span><span class="string">"</span>);
|
||||
}
|
||||
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="literal">\n</span><span class="string">Q/q: to quit</span><span class="string">"</span>);
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">1: to calculate the square of a number</span><span class="string">"</span>);
|
||||
System.<span class="ST3">out</span>.println(<span class="string">"</span><span class="string">2: to calculate the square root of a number</span><span class="string">"</span>);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</pre></body>
|
||||
</html>
|
73
Assignments/lab11_ForLoop_CalebFontenot/build.xml
Normal file
73
Assignments/lab11_ForLoop_CalebFontenot/build.xml
Normal file
@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- You may freely edit this file. See commented blocks below for -->
|
||||
<!-- some examples of how to customize the build. -->
|
||||
<!-- (If you delete it and reopen the project it will be recreated.) -->
|
||||
<!-- By default, only the Clean and Build commands use this build script. -->
|
||||
<!-- Commands such as Run, Debug, and Test only use this build script if -->
|
||||
<!-- the Compile on Save feature is turned off for the project. -->
|
||||
<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
|
||||
<!-- in the project's Project Properties dialog box.-->
|
||||
<project name="lab11_ForLoop_CalebFontenot" default="default" basedir=".">
|
||||
<description>Builds, tests, and runs the project lab11_ForLoop_CalebFontenot.</description>
|
||||
<import file="nbproject/build-impl.xml"/>
|
||||
<!--
|
||||
|
||||
There exist several targets which are by default empty and which can be
|
||||
used for execution of your tasks. These targets are usually executed
|
||||
before and after some main targets. They are:
|
||||
|
||||
-pre-init: called before initialization of project properties
|
||||
-post-init: called after initialization of project properties
|
||||
-pre-compile: called before javac compilation
|
||||
-post-compile: called after javac compilation
|
||||
-pre-compile-single: called before javac compilation of single file
|
||||
-post-compile-single: called after javac compilation of single file
|
||||
-pre-compile-test: called before javac compilation of JUnit tests
|
||||
-post-compile-test: called after javac compilation of JUnit tests
|
||||
-pre-compile-test-single: called before javac compilation of single JUnit test
|
||||
-post-compile-test-single: called after javac compilation of single JUunit test
|
||||
-pre-jar: called before JAR building
|
||||
-post-jar: called after JAR building
|
||||
-post-clean: called after cleaning build products
|
||||
|
||||
(Targets beginning with '-' are not intended to be called on their own.)
|
||||
|
||||
Example of inserting an obfuscator after compilation could look like this:
|
||||
|
||||
<target name="-post-compile">
|
||||
<obfuscate>
|
||||
<fileset dir="${build.classes.dir}"/>
|
||||
</obfuscate>
|
||||
</target>
|
||||
|
||||
For list of available properties check the imported
|
||||
nbproject/build-impl.xml file.
|
||||
|
||||
|
||||
Another way to customize the build is by overriding existing main targets.
|
||||
The targets of interest are:
|
||||
|
||||
-init-macrodef-javac: defines macro for javac compilation
|
||||
-init-macrodef-junit: defines macro for junit execution
|
||||
-init-macrodef-debug: defines macro for class debugging
|
||||
-init-macrodef-java: defines macro for class execution
|
||||
-do-jar: JAR building
|
||||
run: execution of project
|
||||
-javadoc-build: Javadoc generation
|
||||
test-report: JUnit report generation
|
||||
|
||||
An example of overriding the target for project execution could look like this:
|
||||
|
||||
<target name="run" depends="lab11_ForLoop_CalebFontenot-impl.jar">
|
||||
<exec dir="bin" executable="launcher.exe">
|
||||
<arg file="${dist.jar}"/>
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
Notice that the overridden target depends on the jar target and not only on
|
||||
the compile target as the regular run target does. Again, for a list of available
|
||||
properties which you can use, check the target you are overriding in the
|
||||
nbproject/build-impl.xml file.
|
||||
|
||||
-->
|
||||
</project>
|
3
Assignments/lab11_ForLoop_CalebFontenot/manifest.mf
Normal file
3
Assignments/lab11_ForLoop_CalebFontenot/manifest.mf
Normal file
@ -0,0 +1,3 @@
|
||||
Manifest-Version: 1.0
|
||||
X-COMMENT: Main-Class will be added automatically by build
|
||||
|
1771
Assignments/lab11_ForLoop_CalebFontenot/nbproject/build-impl.xml
Normal file
1771
Assignments/lab11_ForLoop_CalebFontenot/nbproject/build-impl.xml
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,8 @@
|
||||
build.xml.data.CRC32=e3bf3192
|
||||
build.xml.script.CRC32=e7445d80
|
||||
build.xml.stylesheet.CRC32=f85dc8f2@1.104.0.48
|
||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||
nbproject/build-impl.xml.data.CRC32=e3bf3192
|
||||
nbproject/build-impl.xml.script.CRC32=df56be46
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.104.0.48
|
@ -0,0 +1,95 @@
|
||||
annotation.processing.enabled=true
|
||||
annotation.processing.enabled.in.editor=false
|
||||
annotation.processing.processor.options=
|
||||
annotation.processing.processors.list=
|
||||
annotation.processing.run.all.processors=true
|
||||
annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
|
||||
build.classes.dir=${build.dir}/classes
|
||||
build.classes.excludes=**/*.java,**/*.form
|
||||
# This directory is removed when the project is cleaned:
|
||||
build.dir=build
|
||||
build.generated.dir=${build.dir}/generated
|
||||
build.generated.sources.dir=${build.dir}/generated-sources
|
||||
# Only compile against the classpath explicitly listed here:
|
||||
build.sysclasspath=ignore
|
||||
build.test.classes.dir=${build.dir}/test/classes
|
||||
build.test.results.dir=${build.dir}/test/results
|
||||
# Uncomment to specify the preferred debugger connection transport:
|
||||
#debug.transport=dt_socket
|
||||
debug.classpath=\
|
||||
${run.classpath}
|
||||
debug.modulepath=\
|
||||
${run.modulepath}
|
||||
debug.test.classpath=\
|
||||
${run.test.classpath}
|
||||
debug.test.modulepath=\
|
||||
${run.test.modulepath}
|
||||
# Files in build.classes.dir which should be excluded from distribution jar
|
||||
dist.archive.excludes=
|
||||
# This directory is removed when the project is cleaned:
|
||||
dist.dir=dist
|
||||
dist.jar=${dist.dir}/lab11_ForLoop_CalebFontenot.jar
|
||||
dist.javadoc.dir=${dist.dir}/javadoc
|
||||
dist.jlink.dir=${dist.dir}/jlink
|
||||
dist.jlink.output=${dist.jlink.dir}/lab11_ForLoop_CalebFontenot
|
||||
excludes=
|
||||
includes=**
|
||||
jar.compress=false
|
||||
javac.classpath=
|
||||
# Space-separated list of extra javac options
|
||||
javac.compilerargs=
|
||||
javac.deprecation=false
|
||||
javac.external.vm=true
|
||||
javac.modulepath=
|
||||
javac.processormodulepath=
|
||||
javac.processorpath=\
|
||||
${javac.classpath}
|
||||
javac.source=1.8
|
||||
javac.target=1.8
|
||||
javac.test.classpath=\
|
||||
${javac.classpath}:\
|
||||
${build.classes.dir}
|
||||
javac.test.modulepath=\
|
||||
${javac.modulepath}
|
||||
javac.test.processorpath=\
|
||||
${javac.test.classpath}
|
||||
javadoc.additionalparam=
|
||||
javadoc.author=false
|
||||
javadoc.encoding=${source.encoding}
|
||||
javadoc.html5=false
|
||||
javadoc.noindex=false
|
||||
javadoc.nonavbar=false
|
||||
javadoc.notree=false
|
||||
javadoc.private=false
|
||||
javadoc.splitindex=true
|
||||
javadoc.use=true
|
||||
javadoc.version=false
|
||||
javadoc.windowtitle=
|
||||
# The jlink additional root modules to resolve
|
||||
jlink.additionalmodules=
|
||||
# The jlink additional command line parameters
|
||||
jlink.additionalparam=
|
||||
jlink.launcher=true
|
||||
jlink.launcher.name=lab11_ForLoop_CalebFontenot
|
||||
main.class=lab11_forloop_calebfontenot.Lab11_ForLoop_CalebFontenot
|
||||
manifest.file=manifest.mf
|
||||
meta.inf.dir=${src.dir}/META-INF
|
||||
mkdist.disabled=false
|
||||
platform.active=default_platform
|
||||
run.classpath=\
|
||||
${javac.classpath}:\
|
||||
${build.classes.dir}
|
||||
# Space-separated list of JVM arguments used when running the project.
|
||||
# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value.
|
||||
# To set system properties for unit tests define test-sys-prop.name=value:
|
||||
run.jvmargs=
|
||||
run.modulepath=\
|
||||
${javac.modulepath}
|
||||
run.test.classpath=\
|
||||
${javac.test.classpath}:\
|
||||
${build.test.classes.dir}
|
||||
run.test.modulepath=\
|
||||
${javac.test.modulepath}
|
||||
source.encoding=UTF-8
|
||||
src.dir=src
|
||||
test.src.dir=test
|
@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://www.netbeans.org/ns/project/1">
|
||||
<type>org.netbeans.modules.java.j2seproject</type>
|
||||
<configuration>
|
||||
<data xmlns="http://www.netbeans.org/ns/j2se-project/3">
|
||||
<name>lab11_ForLoop_CalebFontenot</name>
|
||||
<source-roots>
|
||||
<root id="src.dir"/>
|
||||
</source-roots>
|
||||
<test-roots>
|
||||
<root id="test.src.dir"/>
|
||||
</test-roots>
|
||||
</data>
|
||||
</configuration>
|
||||
</project>
|
@ -0,0 +1,21 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Main.java to edit this template
|
||||
*/
|
||||
package lab11_forloop_calebfontenot;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author caleb
|
||||
*/
|
||||
public class Lab11_ForLoop_CalebFontenot {
|
||||
|
||||
/**
|
||||
* @param args the command line arguments
|
||||
*/
|
||||
public static void main(String[] args)
|
||||
{
|
||||
// TODO code application logic here
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
/*
|
||||
* 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 lab11_forloop_calebfontenot;
|
||||
|
||||
import java.util.Scanner;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author caleb
|
||||
*/
|
||||
public class Menu2 {
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
Scanner scan = new Scanner(System.in);
|
||||
|
||||
System.out.println("\nQ/q: to quit");
|
||||
System.out.println("1: to calculate the square of a number");
|
||||
System.out.println("2: to calculate the square root of a number");
|
||||
String s = scan.next();//2. INITIALIZATION OF THE CONDITION
|
||||
|
||||
while (s.charAt(0) != 'Q' && s.charAt(0) != 'q')//1. THE CONDITION
|
||||
{
|
||||
if (s.charAt(0) == '1' || s.charAt(0) == '2') {
|
||||
System.out.println("enter the number:");
|
||||
double number = scan.nextDouble();
|
||||
System.out.println((s.charAt(0) == '1')
|
||||
? "the square : " + (number * number)
|
||||
: "the square root : " + Math.pow(number, 0.5));
|
||||
} else if (s.charAt(0) != 'Q' && s.charAt(0) != 'q') {
|
||||
System.out.println("invalid character");
|
||||
}
|
||||
|
||||
System.out.println("\nQ/q: to quit");
|
||||
System.out.println("1: to calculate the square of a number");
|
||||
System.out.println("2: to calculate the square root of a number");
|
||||
s = scan.next();//3.UPDATE OF THE CONDITION
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
/*
|
||||
* 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 lab11_forloop_calebfontenot;
|
||||
|
||||
import java.util.Scanner;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author caleb
|
||||
*/
|
||||
public class MenuDoWhile {
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
Scanner scan = new Scanner(System.in);
|
||||
|
||||
System.out.println("\nQ/q: to quit");
|
||||
System.out.println("1: to calculate the square of a number");
|
||||
System.out.println("2: to calculate the square root of a number");
|
||||
String s = scan.next();//2. INITIALIZATION OF THE CONDITION
|
||||
|
||||
do
|
||||
{
|
||||
if (s.charAt(0) == '1' || s.charAt(0) == '2') {
|
||||
System.out.println("enter the number:");
|
||||
double number = scan.nextDouble();
|
||||
System.out.println((s.charAt(0) == '1')
|
||||
? "the square : " + (number * number)
|
||||
: "the square root : " + Math.pow(number, 0.5));
|
||||
} else if (s.charAt(0) != 'Q' && s.charAt(0) != 'q') {
|
||||
System.out.println("invalid character");
|
||||
}
|
||||
|
||||
System.out.println("\nQ/q: to quit");
|
||||
System.out.println("1: to calculate the square of a number");
|
||||
System.out.println("2: to calculate the square root of a number");
|
||||
s = scan.next();//3.UPDATE OF THE CONDITION
|
||||
} while (s.charAt(0) != 'Q' && s.charAt(0) != 'q'); //1. THE CONDITION
|
||||
}
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
/*
|
||||
* 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 lab11_forloop_calebfontenot;
|
||||
|
||||
import java.util.Scanner;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author caleb
|
||||
*/
|
||||
public class MenuFor {
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
Scanner scan = new Scanner(System.in);
|
||||
|
||||
System.out.println("\nQ/q: to quit");
|
||||
System.out.println("1: to calculate the square of a number");
|
||||
System.out.println("2: to calculate the square root of a number");
|
||||
for (String s = scan.next();
|
||||
s.charAt(0) != 'Q' && s.charAt(0) != 'q';
|
||||
s = scan.next())
|
||||
{
|
||||
if (s.charAt(0) == '1' || s.charAt(0) == '2') {
|
||||
System.out.println("enter the number:");
|
||||
double number = scan.nextDouble();
|
||||
System.out.println((s.charAt(0) == '1')
|
||||
? "the square : " + (number * number)
|
||||
: "the square root : " + Math.pow(number, 0.5));
|
||||
} else if (s.charAt(0) != 'Q' && s.charAt(0) != 'q') {
|
||||
System.out.println("invalid character");
|
||||
}
|
||||
|
||||
System.out.println("\nQ/q: to quit");
|
||||
System.out.println("1: to calculate the square of a number");
|
||||
System.out.println("2: to calculate the square root of a number");
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
/*
|
||||
* 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 lab11_forloop_calebfontenot;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author caleb
|
||||
*/
|
||||
public class TestBreak {
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
int count = 0;
|
||||
int sum = 0;
|
||||
while (true) {
|
||||
while (count <= 100000000) {
|
||||
count ++;
|
||||
sum += count;
|
||||
if (sum >= 100) {
|
||||
System.out.println(count + ", " + sum);
|
||||
break;
|
||||
}
|
||||
count++;
|
||||
}
|
||||
if (sum >= 200) {
|
||||
break;
|
||||
}
|
||||
System.out.println(count + ", " + sum);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
/*
|
||||
* 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 lab11_forloop_calebfontenot;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author caleb
|
||||
*/
|
||||
public class TestContinue {
|
||||
public static void main(String[] args)
|
||||
{
|
||||
for (int i=0; i < 10; ++i) {
|
||||
System.out.println(i + " ");
|
||||
if (i % 2 == 0)
|
||||
continue;
|
||||
System.out.println(i * 2 + " ");
|
||||
}
|
||||
System.out.println("");
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
/*
|
||||
* 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 lab11_forloop_calebfontenot;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author caleb
|
||||
*/
|
||||
public class TestContinue1 {
|
||||
public static void main(String[] args)
|
||||
{
|
||||
int i=0;
|
||||
while (i < 10) {
|
||||
System.out.println(i + " ");
|
||||
if (i % 2 == 0) {
|
||||
++i;
|
||||
continue;
|
||||
}
|
||||
System.out.println(i * 2 + " ");
|
||||
}
|
||||
System.out.println("");
|
||||
++i;
|
||||
}
|
||||
}
|
73
Assignments/lab12_CalebFontenot/build.xml
Normal file
73
Assignments/lab12_CalebFontenot/build.xml
Normal file
@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- You may freely edit this file. See commented blocks below for -->
|
||||
<!-- some examples of how to customize the build. -->
|
||||
<!-- (If you delete it and reopen the project it will be recreated.) -->
|
||||
<!-- By default, only the Clean and Build commands use this build script. -->
|
||||
<!-- Commands such as Run, Debug, and Test only use this build script if -->
|
||||
<!-- the Compile on Save feature is turned off for the project. -->
|
||||
<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
|
||||
<!-- in the project's Project Properties dialog box.-->
|
||||
<project name="lab12_CalebFontenot" default="default" basedir=".">
|
||||
<description>Builds, tests, and runs the project lab12_CalebFontenot.</description>
|
||||
<import file="nbproject/build-impl.xml"/>
|
||||
<!--
|
||||
|
||||
There exist several targets which are by default empty and which can be
|
||||
used for execution of your tasks. These targets are usually executed
|
||||
before and after some main targets. They are:
|
||||
|
||||
-pre-init: called before initialization of project properties
|
||||
-post-init: called after initialization of project properties
|
||||
-pre-compile: called before javac compilation
|
||||
-post-compile: called after javac compilation
|
||||
-pre-compile-single: called before javac compilation of single file
|
||||
-post-compile-single: called after javac compilation of single file
|
||||
-pre-compile-test: called before javac compilation of JUnit tests
|
||||
-post-compile-test: called after javac compilation of JUnit tests
|
||||
-pre-compile-test-single: called before javac compilation of single JUnit test
|
||||
-post-compile-test-single: called after javac compilation of single JUunit test
|
||||
-pre-jar: called before JAR building
|
||||
-post-jar: called after JAR building
|
||||
-post-clean: called after cleaning build products
|
||||
|
||||
(Targets beginning with '-' are not intended to be called on their own.)
|
||||
|
||||
Example of inserting an obfuscator after compilation could look like this:
|
||||
|
||||
<target name="-post-compile">
|
||||
<obfuscate>
|
||||
<fileset dir="${build.classes.dir}"/>
|
||||
</obfuscate>
|
||||
</target>
|
||||
|
||||
For list of available properties check the imported
|
||||
nbproject/build-impl.xml file.
|
||||
|
||||
|
||||
Another way to customize the build is by overriding existing main targets.
|
||||
The targets of interest are:
|
||||
|
||||
-init-macrodef-javac: defines macro for javac compilation
|
||||
-init-macrodef-junit: defines macro for junit execution
|
||||
-init-macrodef-debug: defines macro for class debugging
|
||||
-init-macrodef-java: defines macro for class execution
|
||||
-do-jar: JAR building
|
||||
run: execution of project
|
||||
-javadoc-build: Javadoc generation
|
||||
test-report: JUnit report generation
|
||||
|
||||
An example of overriding the target for project execution could look like this:
|
||||
|
||||
<target name="run" depends="lab12_CalebFontenot-impl.jar">
|
||||
<exec dir="bin" executable="launcher.exe">
|
||||
<arg file="${dist.jar}"/>
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
Notice that the overridden target depends on the jar target and not only on
|
||||
the compile target as the regular run target does. Again, for a list of available
|
||||
properties which you can use, check the target you are overriding in the
|
||||
nbproject/build-impl.xml file.
|
||||
|
||||
-->
|
||||
</project>
|
BIN
Assignments/lab12_CalebFontenot/lab12-2-1.pdf
Normal file
BIN
Assignments/lab12_CalebFontenot/lab12-2-1.pdf
Normal file
Binary file not shown.
3
Assignments/lab12_CalebFontenot/manifest.mf
Normal file
3
Assignments/lab12_CalebFontenot/manifest.mf
Normal file
@ -0,0 +1,3 @@
|
||||
Manifest-Version: 1.0
|
||||
X-COMMENT: Main-Class will be added automatically by build
|
||||
|
1771
Assignments/lab12_CalebFontenot/nbproject/build-impl.xml
Normal file
1771
Assignments/lab12_CalebFontenot/nbproject/build-impl.xml
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,8 @@
|
||||
build.xml.data.CRC32=17a8d3a4
|
||||
build.xml.script.CRC32=a9e1d374
|
||||
build.xml.stylesheet.CRC32=f85dc8f2@1.104.0.48
|
||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||
nbproject/build-impl.xml.data.CRC32=17a8d3a4
|
||||
nbproject/build-impl.xml.script.CRC32=c0af7950
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.104.0.48
|
95
Assignments/lab12_CalebFontenot/nbproject/project.properties
Normal file
95
Assignments/lab12_CalebFontenot/nbproject/project.properties
Normal file
@ -0,0 +1,95 @@
|
||||
annotation.processing.enabled=true
|
||||
annotation.processing.enabled.in.editor=false
|
||||
annotation.processing.processor.options=
|
||||
annotation.processing.processors.list=
|
||||
annotation.processing.run.all.processors=true
|
||||
annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
|
||||
build.classes.dir=${build.dir}/classes
|
||||
build.classes.excludes=**/*.java,**/*.form
|
||||
# This directory is removed when the project is cleaned:
|
||||
build.dir=build
|
||||
build.generated.dir=${build.dir}/generated
|
||||
build.generated.sources.dir=${build.dir}/generated-sources
|
||||
# Only compile against the classpath explicitly listed here:
|
||||
build.sysclasspath=ignore
|
||||
build.test.classes.dir=${build.dir}/test/classes
|
||||
build.test.results.dir=${build.dir}/test/results
|
||||
# Uncomment to specify the preferred debugger connection transport:
|
||||
#debug.transport=dt_socket
|
||||
debug.classpath=\
|
||||
${run.classpath}
|
||||
debug.modulepath=\
|
||||
${run.modulepath}
|
||||
debug.test.classpath=\
|
||||
${run.test.classpath}
|
||||
debug.test.modulepath=\
|
||||
${run.test.modulepath}
|
||||
# Files in build.classes.dir which should be excluded from distribution jar
|
||||
dist.archive.excludes=
|
||||
# This directory is removed when the project is cleaned:
|
||||
dist.dir=dist
|
||||
dist.jar=${dist.dir}/lab12_CalebFontenot.jar
|
||||
dist.javadoc.dir=${dist.dir}/javadoc
|
||||
dist.jlink.dir=${dist.dir}/jlink
|
||||
dist.jlink.output=${dist.jlink.dir}/lab12_CalebFontenot
|
||||
excludes=
|
||||
includes=**
|
||||
jar.compress=false
|
||||
javac.classpath=
|
||||
# Space-separated list of extra javac options
|
||||
javac.compilerargs=
|
||||
javac.deprecation=false
|
||||
javac.external.vm=true
|
||||
javac.modulepath=
|
||||
javac.processormodulepath=
|
||||
javac.processorpath=\
|
||||
${javac.classpath}
|
||||
javac.source=1.8
|
||||
javac.target=1.8
|
||||
javac.test.classpath=\
|
||||
${javac.classpath}:\
|
||||
${build.classes.dir}
|
||||
javac.test.modulepath=\
|
||||
${javac.modulepath}
|
||||
javac.test.processorpath=\
|
||||
${javac.test.classpath}
|
||||
javadoc.additionalparam=
|
||||
javadoc.author=false
|
||||
javadoc.encoding=${source.encoding}
|
||||
javadoc.html5=false
|
||||
javadoc.noindex=false
|
||||
javadoc.nonavbar=false
|
||||
javadoc.notree=false
|
||||
javadoc.private=false
|
||||
javadoc.splitindex=true
|
||||
javadoc.use=true
|
||||
javadoc.version=false
|
||||
javadoc.windowtitle=
|
||||
# The jlink additional root modules to resolve
|
||||
jlink.additionalmodules=
|
||||
# The jlink additional command line parameters
|
||||
jlink.additionalparam=
|
||||
jlink.launcher=true
|
||||
jlink.launcher.name=lab12_CalebFontenot
|
||||
main.class=lab12_calebfontenot.Lab12_CalebFontenot
|
||||
manifest.file=manifest.mf
|
||||
meta.inf.dir=${src.dir}/META-INF
|
||||
mkdist.disabled=false
|
||||
platform.active=default_platform
|
||||
run.classpath=\
|
||||
${javac.classpath}:\
|
||||
${build.classes.dir}
|
||||
# Space-separated list of JVM arguments used when running the project.
|
||||
# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value.
|
||||
# To set system properties for unit tests define test-sys-prop.name=value:
|
||||
run.jvmargs=
|
||||
run.modulepath=\
|
||||
${javac.modulepath}
|
||||
run.test.classpath=\
|
||||
${javac.test.classpath}:\
|
||||
${build.test.classes.dir}
|
||||
run.test.modulepath=\
|
||||
${javac.test.modulepath}
|
||||
source.encoding=UTF-8
|
||||
src.dir=src
|
||||
test.src.dir=test
|
15
Assignments/lab12_CalebFontenot/nbproject/project.xml
Normal file
15
Assignments/lab12_CalebFontenot/nbproject/project.xml
Normal file
@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://www.netbeans.org/ns/project/1">
|
||||
<type>org.netbeans.modules.java.j2seproject</type>
|
||||
<configuration>
|
||||
<data xmlns="http://www.netbeans.org/ns/j2se-project/3">
|
||||
<name>lab12_CalebFontenot</name>
|
||||
<source-roots>
|
||||
<root id="src.dir"/>
|
||||
</source-roots>
|
||||
<test-roots>
|
||||
<root id="test.src.dir"/>
|
||||
</test-roots>
|
||||
</data>
|
||||
</configuration>
|
||||
</project>
|
@ -0,0 +1,24 @@
|
||||
/*
|
||||
* 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 lab12_calebfontenot;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author caleb
|
||||
*/
|
||||
public class ForNested1 {
|
||||
public static void main(String[] args)
|
||||
{
|
||||
for (int i = 0; i < 3; ++i)
|
||||
{
|
||||
System.out.print("(i, j) = ");
|
||||
for (int j = 0; j < 4; ++j)
|
||||
{
|
||||
System.out.print("(" + i + ", " + j + ") ");
|
||||
}
|
||||
System.out.println("");
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Main.java to edit this template
|
||||
*/
|
||||
package lab12_calebfontenot;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author caleb
|
||||
*/
|
||||
public class Lab12_CalebFontenot {
|
||||
|
||||
/**
|
||||
* @param args the command line arguments
|
||||
*/
|
||||
public static void main(String[] args)
|
||||
{
|
||||
// TODO code application logic here
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* 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 lab12_calebfontenot;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author caleb
|
||||
*/
|
||||
public class NestedForPatternA {
|
||||
public static void main(String[] args)
|
||||
{
|
||||
/*
|
||||
String line = "";
|
||||
//First for loop
|
||||
for (int i = 1; i <= 6; ++i)
|
||||
{
|
||||
line = line + " " + i;
|
||||
System.out.println(line);
|
||||
}
|
||||
*/
|
||||
for (int i = 1; i < 7; i++) {
|
||||
for (int j = 1; j < i + 1; j++) {
|
||||
System.out.print(j + " ");
|
||||
}
|
||||
System.out.println();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* 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 lab12_calebfontenot;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author caleb
|
||||
*/
|
||||
public class NestedForPatternB {
|
||||
public static void main(String[] args)
|
||||
{
|
||||
/*
|
||||
String line = "";
|
||||
//First for loop
|
||||
for (int i = 1; i <= 6; ++i)
|
||||
{
|
||||
line = line + " " + i;
|
||||
System.out.println(line);
|
||||
}
|
||||
*/
|
||||
for (int i = 6; i > 0; i--) {
|
||||
for (int j = 1; j < i + 1; j++) {
|
||||
System.out.print(j + " ");
|
||||
}
|
||||
System.out.println();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
/*
|
||||
* 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 lab12_calebfontenot;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author caleb
|
||||
*/
|
||||
public class NestedWhilePatternC {
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
int int1 = 1, int2, int3;
|
||||
while (int1 <= 6) {
|
||||
System.out.print(int1 + ": ");
|
||||
System.out.print("6 5 4 3 2 1");
|
||||
int2 = 1;
|
||||
while (int2 != int1) {
|
||||
System.out.print("\b\b");
|
||||
int2++;
|
||||
}
|
||||
System.out.println();
|
||||
int1++;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
/*
|
||||
* 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 lab12_calebfontenot;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author caleb
|
||||
*/
|
||||
public class WhileNested2 {
|
||||
public static void main(String[] args)
|
||||
{
|
||||
int i = 0;
|
||||
while (i < 3)
|
||||
{
|
||||
System.out.print("(i, j) = ");
|
||||
for (int j = 0; j < 4; ++j)
|
||||
System.out.print("(" + i + ", " + j + ") ");
|
||||
System.out.println("");
|
||||
++i;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
/*
|
||||
* 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 lab12_calebfontenot;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author caleb
|
||||
*/
|
||||
public class WhileNested3 {
|
||||
public static void main(String[] args)
|
||||
{
|
||||
for (int i = 0; i < 3; ++i)
|
||||
{
|
||||
System.out.print("(i, j) = ");
|
||||
for (int j = 0; j < 4; ++j)
|
||||
System.out.print("(" + i + ", " + j + ") ");
|
||||
System.out.println("");
|
||||
}
|
||||
}
|
||||
}
|
BIN
ZIPs/lab11_ForLoop_CalebFontenot.zip
Normal file
BIN
ZIPs/lab11_ForLoop_CalebFontenot.zip
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user