diff --git a/ch04/HelloMethod.java b/ch04/HelloMethod.java
new file mode 100644
index 0000000..d0e9568
--- /dev/null
+++ b/ch04/HelloMethod.java
@@ -0,0 +1,33 @@
+public class HelloMethod
+{
+ public static void main(String[] args)
+ {
+ String firstName = "Amanda";
+ String secondName = "Wilma";
+ String lastName = "Flinestone";
+ String cat = " meow!";
+
+
+ printHelloWorld(firstName, lastName);
+ printOhNo(cat);
+ printHelloWorld(secondName, lastName);
+ printOhNo(cat);
+
+
+ }
+
+
+ public static void printHelloWorld(String fname, String lName)
+ {
+ System.out.println("Hello World " + fname + " " + lName);
+
+ }
+
+ public static void printOhNo(String cat)
+ {
+ System.out.println("Oh no!!!!!!!!!!!" + cat);
+ }
+}
+
+
+
diff --git a/ch05/.idea/misc.xml b/ch05/.idea/misc.xml
new file mode 100644
index 0000000..e208459
--- /dev/null
+++ b/ch05/.idea/misc.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ch05/.idea/modules.xml b/ch05/.idea/modules.xml
new file mode 100644
index 0000000..8aa42e1
--- /dev/null
+++ b/ch05/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ch05/.idea/vcs.xml b/ch05/.idea/vcs.xml
new file mode 100644
index 0000000..6c0b863
--- /dev/null
+++ b/ch05/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ch05/.idea/workspace.xml b/ch05/.idea/workspace.xml
new file mode 100644
index 0000000..069ed88
--- /dev/null
+++ b/ch05/.idea/workspace.xml
@@ -0,0 +1,509 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1532637694391
+
+
+ 1532637694391
+
+
+ 1532639652248
+
+
+
+ 1532639652248
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1.8
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ch05/Comparison.java b/ch05/Comparison.java
new file mode 100644
index 0000000..db6a5c9
--- /dev/null
+++ b/ch05/Comparison.java
@@ -0,0 +1,24 @@
+public class Comparison
+
+{
+ public static void main(String[] args)
+ {
+ String txt = "Fantastic";
+ String lang = "Java";
+
+ boolean state = (txt == lang);
+ System.out.println("String Equality Test: " + state);
+
+ state = (txt != lang);
+ System.out.println("String Equality Test: " + state);
+
+ int dozen = 12;
+ int score = 20;
+ state = (dozen > score);
+ System.out.println("Greater Than Test: " + state);
+
+ state = (dozen < score);
+ System.out.println("Greater Than Test: " + state);
+
+ }
+}
diff --git a/ch05/Condition.java b/ch05/Condition.java
new file mode 100644
index 0000000..a754ee9
--- /dev/null
+++ b/ch05/Condition.java
@@ -0,0 +1,14 @@
+public class Condition
+{
+ public static void main(String[] args)
+ {
+ int num1 = 1357;
+ int num2 = 2468;
+
+ String result = (num1% 2!= 0) ? " Odd" : "Even";
+ System.out.println(num1 + " is " + result);
+
+
+
+ }
+}
diff --git a/ch05/CrazyEds.java b/ch05/CrazyEds.java
new file mode 100644
index 0000000..08f8026
--- /dev/null
+++ b/ch05/CrazyEds.java
@@ -0,0 +1,48 @@
+import java.util.Scanner;
+
+public class CrazyEds
+
+{
+ public static void main(String[] args)
+ {
+ Scanner scanner = new Scanner(System.in);
+ System.out.println("What size of cheese?");
+
+ int diameter = scanner.nextInt();
+ System.out.println("How many yard of cheese?");
+ int theirYards = scanner.nextInt();
+ cheeseSize(diameter, theirYards);
+ }
+
+ public static void cheeseSize (int diameter, int theirYards )
+
+
+ {
+ switch (diameter)
+ {
+ case 1:
+ if (theirYards < 50)
+ System.out.println("Your price will be:" + "$" +(((theirYards * 2)*2 ) + 5));
+ else
+ System.out.println("Your price will be:" + "$" +((diameter ) + (theirYards * 2) + 5));
+ break;
+ case 2:
+ if (theirYards < 75)
+ System.out.println("Your price will be:" + "$" +( ((theirYards * 4)*2 ) + 5));
+ else
+ System.out.println("Your price will be:" + "$" +((theirYards * 2) + 5));
+ break;
+ case 3:
+ if (theirYards < 25)
+ System.out.println("Your price will be:" + "$" +( ((theirYards *6)*4)+ 5));
+ else
+ System.out.println("Your price will be:" + "$" +((theirYards * 6) + 5));
+ break;
+ default:
+ System.out.println("That order is too crazy!!");
+ }
+ }
+
+ }
+
+
diff --git a/ch05/Else.java b/ch05/Else.java
new file mode 100644
index 0000000..2f5336d
--- /dev/null
+++ b/ch05/Else.java
@@ -0,0 +1,19 @@
+public class Else
+{
+ public static void main(String[] args)
+ {
+ int hrs = 20;
+ if (hrs < 13)
+ {
+ System.out.println("Good Morning " + hrs);
+ } else
+ {
+
+ System.out.println(" Good evening: " + hrs);
+ }
+
+ }
+}
+
+
+
diff --git a/ch05/If.java b/ch05/If.java
new file mode 100644
index 0000000..c7a4804
--- /dev/null
+++ b/ch05/If.java
@@ -0,0 +1,14 @@
+public class If
+{
+ public static void main(String[] args)
+ {
+ if (5 > 1) System.out.println("Five is greater than one.");
+
+ if (2 < 4) System.out.println("Two is less than four.");
+ System.out.println("Test succeeded." +
+ "");
+ int num = 7;
+ if((( num>5) && (num< 10)) || ( num == 12)) System.out.println("Number is 6-9 inclusive, or 12");
+
+ }
+}
diff --git a/ch05/Logic.java b/ch05/Logic.java
new file mode 100644
index 0000000..4d0b666
--- /dev/null
+++ b/ch05/Logic.java
@@ -0,0 +1,23 @@
+public class Logic
+{
+ public static void main(String[] args)
+ {
+ boolean yes = true;
+ boolean no = false;
+
+ System.out.println("Both YesYes True: " + ( yes && yes));
+ System.out.println("Both YesNo True: " + ( yes && no));
+
+ System.out.println("Either YesYes True: " + ( yes || yes));
+ System.out.println("Either YesNo True: " + ( yes || no));
+ System.out.println("Either NoNo True: " + ( no || no));
+
+ System.out.println("Original Yes Value: " + yes);
+ System.out.println("Inverse Yes Value: " + !yes);
+
+
+
+ }
+
+
+}
diff --git a/ch05/LogicMethods.java b/ch05/LogicMethods.java
new file mode 100644
index 0000000..4a92c95
--- /dev/null
+++ b/ch05/LogicMethods.java
@@ -0,0 +1,81 @@
+import java.util.Scanner;
+
+public class LogicMethods
+{
+ public static void main(String[] args)
+ {
+ int num;
+
+ printIsLarge(120);
+ printIsLarge(23);
+ printIsLarge(140);
+ printIsLarge(45);
+ printIsLarge(234);
+ printLargest(7, 25);
+ printLargest(6, 11);
+ printLargest(6, 6);
+ printLargestOdd(10, 8);
+ printLargestOdd(7, 13);
+ printLargestOdd(27,35);
+ }
+
+ public static void printIsLarge(int num)
+
+ {
+ if ((num > 99)) System.out.println("The number is large");
+
+
+ int number;
+ printIsLargeOrSmall(112);
+ printIsLargeOrSmall(8);
+ printIsLargeOrSmall(234);
+ }
+
+ public static void printIsLargeOrSmall(int number)
+ {
+ if ((number > 99)) System.out.println("The number is large");
+
+ if ((number < 10)) System.out.println("The number is small");
+ }
+
+ public static void printLargest(int number1, int number2)
+ {
+
+
+ if ((number1 > number2)) System.out.println("The largest number is:" + number1);
+
+ if ((number1 < number2)) System.out.println("The largest number is: " + number2);
+
+ if ((number1 == number2)) System.out.println("The numbers are equal ");
+
+ }
+
+ public static void printLargestOdd(int number1, int number2)
+
+ {
+ if ((number1 > number2) && (number1 % 2 != 0))
+ {
+ System.out.println("The largest odd number is: " + number1);
+
+ } else if (((number1 < number2) && (number2 % 2 != 0)))
+ {
+ System.out.println("The The largest odd number is: " + number2);
+
+ } else if ((number1 % 2 == 0) && (number2 % 2 == 0))
+
+ {
+ System.out.println("Neither number is odd");
+
+ } if ((number1 % 2 != 0) && (number2 % 2 != 0))
+
+ {
+ System.out.println("Two odds make an even " + (number1 + number2));
+ }
+ }
+}
+
+
+
+
+
+
diff --git a/ch05/Precedence.java b/ch05/Precedence.java
new file mode 100644
index 0000000..76760f9
--- /dev/null
+++ b/ch05/Precedence.java
@@ -0,0 +1,15 @@
+public class Precedence
+{
+ public static void main(String[] args)
+ {
+ int sum = 32 - 8 + 16 * 2; // 16 x 2 = 32, + 24 = 56
+ System.out.println(" Default order: "+ sum);
+
+ sum = (32 - 8 + 16) * 2; // 24 + 16 + 40, X 2 = 80
+ System.out.println("Specified order:" + sum);
+
+ sum = (32- (8 + 16)* 2); // 32 - 24 = 8, * 2 = 16
+ System.out.println("Nested specific order:" + sum);
+
+ }
+}
diff --git a/ch05/Switch.java b/ch05/Switch.java
new file mode 100644
index 0000000..040aad4
--- /dev/null
+++ b/ch05/Switch.java
@@ -0,0 +1,16 @@
+public class Switch
+{
+ public static void main(String[] args)
+ {
+ int month = 2, year = 2016, num = 31;
+
+ switch (month)
+ {
+ case 4: case 6: case 9: case 11: num = 30; break;
+
+ case 2: num =( year%4 == 0 ) ? 29: 28; break;
+
+ }
+ System.out.println( month + "/" + year + ": " + num + " days");
+ }
+}
diff --git a/ch05/SwitchExample.java b/ch05/SwitchExample.java
new file mode 100644
index 0000000..fd2faab
--- /dev/null
+++ b/ch05/SwitchExample.java
@@ -0,0 +1,66 @@
+public class SwitchExample
+{
+ public static void main(String[] args)
+ {
+ lastNameWinner("Smith");
+ lastNameWinner("Chandler");
+ lastNameWinner("Lazenby");
+ dayOfWeek(4);
+ dayOfWeek(9);
+ }
+
+ String lastName;
+
+
+ public static void lastNameWinner(String lastName)
+ {
+ switch (lastName)
+ {
+ case "Smith":
+ System.out.println("Congratulations, grand winner.");
+ break;
+ case "Jones":
+ System.out.println("Congratulations, grand winner");
+ break;
+ case "Lazenby":
+ System.out.println("Hey, he owes me dinner.");
+ break;
+ default:
+ System.out.println("Sorry, not a winner");
+ }
+ }
+
+ int value;
+
+
+ public static void dayOfWeek(int value)
+ {
+ switch (value)
+ {
+ case 1:
+ System.out.println("Sunday");
+ break;
+ case 2:
+ System.out.println("Monday");
+ break;
+ case 3:
+ System.out.println("Tuesday");
+ break;
+ case 4:
+ System.out.println("Wednesday");
+ break;
+ case 5:
+ System.out.println("Thursday");
+ break;
+ case 6:
+ System.out.println("Friday");
+ case 7:
+ System.out.println("Saturday");
+ break;
+ default:
+ System.out.println("Invalid value:" + value);
+ }
+ }
+}
+
+
diff --git a/ch05/ch05.iml b/ch05/ch05.iml
new file mode 100644
index 0000000..b107a2d
--- /dev/null
+++ b/ch05/ch05.iml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ch05/printIsLargeOrSmall.java b/ch05/printIsLargeOrSmall.java
new file mode 100644
index 0000000..bd8b546
--- /dev/null
+++ b/ch05/printIsLargeOrSmall.java
@@ -0,0 +1,17 @@
+public class printIsLargeOrSmall
+{
+ public static void main(String[] args)
+ {
+ int number;
+ printIsLargeOrSmall(112);
+ printIsLargeOrSmall(8);
+ printIsLargeOrSmall(234);
+ }
+
+ public static void printIsLargeOrSmall (int number)
+ {
+ if ((number > 99)) System.out.println("The number is large");
+
+ if ((number < 10)) System.out.println("The number is small");
+ }
+}