From 4e9c30f884b714169d45ad9fbedf4cd04d90eca2 Mon Sep 17 00:00:00 2001 From: Alvin Kuang Date: Sun, 1 Mar 2015 14:51:43 -0500 Subject: [PATCH 01/25] Update 2015-03-01.md --- 2015-03-01.md | 1 + 1 file changed, 1 insertion(+) diff --git a/2015-03-01.md b/2015-03-01.md index b89c523..499f875 100644 --- a/2015-03-01.md +++ b/2015-03-01.md @@ -18,6 +18,7 @@ These are all included in the JDK. The JRE only contains the JVM and standard l * JDK = Java Development Kit * JRE = Java Runtime Environment +* - used primarily for RUNNING java programs, but does NOT allow for developing * runtime = The point at which a program is run, as opposed to the point at which it is created. From eb6ca9ab172320f165e65a0e807fff2b74ce440d Mon Sep 17 00:00:00 2001 From: Alvin Kuang Date: Sun, 1 Mar 2015 14:58:21 -0500 Subject: [PATCH 02/25] Update 2015-03-01.md --- 2015-03-01.md | 1 + 1 file changed, 1 insertion(+) diff --git a/2015-03-01.md b/2015-03-01.md index b89c523..249b56b 100644 --- a/2015-03-01.md +++ b/2015-03-01.md @@ -26,6 +26,7 @@ These are all included in the JDK. The JRE only contains the JVM and standard l * virtual = opposite of physical, i.e. does not really exist * virtual machine = A computer that doesn't physically exist. In this case, another program pretends to be ("emulates") the virtual computer. + - allows us to have a unified space to develop regardless of what OS is being used! * compiler = A program that translates source code into machine code. From 00cbb1d3c8085944fe791921fe5b1a19aa1d356e Mon Sep 17 00:00:00 2001 From: Alvin Kuang Date: Sun, 1 Mar 2015 15:02:54 -0500 Subject: [PATCH 03/25] Update 2015-03-01.md --- 2015-03-01.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/2015-03-01.md b/2015-03-01.md index 249b56b..f43db6b 100644 --- a/2015-03-01.md +++ b/2015-03-01.md @@ -15,7 +15,7 @@ The Java platform consists of: These are all included in the JDK. The JRE only contains the JVM and standard libraries. -* JDK = Java Development Kit +* JDK = Java Development Kit (FOR DEVELOPING) * JRE = Java Runtime Environment @@ -28,7 +28,7 @@ These are all included in the JDK. The JRE only contains the JVM and standard l * virtual machine = A computer that doesn't physically exist. In this case, another program pretends to be ("emulates") the virtual computer. - allows us to have a unified space to develop regardless of what OS is being used! -* compiler = A program that translates source code into machine code. +* compiler = A program that translates source code into machine code for the JVM. The Java compiler (the `javac` program) translates Java source code into machine code for the virtual machine, known as "Java bytecode". From e6eefc54bd5f9b29cac3cdbbeb45e35c52570b62 Mon Sep 17 00:00:00 2001 From: Alex Samuel Date: Sun, 1 Mar 2015 15:03:54 -0500 Subject: [PATCH 04/25] Update 2015-03-01.md --- 2015-03-01.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2015-03-01.md b/2015-03-01.md index 499f875..16a5dec 100644 --- a/2015-03-01.md +++ b/2015-03-01.md @@ -38,7 +38,7 @@ The Java compiler (the `javac` program) translates Java source code into machine > **Exercise**: Find the Java7 standard library documentation. -> **Exercise**: Find the JDK standard library documentation. +> **Exercise**: Find the JDK documentation. Command-line Java From 2acc6defe89fbe38bcc2a32dd16b12e740a727be Mon Sep 17 00:00:00 2001 From: Alex Samuel Date: Sun, 1 Mar 2015 15:54:51 -0500 Subject: [PATCH 05/25] Update 2015-03-01.md --- 2015-03-01.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/2015-03-01.md b/2015-03-01.md index 16a5dec..68f396c 100644 --- a/2015-03-01.md +++ b/2015-03-01.md @@ -206,3 +206,8 @@ There's one more special thing called `null`. > **Exercise**: http://programmingbydoing.com/a/numbers-and-math.html + +Exit ticket +== + +https://docs.google.com/forms/d/1LTrWmkDmxw1_9TRIw6e3Ihi68Y-OCX3Cx2dljYGeNI4/viewform From dfb32d3662cd5a7b02fbd614ce12f86ab57e12e5 Mon Sep 17 00:00:00 2001 From: mteatran Date: Sun, 1 Mar 2015 17:25:11 -0500 Subject: [PATCH 06/25] Update 2015-03-01_notes.md --- 2015-03-01.md => 2015-03-01_notes.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) rename 2015-03-01.md => 2015-03-01_notes.md (87%) diff --git a/2015-03-01.md b/2015-03-01_notes.md similarity index 87% rename from 2015-03-01.md rename to 2015-03-01_notes.md index f43db6b..32baf25 100644 --- a/2015-03-01.md +++ b/2015-03-01_notes.md @@ -15,20 +15,17 @@ The Java platform consists of: These are all included in the JDK. The JRE only contains the JVM and standard libraries. -* JDK = Java Development Kit (FOR DEVELOPING) +* JDK = Java Development Kit * JRE = Java Runtime Environment -* runtime = The point at which a program is run, as opposed to the point at which it is created. - -* JVM = Java Virtual Machine - +* runtime = The point at which a program is run, as opposed to the point at which it is created; compile time errors (i.e. missing semicolons, source code) and runtime errors (i.e. program crashes) +* JVM = Java Virtual Machine, custom for each hardware; computer that does not exist in the physical world (i.e. simulator); exists in the imagination of another program; web browers all implement JVM; "jit" - just in time * virtual = opposite of physical, i.e. does not really exist * virtual machine = A computer that doesn't physically exist. In this case, another program pretends to be ("emulates") the virtual computer. - - allows us to have a unified space to develop regardless of what OS is being used! -* compiler = A program that translates source code into machine code for the JVM. +* compiler = A program that translates source code into machine code. The Java compiler (the `javac` program) translates Java source code into machine code for the virtual machine, known as "Java bytecode". @@ -37,6 +34,7 @@ The Java compiler (the `javac` program) translates Java source code into machine * standard library = A library of basic routines that comes packaged with a programming language. > **Exercise**: Find the Java7 standard library documentation. +API (application programming interface); a way for other programs to talk to you; list of different functions, classes, code objects that you can use. How other sites can talk to Facebook (Google Maps, Macintosh, etc.). org.w3c.dom to understand HTML > **Exercise**: Find the JDK standard library documentation. @@ -107,7 +105,9 @@ When you run your code, make sure you are running the correct class! > **Exercise**: There's a second comment syntax in Java. Find it. Why two? > **Exercise**: http://programmingbydoing.com/a/letter-to-yourself.html - + String = character string = a sequence of characters + Java always use STRAIGHT double quotes + Escape sequence (i.e. \" words here \") > **Exercise**: http://programmingbydoing.com/a/your-initials.html Strings in Java are always quoted with double quotes. @@ -158,7 +158,7 @@ So far we've printed only strings. You can print numbers too. * integer = A round number, which has no fractional part. It may be positive, negative, or zero. * floating-point number = A computer representation of a number with a fractional part, i.e. a decimal point. - +0x = hexidecimal > **Exercise**: Try these: > > println(17 + 25) @@ -177,7 +177,7 @@ So far we've printed only strings. You can print numbers too. Today, it's -4 C outside. > **Exercise**: Print the temperature in Farenheit. -> +> Formula for conversion from Celsius to Farenheit: *9/5 add 32 > Can you get the output to look like this? > > temperature: 25 F From ad587cd9eb7948e6b0b4ed71649e08fa024334d0 Mon Sep 17 00:00:00 2001 From: GMSyrimis Date: Sun, 1 Mar 2015 17:40:59 -0500 Subject: [PATCH 07/25] initial commit --- .idea/compiler.xml | 23 + .idea/copyright/profiles_settings.xml | 3 + .idea/description.html | 1 + .idea/encodings.xml | 4 + .idea/misc.xml | 50 ++ .idea/modules.xml | 8 + .idea/project-template.xml | 3 + .idea/scopes/scope_settings.xml | 5 + .idea/vcs.xml | 6 + .idea/workspace.xml | 483 ++++++++++++++++++ helloworld.iml | 12 + .../helloworld/nyc/c4q/gmsyrimis/Main.class | Bin 0 -> 543 bytes .../helloworld/nyc/c4q/gmsyrimis/Slash.class | Bin 0 -> 797 bytes .../helloworld/nyc/c4q/gmsyrimis/Test.class | Bin 0 -> 728 bytes src/nyc/c4q/gmsyrimis/Main.java | 8 + src/nyc/c4q/gmsyrimis/Slash.java | 22 + src/nyc/c4q/gmsyrimis/Test.java | 17 + 17 files changed, 645 insertions(+) create mode 100644 .idea/compiler.xml create mode 100644 .idea/copyright/profiles_settings.xml create mode 100644 .idea/description.html create mode 100644 .idea/encodings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/project-template.xml create mode 100644 .idea/scopes/scope_settings.xml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml create mode 100644 helloworld.iml create mode 100644 out/production/helloworld/nyc/c4q/gmsyrimis/Main.class create mode 100644 out/production/helloworld/nyc/c4q/gmsyrimis/Slash.class create mode 100644 out/production/helloworld/nyc/c4q/gmsyrimis/Test.class create mode 100644 src/nyc/c4q/gmsyrimis/Main.java create mode 100644 src/nyc/c4q/gmsyrimis/Slash.java create mode 100644 src/nyc/c4q/gmsyrimis/Test.java diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..a852314 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,23 @@ + + + + + \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml new file mode 100644 index 0000000..e7bedf3 --- /dev/null +++ b/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/.idea/description.html b/.idea/description.html new file mode 100644 index 0000000..db5f129 --- /dev/null +++ b/.idea/description.html @@ -0,0 +1 @@ +Simple Java application that includes a class with main() method \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..d821048 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..b63395b --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..64f1879 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/project-template.xml b/.idea/project-template.xml new file mode 100644 index 0000000..1f08b88 --- /dev/null +++ b/.idea/project-template.xml @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/.idea/scopes/scope_settings.xml b/.idea/scopes/scope_settings.xml new file mode 100644 index 0000000..922003b --- /dev/null +++ b/.idea/scopes/scope_settings.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..6564d52 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..fa9eee0 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,483 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1425150686425 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/helloworld.iml b/helloworld.iml new file mode 100644 index 0000000..d5c0743 --- /dev/null +++ b/helloworld.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/out/production/helloworld/nyc/c4q/gmsyrimis/Main.class b/out/production/helloworld/nyc/c4q/gmsyrimis/Main.class new file mode 100644 index 0000000000000000000000000000000000000000..70e72007313a258c282ea951acdbf99b5904c9ce GIT binary patch literal 543 zcmZvZOHaZ;6ot?5Dy>xz1o17d(1nwri3^Pz6IS(+VA!}C>ZA^#t+vI4f2A%oapA(H zKgxKgm=F@WxOeWkGv7Tk{rUa;0&s*q3k9s0sG(lOs)YvD46Ga2U?`laKqco4+17rK zA$JkpONNr80(mv^`!c!}{UIq8Cv?TICnBZme=(OlsFX74u7> zf>Yx8lo{%+J7*xC1s{sQYO%%)eT3HD?3UXFg5W|Lu?o*8rZb4 zg>8m>yZ!yrF|cD}7fqTq-wZ=}>fpLRkZv*~b;ofceR_v*M2*_St_t}Lc}>W%6h7Uj znlff(vhb)k(W%zFTcU|Py}$l4VA?!IlPXS`QO+NHfW4+|i((-avsj?DJ=s8ckt!2Q mD3PKMpQJF--jJze-;tXFENW>?k!DRHCdybQo&F`o461(+)^V8t literal 0 HcmV?d00001 diff --git a/out/production/helloworld/nyc/c4q/gmsyrimis/Slash.class b/out/production/helloworld/nyc/c4q/gmsyrimis/Slash.class new file mode 100644 index 0000000000000000000000000000000000000000..eb1d67e7e13cf0d77ae0e3c5b1b59239d0fe5f0d GIT binary patch literal 797 zcmah{%TC)s6g?9{?3h4k(v&wf^kqP;6JQ5I0wmakwo(wAt|rbX8RSRnaVkaPr`km; zb-@SlQHVRn5?DNX7x(y{IX-uE?_6E~y9BU>bqf||%b3Hwi3JObSTeC};bWkcE(UVjCz8h+LodCJPf)bKIL7Xm|8pXxPQiDsq2g^CIhJ$=Gx)N zbG_{!Za+|?SO!wL9iOYg4jBeqh77NqZ|!sble<0-`)((RW!T?I8}hhM7WGGt8LUn; zj6HEA^$o1l@{@L{U;-5bZ!36*_YA8WAO8~@20m2aV2#8V_EWLn>%~H;i)TfxX0y3z z+d0vJ^nLr7Cqm_|bE4CMuur&3MEpQB^ThlZrtgOKrF$;CBu8~dWEarxq9GkLZYL}w z_bZJzp&<(%&{da1-If=WSLdfK>_yC`e7wo@rTs~o7* zLw`VjRK?r1QHqpVYsNb>@6Gyo|Ni^^2f$k#cG1OdfIaN{c+|yXJn`|=$1@+&$AO3E z9$pA^-s?$NsN@oH);pg$C`k|tk%F<|36*^0g-8@yKWEiX{3v?&> zyoi$%Z4VGw#v@D8!v=aDUiR<`uQ^?&)})li+`7`5hc`Wh7?Ivqof%m#X^+ipjU=vq zqyq}rL!5(QBg5xE!$05rEGXkeFALXObKhV)MVD OBRs&6ebkh`g@-qaQI literal 0 HcmV?d00001 diff --git a/src/nyc/c4q/gmsyrimis/Main.java b/src/nyc/c4q/gmsyrimis/Main.java new file mode 100644 index 0000000..9064e6d --- /dev/null +++ b/src/nyc/c4q/gmsyrimis/Main.java @@ -0,0 +1,8 @@ +package nyc.c4q.gmsyrimis; + +public class Main { + + public static void main(String[] args) { + System.out.print((-4 * 2) + 30 +"\u00b0" + "F"); + } +} \ No newline at end of file diff --git a/src/nyc/c4q/gmsyrimis/Slash.java b/src/nyc/c4q/gmsyrimis/Slash.java new file mode 100644 index 0000000..36928d6 --- /dev/null +++ b/src/nyc/c4q/gmsyrimis/Slash.java @@ -0,0 +1,22 @@ +package nyc.c4q.gmsyrimis; + +/** + * Created by c4q-george on 3/1/15. + */ +public class Slash { + + public static void main( String[] args ) + { + /* A comment, this is so you can read your program later. */ + /* Anything after the // is ignored by Java. */ + + System.out.println("+--------------------------------+"); + System.out.println("| Address|" ); + System.out.println("| 10002 |" ); + System.out.println("| Bill Gates |" ); + System.out.println("| The Master |" ); + System.out.println("+--------------------------------+"); + + } +} + diff --git a/src/nyc/c4q/gmsyrimis/Test.java b/src/nyc/c4q/gmsyrimis/Test.java new file mode 100644 index 0000000..cf829c2 --- /dev/null +++ b/src/nyc/c4q/gmsyrimis/Test.java @@ -0,0 +1,17 @@ +package nyc.c4q.gmsyrimis; + +/** + * Created by c4q-george on 3/1/15. + */ +public class Test { + public static void main(String[] args) { + System.out.println(" ggggg mm mm sssss" ); + System.out.println("g m m m m s" ); + System.out.println("g gggg m m m sssss" ); + System.out.println("g gg m m s" ); + System.out.println(" ggggg m m ssssss" ); + + } + +} + From 09991655e27412f0dec79d0fc67136975c971566 Mon Sep 17 00:00:00 2001 From: gwg Date: Tue, 3 Mar 2015 07:15:59 -0500 Subject: [PATCH 08/25] Added topics to filename --- 2015-03-01_intro-compiling-printing.md | 213 +++++++++++++++++++++++++ 1 file changed, 213 insertions(+) create mode 100644 2015-03-01_intro-compiling-printing.md diff --git a/2015-03-01_intro-compiling-printing.md b/2015-03-01_intro-compiling-printing.md new file mode 100644 index 0000000..68f396c --- /dev/null +++ b/2015-03-01_intro-compiling-printing.md @@ -0,0 +1,213 @@ +What is Java? +== + +Java is not Javascript! + +Java is programming a language and a platform. + +* platform = an environment for running other programs + +The Java platform consists of: + +1. the JVM +2. the Java language and compiler +3. the Java standard libraries + +These are all included in the JDK. The JRE only contains the JVM and standard libraries. + +* JDK = Java Development Kit + +* JRE = Java Runtime Environment +* - used primarily for RUNNING java programs, but does NOT allow for developing + +* runtime = The point at which a program is run, as opposed to the point at which it is created. + +* JVM = Java Virtual Machine + +* virtual = opposite of physical, i.e. does not really exist + +* virtual machine = A computer that doesn't physically exist. In this case, another program pretends to be ("emulates") the virtual computer. + +* compiler = A program that translates source code into machine code. + +The Java compiler (the `javac` program) translates Java source code into machine code for the virtual machine, known as "Java bytecode". + +* library = A collection of software. + +* standard library = A library of basic routines that comes packaged with a programming language. + +> **Exercise**: Find the Java7 standard library documentation. + +> **Exercise**: Find the JDK documentation. + + +Command-line Java +== + +* command line = An environment that expects you to type commands, and that executes these one by one and prints out the result. For example, the `Terminal` app. + +Terminal shows you a `$` prompt and waits for your commands. + +* prompt = An indication that the computer is waiting for you to type something. + +To use your Java7 JDK: + + export PATH=/Library/Java/JavaVirtualMachines/jdk1.7.0_75.jdk/Contents/Home/bin:$PATH + +This tells your command line to find the `java` and related programs in your JDK. + + $ cd + $ mkdir java + $ cd java + +Open `TextEdit`. Select `Format > Make Plain Text`. _(Important!)_ Enter some Java code. + + public class Hello { + public static void main(String[] argv) { + System.out.println("Hello, world!"); + } + } + +Save the file as `Hello.java` in your java directory. _(Important! The file name **must** match the class name in the program.)_ Back in the terminal: + + $ ls + Hello.java + $ javac Hello.java + $ ls + Hello.class Hello.java + +You should see a new file named `Hello.class`. That contains the Java bytecode. + + $ java Hello + Hello, world! + +> **Exercise**: Make it greet you three times (in one run of the program). + +OK now we can go back to IntelliJ, which takes care of all of this for us. + + +Printing +== + +For each exercise, create a new class! + +1. Select `File > New > Java Class`, or press `^⌥ N` and select `Java Class`. +2. Give the class a name. _Important: Capitalize the class name!_ +3. Add the `main()` function as from 'hello world'. + +When you run your code, make sure you are running the correct class! + +* camel caps = Words smushed together with each one capitalized. For example, "My name is Alex" in camel caps is `MyNameIsAlex`. + + +> **Exercise**: http://programmingbydoing.com/a/comments-and-slashes.html + +* comment = Text within source code that it ignored by the compiler; it's there only for humans reading the source. + +> **Exercise**: There's a second comment syntax in Java. Find it. Why two? + +> **Exercise**: http://programmingbydoing.com/a/letter-to-yourself.html + +> **Exercise**: http://programmingbydoing.com/a/your-initials.html + +Strings in Java are always quoted with double quotes. + +* quoting = Surrounding text with quotes or other special markers to indicate that the text between the quotes should be interpreted specially. + +> **Excercise**: http://programmingbydoing.com/a/a-good-first-program.html + +What if you want to print two strings on the same line? + +* Try adding the strings as if they're numbers. + +* Try changing some `println` to `print`. What's the difference? + +Some Java string escapes: + +| Escape | result | +|--------|--------| +| `\n` | end the line | +| `\b` | backspace | +| `\"` | double quote | + +* escape = escape sequence = A sequence of characters that has a special or unusual interpretation. + +> **Excercise**: Why do we need these? + +> **Exercise**: Find the full list of Java escapes. +> +> **Exercise**: Write a Java program that prints out some Java source code! It should print out the 'Hello world' line. +> +> System.out.println("Hello, world!"); + +So far we've printed only strings. You can print numbers too. + +> **Exercise**: Try these: +> +> println(42) +> println("42") +> +> println(42.0) +> println(42.0000) +> println("42.0000") +> println(41.999999999999999) // fifteen 9's +> println("41.999999999999999") +> +> What's going on? + +* integer = A round number, which has no fractional part. It may be positive, negative, or zero. + +* floating-point number = A computer representation of a number with a fractional part, i.e. a decimal point. + +> **Exercise**: Try these: +> +> println(17 + 25) +> println("17" + "25") +> println("17" + 25) +> println(17 + "25") +> +> What's going on? +> +> **Exercise**: Using Java, compute the sum of the numbers one through ten. + +* literal = A fixed value (numerical, string, or otherwise) that you type in explicitly. + +* expression = A formula for a value computed by the computer. + +Today, it's -4 C outside. + +> **Exercise**: Print the temperature in Farenheit. +> +> Can you get the output to look like this? +> +> temperature: 25 F +> +> How about like this? +> +> temperature: 25°F + +There are a few other things, too: single characters, booleans, + +* character = A letter, digit, punctuation mark, or another _single_ symbol. +* boolean = A choice between true and false. + +> println(Hello, world!) +> +> println('x') +> println("x") +> println('Hello, world!') +> +> println(true) +> println(false) + +There's one more special thing called `null`. + +> **Exercise**: Try to print out `null`. + +> **Exercise**: http://programmingbydoing.com/a/numbers-and-math.html + + +Exit ticket +== + +https://docs.google.com/forms/d/1LTrWmkDmxw1_9TRIw6e3Ihi68Y-OCX3Cx2dljYGeNI4/viewform From d0205fd289313c8234502abd81bdba47dc0eb092 Mon Sep 17 00:00:00 2001 From: gwg Date: Tue, 3 Mar 2015 07:24:53 -0500 Subject: [PATCH 09/25] Initial commit for workshop on variables, types, and strings --- 2015-03-03_variables-types-strings.md | 106 ++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 2015-03-03_variables-types-strings.md diff --git a/2015-03-03_variables-types-strings.md b/2015-03-03_variables-types-strings.md new file mode 100644 index 0000000..e7d42ad --- /dev/null +++ b/2015-03-03_variables-types-strings.md @@ -0,0 +1,106 @@ +Variables and Strings +== + +Variables += +*Variables* are names (or symbols) associated with values (or data) in a computer. Variables allow programmers to save data and reference it later. Let's look at some code: + + public class Variables { + public static void main(String[] args) { + int favoriteNumber = 9; + System.out.println("My favorite number is " + favoriteNumber); + } + } + +In the above code, `favoriteNumber` is a variable that stores the value `9`. Whenever you use `favoriteNumber` in your code, the computer will know you mean `9`. Notice that `favoriteNumber` is preceded by the word "int". `int` is a *type* and indicates that the variable is an integer. Every variable in Java is preceded by a type. We'll discuss types in more detail later; for now, just copy the type names provided in the assignments. + +> **Exercise**: Variables and Names +> http://programmingbydoing.com/a/variables-and-names.html + +> **Exercise**: More Variables and Printing +> http://programmingbydoing.com/a/more-variables-and-printing.html + +Rules for naming variables +- +* Names are case sensitive. +* Names can be any length of Unicode letters and digits. +* Names must begin with a letter, dollar sign "$", or underscore "_". +* By convention, names begin with a lowercase letter. +* Whitespace is not permitted. + +> **Exercise**: Convince yourself that the above rules are true. +> Your compiler will complain if you break a rule. + + +Primitive types += +All Java variables have a type. A type is a set of values and operations on those values. A "type" sounds abstract, but we use the concept every day. For example, you can think of "bananas" and "strawberries" as both of the type "fruit." When you use a type in Java, you are telling the compiler what kind of data you are using. + +In Java, every variable is declared along with a type. The language has 8 primitive types: +* byte - 8-bit integer +* short - 16-bit integer +* int - 32-bit integer +* long - 64-bit integer +* float - 32-bit floating point number +* double - 64-bit floating point number +* boolean - true or false +* char - a single character, like 'A' or '$' + +Numbers +- +The types `byte`, `short`, `int`, and `long` represent integers. They only vary in size. `float` and `double` represent *real numbers*. To oversimplify, this means that they can have decimals in them. For example, 2 is an integer but 2.1 is a real number. + +> Review: Numbers and Math +> http://programmingbydoing.com/a/numbers-and-math.html + +> Exercise: Variables and their sizes +> What happens when you: +> - Assign a really big number to a short? +> - Add a short and an int? +> - Add an int and a double? + +Booleans +- +A *boolean* represents the values `true` and `false`. Booleans are useful when data has a "yes" or "no" answer. For example, the question "Is this a banana?" has a boolean answer. Booleans can also be created by comparing two variables. For example, "Is 7 greater than 3?" has a boolean answer. In Java, we write this: + + boolean answer = 7 > 3; + System.out.println(answer); + +The boolean comparators are: +* < +* <= +* > +* >= + +What else can you compare? + +Chars and strings +- +A *char* represents a single character. In Java, you denote a char by placing it between single quotes ''. For example, the following are chars: 'a', 'c', '$', '7', and '_'. In this workshop, we will also play with the type String. Strings are sequences of characters and denoted with double quotes "". For example, the following are strings: "hello", "Queens!", "$99.999". Strings are not primitive types but that distinction does not matter to us now. + +> Exercise: Play with characters and Strings. What happens if you do the following: +> - `char c = "a";` +> - `String b = 'foo';` +> - What happens if you add, using `+`, two strings together? +> - Two chars? +> - A string and a char? +> - A char and a string? +> - Do any other mathematical operations work on strings? + +> **Exercise**: Using Variables +> http://programmingbydoing.com/a/using-variables.html + +> **Exercise**: Still Using Variables +> http://programmingbydoing.com/a/still-using-variables.html + +> **Exercise**: Your Schedule +> http://programmingbydoing.com/a/your-schedule.html + +Let's explore these ideas with a longer in-class problem: + +> **In-class homework**: Print "The Twelve Days of Christmas" +> "The Twelve Days of Christmas" is an English carol with a lot of repetition! You can find the structure of the lyrics here: http://en.wikipedia.org/wiki/The_Twelve_Days_of_Christmas_%28song%29#Lyrics. Use variables to store bits of repeated data and print the full lyrics. + +Food for thought += +Have you noticed that when you perform an operation on two variables of the same type, the result is also a variable of the same type? But when you perform the same operation on two slightly different types, the result—if the operation is legal—is the type of the "parent" type. If you throw some strawberries into a fruit salad, do you have strawberries or a bigger fruit salad? From be508d1093a3ed4791f8e75b1dad15ffb18fae09 Mon Sep 17 00:00:00 2001 From: gwg Date: Tue, 3 Mar 2015 07:26:42 -0500 Subject: [PATCH 10/25] Gitignore and removing renamed file --- .gitignore | 2 + 2015-03-01.md | 213 -------------------------------------------------- 2 files changed, 2 insertions(+), 213 deletions(-) create mode 100644 .gitignore delete mode 100644 2015-03-01.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b72f9be --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*~ +*.swp diff --git a/2015-03-01.md b/2015-03-01.md deleted file mode 100644 index 68f396c..0000000 --- a/2015-03-01.md +++ /dev/null @@ -1,213 +0,0 @@ -What is Java? -== - -Java is not Javascript! - -Java is programming a language and a platform. - -* platform = an environment for running other programs - -The Java platform consists of: - -1. the JVM -2. the Java language and compiler -3. the Java standard libraries - -These are all included in the JDK. The JRE only contains the JVM and standard libraries. - -* JDK = Java Development Kit - -* JRE = Java Runtime Environment -* - used primarily for RUNNING java programs, but does NOT allow for developing - -* runtime = The point at which a program is run, as opposed to the point at which it is created. - -* JVM = Java Virtual Machine - -* virtual = opposite of physical, i.e. does not really exist - -* virtual machine = A computer that doesn't physically exist. In this case, another program pretends to be ("emulates") the virtual computer. - -* compiler = A program that translates source code into machine code. - -The Java compiler (the `javac` program) translates Java source code into machine code for the virtual machine, known as "Java bytecode". - -* library = A collection of software. - -* standard library = A library of basic routines that comes packaged with a programming language. - -> **Exercise**: Find the Java7 standard library documentation. - -> **Exercise**: Find the JDK documentation. - - -Command-line Java -== - -* command line = An environment that expects you to type commands, and that executes these one by one and prints out the result. For example, the `Terminal` app. - -Terminal shows you a `$` prompt and waits for your commands. - -* prompt = An indication that the computer is waiting for you to type something. - -To use your Java7 JDK: - - export PATH=/Library/Java/JavaVirtualMachines/jdk1.7.0_75.jdk/Contents/Home/bin:$PATH - -This tells your command line to find the `java` and related programs in your JDK. - - $ cd - $ mkdir java - $ cd java - -Open `TextEdit`. Select `Format > Make Plain Text`. _(Important!)_ Enter some Java code. - - public class Hello { - public static void main(String[] argv) { - System.out.println("Hello, world!"); - } - } - -Save the file as `Hello.java` in your java directory. _(Important! The file name **must** match the class name in the program.)_ Back in the terminal: - - $ ls - Hello.java - $ javac Hello.java - $ ls - Hello.class Hello.java - -You should see a new file named `Hello.class`. That contains the Java bytecode. - - $ java Hello - Hello, world! - -> **Exercise**: Make it greet you three times (in one run of the program). - -OK now we can go back to IntelliJ, which takes care of all of this for us. - - -Printing -== - -For each exercise, create a new class! - -1. Select `File > New > Java Class`, or press `^⌥ N` and select `Java Class`. -2. Give the class a name. _Important: Capitalize the class name!_ -3. Add the `main()` function as from 'hello world'. - -When you run your code, make sure you are running the correct class! - -* camel caps = Words smushed together with each one capitalized. For example, "My name is Alex" in camel caps is `MyNameIsAlex`. - - -> **Exercise**: http://programmingbydoing.com/a/comments-and-slashes.html - -* comment = Text within source code that it ignored by the compiler; it's there only for humans reading the source. - -> **Exercise**: There's a second comment syntax in Java. Find it. Why two? - -> **Exercise**: http://programmingbydoing.com/a/letter-to-yourself.html - -> **Exercise**: http://programmingbydoing.com/a/your-initials.html - -Strings in Java are always quoted with double quotes. - -* quoting = Surrounding text with quotes or other special markers to indicate that the text between the quotes should be interpreted specially. - -> **Excercise**: http://programmingbydoing.com/a/a-good-first-program.html - -What if you want to print two strings on the same line? - -* Try adding the strings as if they're numbers. - -* Try changing some `println` to `print`. What's the difference? - -Some Java string escapes: - -| Escape | result | -|--------|--------| -| `\n` | end the line | -| `\b` | backspace | -| `\"` | double quote | - -* escape = escape sequence = A sequence of characters that has a special or unusual interpretation. - -> **Excercise**: Why do we need these? - -> **Exercise**: Find the full list of Java escapes. -> -> **Exercise**: Write a Java program that prints out some Java source code! It should print out the 'Hello world' line. -> -> System.out.println("Hello, world!"); - -So far we've printed only strings. You can print numbers too. - -> **Exercise**: Try these: -> -> println(42) -> println("42") -> -> println(42.0) -> println(42.0000) -> println("42.0000") -> println(41.999999999999999) // fifteen 9's -> println("41.999999999999999") -> -> What's going on? - -* integer = A round number, which has no fractional part. It may be positive, negative, or zero. - -* floating-point number = A computer representation of a number with a fractional part, i.e. a decimal point. - -> **Exercise**: Try these: -> -> println(17 + 25) -> println("17" + "25") -> println("17" + 25) -> println(17 + "25") -> -> What's going on? -> -> **Exercise**: Using Java, compute the sum of the numbers one through ten. - -* literal = A fixed value (numerical, string, or otherwise) that you type in explicitly. - -* expression = A formula for a value computed by the computer. - -Today, it's -4 C outside. - -> **Exercise**: Print the temperature in Farenheit. -> -> Can you get the output to look like this? -> -> temperature: 25 F -> -> How about like this? -> -> temperature: 25°F - -There are a few other things, too: single characters, booleans, - -* character = A letter, digit, punctuation mark, or another _single_ symbol. -* boolean = A choice between true and false. - -> println(Hello, world!) -> -> println('x') -> println("x") -> println('Hello, world!') -> -> println(true) -> println(false) - -There's one more special thing called `null`. - -> **Exercise**: Try to print out `null`. - -> **Exercise**: http://programmingbydoing.com/a/numbers-and-math.html - - -Exit ticket -== - -https://docs.google.com/forms/d/1LTrWmkDmxw1_9TRIw6e3Ihi68Y-OCX3Cx2dljYGeNI4/viewform From 313f2d042c21fe4f2784ea29e89c6e51f0250ae4 Mon Sep 17 00:00:00 2001 From: gwg Date: Tue, 3 Mar 2015 07:27:56 -0500 Subject: [PATCH 11/25] Removed unnecessary title --- 2015-03-03_variables-types-strings.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/2015-03-03_variables-types-strings.md b/2015-03-03_variables-types-strings.md index e7d42ad..81c6c76 100644 --- a/2015-03-03_variables-types-strings.md +++ b/2015-03-03_variables-types-strings.md @@ -1,6 +1,3 @@ -Variables and Strings -== - Variables = *Variables* are names (or symbols) associated with values (or data) in a computer. Variables allow programmers to save data and reference it later. Let's look at some code: From fb868b4ba3ae0a61486e1d6c9551d637313385e9 Mon Sep 17 00:00:00 2001 From: gwg Date: Tue, 3 Mar 2015 07:35:49 -0500 Subject: [PATCH 12/25] Style --- 2015-03-03_variables-types-strings.md | 34 +++++++++++++-------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/2015-03-03_variables-types-strings.md b/2015-03-03_variables-types-strings.md index 81c6c76..3548904 100644 --- a/2015-03-03_variables-types-strings.md +++ b/2015-03-03_variables-types-strings.md @@ -22,7 +22,7 @@ Rules for naming variables * Names are case sensitive. * Names can be any length of Unicode letters and digits. * Names must begin with a letter, dollar sign "$", or underscore "_". -* By convention, names begin with a lowercase letter. +* By convention, names begin with a letter. * Whitespace is not permitted. > **Exercise**: Convince yourself that the above rules are true. @@ -34,18 +34,18 @@ Primitive types All Java variables have a type. A type is a set of values and operations on those values. A "type" sounds abstract, but we use the concept every day. For example, you can think of "bananas" and "strawberries" as both of the type "fruit." When you use a type in Java, you are telling the compiler what kind of data you are using. In Java, every variable is declared along with a type. The language has 8 primitive types: -* byte - 8-bit integer -* short - 16-bit integer -* int - 32-bit integer -* long - 64-bit integer -* float - 32-bit floating point number -* double - 64-bit floating point number -* boolean - true or false -* char - a single character, like 'A' or '$' +* `byte` - 8-bit integer +* `short` - 16-bit integer +* `int` - 32-bit integer +* `long` - 64-bit integer +* `float` - 32-bit floating point number +* `double` - 64-bit floating point number +* `boolean` - true or false +* `char` - a single character, like 'A' or '$' Numbers - -The types `byte`, `short`, `int`, and `long` represent integers. They only vary in size. `float` and `double` represent *real numbers*. To oversimplify, this means that they can have decimals in them. For example, 2 is an integer but 2.1 is a real number. +The types `byte`, `short`, `int`, and `long` represent integers. They vary in size. `float` and `double` represent *real numbers*. For our uses, this means that they can have decimals in them. For example, 2 is an integer but 2.1 is a real number. > Review: Numbers and Math > http://programmingbydoing.com/a/numbers-and-math.html @@ -61,13 +61,14 @@ Booleans A *boolean* represents the values `true` and `false`. Booleans are useful when data has a "yes" or "no" answer. For example, the question "Is this a banana?" has a boolean answer. Booleans can also be created by comparing two variables. For example, "Is 7 greater than 3?" has a boolean answer. In Java, we write this: boolean answer = 7 > 3; - System.out.println(answer); + +The value of `answer` will be the boolean value `true`. Try it! The boolean comparators are: -* < -* <= -* > -* >= +* `<` +* `<=` +* `>` +* `>=` What else can you compare? @@ -95,8 +96,7 @@ A *char* represents a single character. In Java, you denote a char by placing it Let's explore these ideas with a longer in-class problem: -> **In-class homework**: Print "The Twelve Days of Christmas" -> "The Twelve Days of Christmas" is an English carol with a lot of repetition! You can find the structure of the lyrics here: http://en.wikipedia.org/wiki/The_Twelve_Days_of_Christmas_%28song%29#Lyrics. Use variables to store bits of repeated data and print the full lyrics. +> **In-class homework**: Print "The Twelve Days of Christmas", an English carol with a lot of repetition! You can find the structure of the lyrics here: http://en.wikipedia.org/wiki/The_Twelve_Days_of_Christmas_%28song%29#Lyrics. Use variables to store bits of repeated data and print the full lyrics. Food for thought = From 958120a2f3e06416ae998f1cf883f7c8f69c9c3d Mon Sep 17 00:00:00 2001 From: GMSyrimis Date: Tue, 3 Mar 2015 09:20:21 -0500 Subject: [PATCH 13/25] Git told me to add this --- .idea/workspace.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index fa9eee0..3553fc9 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -28,8 +28,8 @@ - - + + @@ -387,7 +387,7 @@ - + @@ -408,7 +408,7 @@ - + @@ -470,8 +470,8 @@ - - + + From d4c32e30382c426ba58213cd443aec16af28d0d1 Mon Sep 17 00:00:00 2001 From: Alexandra Qin Date: Tue, 3 Mar 2015 10:31:07 -0500 Subject: [PATCH 14/25] Update README --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 74a0f06..0812b06 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,8 @@ # Unit 0: Programming Basics -Lesson plans, activities and assignments for Unit 0 will be posted here! \ No newline at end of file +Lesson plans, activities and assignments for Unit 0 will be posted here! + +| Date | Lesson | +|---|---| +| 3/1 | [0. Intro: Compiling & Printing](2015-03-01_intro-compiling-printing.md) | +| 3/3 | [1. Variables & Types](2015-03-03_variables-types-strings.md) | From ba9740a95008111967be6cbc0c221dfd111422fd Mon Sep 17 00:00:00 2001 From: Eli Bierman Date: Tue, 3 Mar 2015 17:29:25 -0500 Subject: [PATCH 15/25] added some formatting and expanded hexadecimal definition --- 2015-03-01_notes.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/2015-03-01_notes.md b/2015-03-01_notes.md index 32baf25..6dd51f8 100644 --- a/2015-03-01_notes.md +++ b/2015-03-01_notes.md @@ -158,7 +158,8 @@ So far we've printed only strings. You can print numbers too. * integer = A round number, which has no fractional part. It may be positive, negative, or zero. * floating-point number = A computer representation of a number with a fractional part, i.e. a decimal point. -0x = hexidecimal + +* 0x = hexidecimal number = a number where each digit has 16 possible values rather than 10 (0, 1, 2, ...9, a, b, c, d, e, f are the digits instead of 0-9) commonly used for memory addresses and color values > **Exercise**: Try these: > > println(17 + 25) From 82779b75b8e04d4a810b253c63436929f6f10ca1 Mon Sep 17 00:00:00 2001 From: Eli Bierman Date: Tue, 3 Mar 2015 17:31:19 -0500 Subject: [PATCH 16/25] more minor formatting --- 2015-03-01_notes.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/2015-03-01_notes.md b/2015-03-01_notes.md index 6dd51f8..b2361b8 100644 --- a/2015-03-01_notes.md +++ b/2015-03-01_notes.md @@ -33,8 +33,9 @@ The Java compiler (the `javac` program) translates Java source code into machine * standard library = A library of basic routines that comes packaged with a programming language. +* API (application programming interface) = a way for other programs to talk to you; list of different functions, classes, code objects that you can use. How other sites can talk to Facebook (Google Maps, Macintosh, etc.). org.w3c.dom to understand HTML + > **Exercise**: Find the Java7 standard library documentation. -API (application programming interface); a way for other programs to talk to you; list of different functions, classes, code objects that you can use. How other sites can talk to Facebook (Google Maps, Macintosh, etc.). org.w3c.dom to understand HTML > **Exercise**: Find the JDK standard library documentation. From 4fb34127bfa74a309e0c906fb06365da132ca6f6 Mon Sep 17 00:00:00 2001 From: Eli Bierman Date: Tue, 3 Mar 2015 17:35:23 -0500 Subject: [PATCH 17/25] tweak definition --- 2015-03-01_notes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2015-03-01_notes.md b/2015-03-01_notes.md index b2361b8..1310114 100644 --- a/2015-03-01_notes.md +++ b/2015-03-01_notes.md @@ -160,7 +160,7 @@ So far we've printed only strings. You can print numbers too. * floating-point number = A computer representation of a number with a fractional part, i.e. a decimal point. -* 0x = hexidecimal number = a number where each digit has 16 possible values rather than 10 (0, 1, 2, ...9, a, b, c, d, e, f are the digits instead of 0-9) commonly used for memory addresses and color values +* hexidecimal number = (can look like 0x, 52A2B3)a number where each digit has 16 possible values rather than 10 (0, 1, 2, ...9, a, b, c, d, e, f are the digits instead of 0-9) commonly used for memory addresses and color values > **Exercise**: Try these: > > println(17 + 25) From 9832051524154c511ad6d42919cf1acc96115ffe Mon Sep 17 00:00:00 2001 From: Alexandra Qin Date: Tue, 3 Mar 2015 18:35:39 -0500 Subject: [PATCH 18/25] Add homework --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 0812b06..18ee863 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,16 @@ Lesson plans, activities and assignments for Unit 0 will be posted here! +### Lesson plans + | Date | Lesson | |---|---| | 3/1 | [0. Intro: Compiling & Printing](2015-03-01_intro-compiling-printing.md) | | 3/3 | [1. Variables & Types](2015-03-03_variables-types-strings.md) | + +### Homework + +| Due Date | Homework| +|---|---| +| 3/7 |
  • Think Piece: [Optimism, Reg Braithwaite](http://braythwayt.com/homoiconic/2009/05/01/optimism.html)
  • Write a Medium post about something technical or non technical you learned this week (ex: about Paola/Kevin's talk, intro to Git/GitHub, your first Java program, your first week at Access Code, about something you read)
  • Tweet at least once!
  • | +| 3/14 | Your first Java Homework! (tbd) | \ No newline at end of file From d2b30ecc6553757145dc39d51ad63071e6e4b0ba Mon Sep 17 00:00:00 2001 From: Alexandra Qin Date: Tue, 3 Mar 2015 18:37:33 -0500 Subject: [PATCH 19/25] Add homework --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 18ee863..c295199 100644 --- a/README.md +++ b/README.md @@ -13,5 +13,5 @@ Lesson plans, activities and assignments for Unit 0 will be posted here! | Due Date | Homework| |---|---| -| 3/7 |
    • Think Piece: [Optimism, Reg Braithwaite](http://braythwayt.com/homoiconic/2009/05/01/optimism.html)
    • Write a Medium post about something technical or non technical you learned this week (ex: about Paola/Kevin's talk, intro to Git/GitHub, your first Java program, your first week at Access Code, about something you read)
    • Tweet at least once!
    • | +| 3/7 |
      • **READ** Think Piece: [Optimism, Reg Braithwaite](http://braythwayt.com/homoiconic/2009/05/01/optimism.html)
      • **WRITE** a Medium post about something technical or non technical you learned this week (ex: about Paola/Kevin's talk, intro to Git/GitHub, your first Java program, your first week at Access Code, about something you read)
      • **TWEET** at least once! And follow all your classmates on Twitter
      • | | 3/14 | Your first Java Homework! (tbd) | \ No newline at end of file From 6ec480c63f8dad8e38fc15735fff7e25bd7f1b79 Mon Sep 17 00:00:00 2001 From: Gregory Gundersen Date: Tue, 3 Mar 2015 20:27:53 -0500 Subject: [PATCH 20/25] Update 2015-03-03_variables-types-strings.md --- 2015-03-03_variables-types-strings.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/2015-03-03_variables-types-strings.md b/2015-03-03_variables-types-strings.md index 3548904..11d9b04 100644 --- a/2015-03-03_variables-types-strings.md +++ b/2015-03-03_variables-types-strings.md @@ -69,6 +69,8 @@ The boolean comparators are: * `<=` * `>` * `>=` +* `==` +* `!=` What else can you compare? From fc7d19f7d2b92d1a02d3aa2fb7e850b88cb01cae Mon Sep 17 00:00:00 2001 From: John Rodriguez Date: Tue, 3 Mar 2015 20:59:36 -0500 Subject: [PATCH 21/25] minor typos --- 2015-03-01_intro-compiling-printing.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/2015-03-01_intro-compiling-printing.md b/2015-03-01_intro-compiling-printing.md index 68f396c..6947130 100644 --- a/2015-03-01_intro-compiling-printing.md +++ b/2015-03-01_intro-compiling-printing.md @@ -114,7 +114,7 @@ Strings in Java are always quoted with double quotes. * quoting = Surrounding text with quotes or other special markers to indicate that the text between the quotes should be interpreted specially. -> **Excercise**: http://programmingbydoing.com/a/a-good-first-program.html +> **Exercise**: http://programmingbydoing.com/a/a-good-first-program.html What if you want to print two strings on the same line? @@ -132,7 +132,7 @@ Some Java string escapes: * escape = escape sequence = A sequence of characters that has a special or unusual interpretation. -> **Excercise**: Why do we need these? +> **Exercise**: Why do we need these? > **Exercise**: Find the full list of Java escapes. > From d57b6768fa72061183eb56f39ce4a9a8975c93bf Mon Sep 17 00:00:00 2001 From: George Syrimis Date: Wed, 4 Mar 2015 20:25:32 -0500 Subject: [PATCH 22/25] added something to prove a point --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c295199..11a170c 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Lesson plans, activities and assignments for Unit 0 will be posted here! -### Lesson plans +### Lesson plans hahahaa | Date | Lesson | |---|---| @@ -14,4 +14,4 @@ Lesson plans, activities and assignments for Unit 0 will be posted here! | Due Date | Homework| |---|---| | 3/7 |
        • **READ** Think Piece: [Optimism, Reg Braithwaite](http://braythwayt.com/homoiconic/2009/05/01/optimism.html)
        • **WRITE** a Medium post about something technical or non technical you learned this week (ex: about Paola/Kevin's talk, intro to Git/GitHub, your first Java program, your first week at Access Code, about something you read)
        • **TWEET** at least once! And follow all your classmates on Twitter
        • | -| 3/14 | Your first Java Homework! (tbd) | \ No newline at end of file +| 3/14 | Your first Java Homework! (tbd) | From b6d7220ee4107fc9867640841bc9862eb766982f Mon Sep 17 00:00:00 2001 From: GMSyrimis Date: Wed, 4 Mar 2015 21:01:36 -0500 Subject: [PATCH 23/25] empty --- .DS_Store | Bin 0 -> 6148 bytes .idea/vcs.xml | 2 +- .idea/workspace.xml | 229 +++++++++++++----- .../helloworld/nyc/c4q/gmsyrimis/Main.class | Bin 543 -> 684 bytes .../helloworld/nyc/c4q/gmsyrimis/Mumbo.class | Bin 0 -> 1755 bytes .../nyc/c4q/gmsyrimis/TwelveDays.class | Bin 0 -> 1770 bytes src/nyc/c4q/gmsyrimis/Main.java | 13 +- src/nyc/c4q/gmsyrimis/Mumbo.java | 59 +++++ src/nyc/c4q/gmsyrimis/TwelveDays.java | 60 +++++ 9 files changed, 304 insertions(+), 59 deletions(-) create mode 100644 .DS_Store create mode 100644 out/production/helloworld/nyc/c4q/gmsyrimis/Mumbo.class create mode 100644 out/production/helloworld/nyc/c4q/gmsyrimis/TwelveDays.class create mode 100644 src/nyc/c4q/gmsyrimis/Mumbo.java create mode 100644 src/nyc/c4q/gmsyrimis/TwelveDays.java diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..2deac1cf7b5a1e8f8f60b1c13fd5adcd882dbcba GIT binary patch literal 6148 zcmeHKO-lnY5Pf5NC;JES)bc6-WhAfm9$B z_-O@rW~u{du(1+=IAymPW4$J8P6_M+n*8!Z_)a}*3;m9+ro5&Bjq%_Tzz5w&PHoV~i^k-2fz458(SA!O P=0(5+$tD%}1qD6;QvEWz literal 0 HcmV?d00001 diff --git a/.idea/vcs.xml b/.idea/vcs.xml index 6564d52..94a25f7 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 3553fc9..2254478 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -1,7 +1,13 @@ - + + + + + + + @@ -28,31 +34,18 @@ - - - - - - - - - - - - - - - + + - - + + - - + + @@ -60,6 +53,9 @@ + + - - + @@ -99,7 +96,6 @@ - @@ -139,6 +135,7 @@ + @@ -151,7 +148,7 @@ - + @@ -191,14 +194,14 @@ - + - - + - + + + + + + - + - - + + + - - - - - + + + + + + @@ -387,7 +414,7 @@ - + @@ -401,19 +428,19 @@ - + - - + + - + @@ -441,14 +468,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + @@ -456,7 +564,6 @@ - @@ -464,18 +571,30 @@ + + + + + + + + + + + + + + + - - - - - - + + + diff --git a/out/production/helloworld/nyc/c4q/gmsyrimis/Main.class b/out/production/helloworld/nyc/c4q/gmsyrimis/Main.class index 70e72007313a258c282ea951acdbf99b5904c9ce..4b170db4916a002fc3df040dd17f97b2e36a619f 100644 GIT binary patch delta 403 zcmXX?xk>|36g_XYmyC(o)tJ#FqXtdH1#1h-0VRcEV>NCV3_}=WVHE^_V7@@Ku@ONF z1(AG!A0r4>;&x`tEABb(+~wT&F11^|{QC3U2e5*g2_3~a#!)h1VM1b3q8!-ghG+>0 zC%7utlCHPr`|eruu;q161e6^|Ai3Ff_l`H*&X&8|K9I-<{Zh_=l&B<7g)K3az%*up zkJFy)`0Q+Z0@|!Ix6QOh*YGG1U=w4Ew?(2L>h&jx`zRe}G$K)jNuKyGzz`V_M-szS z!sa^;Rf)^#{TFjxU9}qhYor>MW%Q1k7mB#~eIJO~2Ph3|;Sp*izlBaJX90FJ$>4I5 zlVivci}b3}txjB`TewA?UJ_ZPkmeIgC=3|gk)h5fV4mH1?p8nrq}q4*HzVQ`nJ)-J Km>XrKg0VkPNjN0{ delta 264 zcmZ3(I-f=9)W2Q(7#J9g8I-sf*ce1O8AKVxI2gpa7$g`Z*%_qR8Kfu5H%?q3JMpcg zG&=(aJA(`lgDis_BLl0E(V-1)>sbqmGV@9p8ALUFvJ%S@^>Y&Q z()EK&fP(4Pnqdrz46HyaK!AyXkpXBJkmLmN^no-ZkY?4|&cL`4EX@TZ*}#I#4BS9A z4@3cw<^}RN8Tc6Zfg&Ky=3v8sVw)JunS_|PF|Z&^-~!5l%;5l9hA@SbL4ZLJD9*?r J1SFXlgaJ2e9!dZJ diff --git a/out/production/helloworld/nyc/c4q/gmsyrimis/Mumbo.class b/out/production/helloworld/nyc/c4q/gmsyrimis/Mumbo.class new file mode 100644 index 0000000000000000000000000000000000000000..ede4093c28de076d71ad2adf96a15c4407110bf4 GIT binary patch literal 1755 zcmZ`)OLG)e6#hE%=$pwv!cB${9&&l82{T~?BZ^?uBm|I2i1ZjiK)IQ@nQ7=p?CB(A zOy@WJbppEo7&| zrm@gpa|1KK>Mxn7u9rL_vKBV9x2PjGIX?!oaog=!7^wvtjcQ}!(`w7_Y(%c_cB*qU z4o}dbuie1H_R-6=>v~OBJsq^FP8_*G>qK&)#Tcx!{IH zYknz=>CVf68sO)6G1KnR4n~jX32! zA&L6B@zzr9F0B@H#L6^VM!A9F(dbCkBV!ITxcYji>b%o4Y9?GWEWx&Vn>sZcnV`{D zZ4(faNnC1Ldmam{rWh;1{#kd;sMDd>R2K**G)AjV8`CjLkJt1DQT8YeT{-JI=n!_+ zUEfa?r8E;Yr`=|vm~*`wDL$AarfRzBnvR;$L8FT@OH~VbbK=|Rl@uN7=ByUn6%%!m zC53l%^H(#`s_!R?bd#!JVffjOOs%?J(?mrWEOTZGMYPbi;TCZnH(31hfr{HkSr}6s z7Zon6>2~CHVqbTZzoFu2)hLhEQyq3f#i81r|DD5)PHZ^jnQ)bNmbz};u)4tKC#D;teHsj= zWqKNBF;)_i$HYp{3vm(q@FIVFl2;FF%}0Q8jHfDBi)-%C16bdt>O++I6wIT{eX&bG z1>-#R;&5t2W9u(u$pro!DE@?=S~(*#PB|;HPB|xYPB}00PT7{WQx;M<<$=8HrL<*% zQpi5aURk6p$Sst8a;ua2nX6=Ezf;M|0jH9a+nh>XN~dDWL8l_*kW-xr+T*qOTS$Ja#K$zizTqpRrfB*sIU! z*svrZ;A4Sn1!yeVXxM04$e(lrH=eMN85v!$kev#f z#zKG14b0q%zi6VmUi65_TG-Iuf{xr|{}{~1ZMS1#Z!K7FR2$=;R9k*$J#u}wQ?0KV zZ`Dle_09=;^|c#V*gA5#c3rRPs;7fi)rliFXq`xIwHSzXmfse+I%?79;B%-nHtEnp zuH`Pp)cM6Qjzd3*Zi8P7o19oTZp`ZCG+G8cX~!mhpUEl*ivuPre-1& zG}@|d0%9_WOHFCdW0ln;VCOnW};@b+e{3zu6HBF2b089O*dWBQPVnTbWvuhY9Vhg%-qC?%B)x5iG zqE4bxczZX0H65+^equ-$sRAV71wK;s0f244o;zn7TPx4BCg{Gi+?^)aoZ>h zqlz=5!X-7;j@(Y{>yGl*RUEAt<*|CI!%nC;RKBs{72$(}y8Hj;`Kj?Zzj)m=lCjXs z%O)9%v5}3VIJyCP96cWm5r^Fe!NSnUMj{#i9me%eY&hPu z9vDn(^)$?iEGHz7*_ECb;sW;L1^yN#uO1eh&jIBqcU5YOI(O&+tZ!2DAqkUJ>*(HU*TdYdo1@oc3*mcJ(W`S=zZ*!`zXfvy$>}< zY|Qx<`yW%}0pjISF6ABUa_(c8gzn+tTUqPgqkBoIGDu4GISx`5S%}T(Lq7)iE@2CH zLSi2VF^nPdN_ZJtaSYpV65BC}9XNwMm?Oi1!bSGyDh^L^eY=Y6;#W}K$Acs4+Lf#QJi>)Gi zoH~!+@G4gpWB8hJjdLz;;~HMW>&)vo89UJPh(~ia-gxri_~9>H=An}$^x(~Z09%!r A!~g&Q literal 0 HcmV?d00001 diff --git a/src/nyc/c4q/gmsyrimis/Main.java b/src/nyc/c4q/gmsyrimis/Main.java index 9064e6d..bd456ad 100644 --- a/src/nyc/c4q/gmsyrimis/Main.java +++ b/src/nyc/c4q/gmsyrimis/Main.java @@ -1,8 +1,15 @@ package nyc.c4q.gmsyrimis; public class Main { + public static void main(String[] args) { - public static void main(String[] args) { - System.out.print((-4 * 2) + 30 +"\u00b0" + "F"); + int[] anArrayOfints = new int[100]; + for(int i = 0;i< anArrayOfints.length; i++){ + anArrayOfints[i] = i*3; + } + + for(int i = 0;i< anArrayOfints.length; i++) { + System.out.println(anArrayOfints[i]); + } + } } -} \ No newline at end of file diff --git a/src/nyc/c4q/gmsyrimis/Mumbo.java b/src/nyc/c4q/gmsyrimis/Mumbo.java new file mode 100644 index 0000000..959bbae --- /dev/null +++ b/src/nyc/c4q/gmsyrimis/Mumbo.java @@ -0,0 +1,59 @@ +package nyc.c4q.gmsyrimis; + +/** + * Created by c4q-george on 3/3/15. + */ +public class Mumbo { + + public static void main(String[] args) { + + String[] days; + + days = new String[12]; + + days[0] = "First"; + days[1] = "Second"; + days[2] = "Third"; + days[3] = "Fourth"; + days[4] = "Fifth"; + days[5] = "Sixth"; + days[6] = "Seventh"; + days[7] = "Eighth"; + days[8] = "Nineth"; + days[9] = "Tenth"; + days[10] = "Eleventh"; + days[11] = "Twelveth"; + + String[] gifts; + + gifts = new String[12]; + + gifts[0] = "a Partridge in a Pear Tree."; + gifts[1] = "Two Turtle Doves"; + gifts[2] = "Three French hens"; + gifts[3] = "Four Calling Birds"; + gifts[4] = "Five Gold Rings"; + gifts[5] = "Six Geese a-Laying"; + gifts[6] = "Seven Swans a-Swimming"; + gifts[7] = "Eight Maids a-Milking"; + gifts[8] = "Nine Ladies Dancing"; + gifts[9] = "Ten Lords a-Leaping"; + gifts[10] = "Eleven Pipers Piping"; + gifts[11] = "Twelve Drummers Drumming"; + + + + String bottom = "";//initializing an empty string to build up the many gifts said in the second block of the verse + for (int g = 0; g < gifts.length; g++) {//this is to loop through the array until the end of its length + int d=g;//this associates the days with the gifts, this was the most important part of my code + bottom = gifts[g] + "\n" + bottom;//this makes the gifts array actually contain the second block of each verse instead on the special gift given on the day + gifts[g]=bottom;//as mentioned above we are rebuilding our array with the bottom block of the verse. + System.out.println("On the " + days[d] + " day of Christmas my true love sent to me");//prints first sentence of song + System.out.println(gifts[g]);//prints the contents of the array which is now the second block of each verse + + + } + + } + } + diff --git a/src/nyc/c4q/gmsyrimis/TwelveDays.java b/src/nyc/c4q/gmsyrimis/TwelveDays.java new file mode 100644 index 0000000..619cd0e --- /dev/null +++ b/src/nyc/c4q/gmsyrimis/TwelveDays.java @@ -0,0 +1,60 @@ +package nyc.c4q.gmsyrimis; + +/** + * Created by c4q-george on 3/4/15. + */ +public class TwelveDays { + + public static void main(String[] args) { + + String[] days; + days = new String[12]; + days[0] = "First"; + days[1] = "Second"; + days[2] = "Third"; + days[3] = "Fourth"; + days[4] = "Fifth"; + days[5] = "Sixth"; + days[6] = "Seventh"; + days[7] = "Eighth"; + days[8] = "Nineth"; + days[9] = "Tenth"; + days[10] = "Eleventh"; + days[11] = "Twelveth"; + + String[] gifts; + gifts = new String[12]; + gifts[0] = "a Partridge in a Pear Tree."; + gifts[1] = "Two Turtle Doves"; + gifts[2] = "Three French hens"; + gifts[3] = "Four Calling Birds"; + gifts[4] = "Five Gold Rings"; + gifts[5] = "Six Geese a-Laying"; + gifts[6] = "Seven Swans a-Swimming"; + gifts[7] = "Eight Maids a-Milking"; + gifts[8] = "Nine Ladies Dancing"; + gifts[9] = "Ten Lords a-Leaping"; + gifts[10] = "Eleven Pipers Piping"; + gifts[11] = "Twelve Drummers Drumming"; + + String bottom = "";/* initializing an empty string to build up the many gifts said in the second block of the verse */ + + for (int g = 0; g < gifts.length; g++) {/* this is to loop through the array until the end of its length */ + + int d=g;/* this associates the days with the gifts, this was the most important part of my code because it allows me to print the right verse combo each time */ + + bottom = gifts[g] + "\n" + bottom;/* this makes the bottom string contain the different collections of gifts for every given day instead of the single gift currently in the array */ + + gifts[g]=bottom;/* I am now rebuilding the array with the bottom block of the verse specific to each day. That is now a collection of gifts not single gifts */ + + /* This is where the printing begins we have only done some data processing until now, printing happens below and we are still in the loop so there will be itterations of this print function */ + + System.out.println("On the " + days[d] + " day of Christmas my true love sent to me");/* prints first sentence of song which will end up being looped through and incremented */ + System.out.println(gifts[g]);/* prints the contents of the gifts array which is now the second block of each verse for each day. Before the array had the new gift of the day, now it has the block of text for each day*/ + + + } + + } +} +//Happiness and frustration in the same day. Cool! \ No newline at end of file From 0c4a4266eeb2ea18d68a854c357a5cf2675e71df Mon Sep 17 00:00:00 2001 From: GMSyrimis Date: Wed, 4 Mar 2015 21:04:15 -0500 Subject: [PATCH 24/25] ee --- .DS_Store | Bin 6148 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 2deac1cf7b5a1e8f8f60b1c13fd5adcd882dbcba..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKO-lnY5Pf5NC;JES)bc6-WhAfm9$B z_-O@rW~u{du(1+=IAymPW4$J8P6_M+n*8!Z_)a}*3;m9+ro5&Bjq%_Tzz5w&PHoV~i^k-2fz458(SA!O P=0(5+$tD%}1qD6;QvEWz From a3a8a5f52df418931cc3ab454358470c36643d40 Mon Sep 17 00:00:00 2001 From: GMSyrimis Date: Thu, 5 Mar 2015 22:05:22 -0500 Subject: [PATCH 25/25] if statements --- .DS_Store | Bin 0 -> 6148 bytes .idea/workspace.xml | 197 ++++++++++-------- .../helloworld/nyc/c4q/gmsyrimis/BMI.class | Bin 0 -> 1640 bytes .../helloworld/nyc/c4q/gmsyrimis/Convo.class | Bin 0 -> 1199 bytes .../nyc/c4q/gmsyrimis/DumbCalc.class | Bin 0 -> 1186 bytes .../nyc/c4q/gmsyrimis/ForgetfulMachine.class | Bin 0 -> 1041 bytes .../helloworld/nyc/c4q/gmsyrimis/Lipz.class | Bin 0 -> 824 bytes .../nyc/c4q/gmsyrimis/PeopleCatsDogs.class | Bin 0 -> 1257 bytes .../nyc/c4q/gmsyrimis/TwelveDays.class | Bin 1770 -> 1770 bytes src/.DS_Store | Bin 0 -> 6148 bytes src/nyc/.DS_Store | Bin 0 -> 6148 bytes src/nyc/c4q/.DS_Store | Bin 0 -> 6148 bytes src/nyc/c4q/gmsyrimis/.DS_Store | Bin 0 -> 6148 bytes src/nyc/c4q/gmsyrimis/BMI.java | 37 ++++ src/nyc/c4q/gmsyrimis/Convo.java | 18 ++ src/nyc/c4q/gmsyrimis/DumbCalc.java | 22 ++ src/nyc/c4q/gmsyrimis/ForgetfulMachine.java | 21 ++ src/nyc/c4q/gmsyrimis/Lipz.java | 16 ++ src/nyc/c4q/gmsyrimis/Mumbo.java | 59 ------ src/nyc/c4q/gmsyrimis/PeopleCatsDogs.java | 32 +++ 20 files changed, 261 insertions(+), 141 deletions(-) create mode 100644 .DS_Store create mode 100644 out/production/helloworld/nyc/c4q/gmsyrimis/BMI.class create mode 100644 out/production/helloworld/nyc/c4q/gmsyrimis/Convo.class create mode 100644 out/production/helloworld/nyc/c4q/gmsyrimis/DumbCalc.class create mode 100644 out/production/helloworld/nyc/c4q/gmsyrimis/ForgetfulMachine.class create mode 100644 out/production/helloworld/nyc/c4q/gmsyrimis/Lipz.class create mode 100644 out/production/helloworld/nyc/c4q/gmsyrimis/PeopleCatsDogs.class create mode 100644 src/.DS_Store create mode 100644 src/nyc/.DS_Store create mode 100644 src/nyc/c4q/.DS_Store create mode 100644 src/nyc/c4q/gmsyrimis/.DS_Store create mode 100644 src/nyc/c4q/gmsyrimis/BMI.java create mode 100644 src/nyc/c4q/gmsyrimis/Convo.java create mode 100644 src/nyc/c4q/gmsyrimis/DumbCalc.java create mode 100644 src/nyc/c4q/gmsyrimis/ForgetfulMachine.java create mode 100644 src/nyc/c4q/gmsyrimis/Lipz.java delete mode 100644 src/nyc/c4q/gmsyrimis/Mumbo.java create mode 100644 src/nyc/c4q/gmsyrimis/PeopleCatsDogs.java diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..0e35c60b5ac7957dacc0585bbe8269474fb40505 GIT binary patch literal 6148 zcmeHK-D(p-6h4zg-AzDNs!;G|Zxn@8Vq?f{8dJfGLTIE#ti;`HNEX)Ju)9epA&_gI zpx6FCh9G+71L&i86~Fn3G---=B6d!h^PN3=&Y3x1n4Jz0vHH-vPh=61fx$7Chgu{2 zJs)QzqdX>%i5go}qB3!f+FCRNnt^|u0ls%{)3(^L6|r*{`?pO#g_KfE5&RwKmo$Jc z5dI!~1H6+lT=(c6BD}{z)NzBzMP2?;d4zFiE(8|Q#yN9^sGm}olC@R7tyHuIyzG9g9LZOf^Sl9B;Tm5L zpB@{gX&PqR+MGU3&-GK`ydD?58n2h&%t-@JYI{=>)5 zUpS9o6o-(I4TTH%3PaH`YQ}%C9VL#9Na=+^JAaq*a~Y3XAZI2Hy!iZ?NY;GNA4U`^pnB0LcNkAR>-E6u=PW#AXmAju2> literal 0 HcmV?d00001 diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 2254478..2951034 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,10 +2,14 @@ - - - - + + + + + + + + @@ -31,21 +35,11 @@ - - + + - - - - - - - - - - - - + + @@ -65,6 +59,12 @@ @@ -96,6 +96,7 @@ + @@ -135,7 +136,6 @@ - @@ -148,38 +148,37 @@ - - - - - + @@ -423,6 +422,7 @@ + @@ -434,12 +434,11 @@ - + + - - @@ -470,16 +469,16 @@ - - + + - + - - + + @@ -492,10 +491,10 @@ - + - - + + @@ -508,14 +507,6 @@ - - - - - - - - @@ -560,40 +551,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + - + - - + + + - + - + - - + + - + - - + + diff --git a/out/production/helloworld/nyc/c4q/gmsyrimis/BMI.class b/out/production/helloworld/nyc/c4q/gmsyrimis/BMI.class new file mode 100644 index 0000000000000000000000000000000000000000..a9fe579114cc174ae0c7eacd1785e393e61c1e3e GIT binary patch literal 1640 zcma)7!E)PF6g|&&EZJ2_YCEZu6cEsY($JVdDI_ULo1_7Qlax3V(iW)fym1uUk}Jy) z?^v>7#R@u|>52_2I)gJqXZQgApS;m8)g<1-qC%E*Tub6QmUXNsa8-dfbgXH3KZ#*n(eZ)0=hgC| zT0YWIh%Y^jpMRR0c%)-JzVu_Hbzv>}lZFiqn*#Bxj_U-A0#R$~mOyO9+m!;t1;>>e zt$IoN+jgl&BvtUrcI}q!JId~Xv0%?>3Y;yt?Q*Vs`F^faZ?=7>?lg1D>-h!J)osTW z7_;sa_U*6iT+MbXxnkfuZe>BGi|_+nG_(2A;P*qP}xNo1p>ma>6em0s@)H+dv+NNhQ7c~3T{RD#ig zhtCt}C*CaW%Q8>-2ow&%ai}YUKtzqqXn0tTm&?12RzP=Y*Lkj4Yv6_&rl{9qj(*@x zO5P7lcgrE)5m-QLD5siA*du;+M0Hml1nPAV$XHW@MrcIdZ`rkGzT$emT(O(<97uLs zV5pmp!=*@9y;k?t;+vFXRmmt=8g2>KeL=O=w zJjPHe-hnpVfj+N~>#0Ns$sce{;ioz2*#0OuW3vZ zpT#KVFos2(#Tv4>hY9RcOrLTdP{?m6<+oJhJ2HJwy&h1fU#XE&?k?3?r2Q&hqwKR3 z+u~D#wJKfBpXc1He4iQb=Q>1J^KVA(O%srjxjC^qCaeFl)q( zB%BmFFk!?^3v=eYWntdJf`!{jEGBV>p?%p?o_@&Cl9_tX(7GDtB|}fvQ*t8?ax!`+ zaz0to+0YgKdl7j?Zx~y3(JM2IWL3p=+=Z`BAt+ZOFYwCFYN&R@B?1hDrx?yBdHp*8z#X(_=jSJ=R-BA4K^=?ydX6X zBp2Kbx3(l*RG!QIl21=Zd@5W7e4Uqd?Cx-~m`6846{zepQ*ms)fww1=<~k(uBC5xY zGjxvgT~JL5ALDH*a#=($yzSo0YPb0c{V#F$~s+ z#8nC7@OA*kR`fC^`%`~8r3G!(>1~X?bN5ZU56Lejb;wI>DBZ**-JIqp9O73g3 z!VCkMsngiB_M%jhiuP*utkS148WW^eEFIRj7njjTf1&vjpcXMea*#BKPDW?j^dZ={ zn)@8d_L|Yc5Z ERI_S_eikMi!I&6D??^^UDDe>6R*5kI?q<0PTlJX0KOay(aq+ zIzApEHB&`r+9pv&7X=#cM$?<_CeN%1>G>OCFncMqNopJx6-$xqqz-H%)P*^8V-Y=g thhBW99u48?Iw_pT1=9NQ5*KlaC=b*Aae9daWlUn6ZY^ZJLNN(k{R8F)AYlLi literal 0 HcmV?d00001 diff --git a/out/production/helloworld/nyc/c4q/gmsyrimis/DumbCalc.class b/out/production/helloworld/nyc/c4q/gmsyrimis/DumbCalc.class new file mode 100644 index 0000000000000000000000000000000000000000..8a9bec612a59f4c0fc0ec98dd1978189a2d197c9 GIT binary patch literal 1186 zcmaJ==~B~B6#j0vq%mw|D~K95nt~9aD6%V5HaqA{8De=YIFB-#O>z=kM=702EMC&f>Zc?k;)sYTnhgJp)ep5J3gta%3(Ls!Xmt(~w|vHV?L zaY&OXc_w%ExNnR5nKBW4up0~`CHKfQ%$ZL{wbnTD?V8;%iWI!Y9g|8VYTR}i2K4u( zL;jf?4tJ|YIq+?_x)9amewDKH-e6{s+=#^#11nzKrY}%|I^b^Oi{&%OAFZQ`$NdA! z)v6Q*wquk{?z)ywM3k}@`lhvRi-tPR8BPjPD*DjR&=V279428=#S)f#>wTNkUW1eB~YU`_^?HmZ&OjogiO(C{u4cfRy zBg<<`nu=|_VHp1Ra2dMWY2Q{3Ei?E_RX%D2R*fMh=HK6%iR~F%ZaoZW0T!>(RI>Vw z2Cz@MbD1*n&S1k<0~Y|ds!pp(&=96JH~7MTZ0 zrXr<;EMc|ffFTUiEsfh4A&m(Bg#>+KfP0GA{xRYwNX(~?k<6r;kcQGt$eWSej^tc2 zmp8LXb50U2WEJNrl>HOj%BW3rp(gKScuZc=3>LQV8gRGZ}}u>m@WVJEfJ zMf|#Cx8_^Nnr@L2XF`6LLr4I+)ZNI;F%Qq zaL+8W7K#?;EX-S2NMbRGC5HZI%2WC|Lr-yTm!bEiUzZHSW#!4Ykz19)dr@stBwO}t zqPZ&qW$<~hS2tA1FkSZInq6D{WIJvc2g+5Uz3B&z)E}ef8&PYJ*g9#uLU{~h#Si5J z@mbhS;W>6i2g-BSTeU^tkXr5vn!!4han%<=oes3qBdwZtr6xR22Be;<_)$=ko65M& zUoKxV71J0-CW%rSHtsVFZOND)H-w%Id33aq#Dg@JvBEIYve&Jj#wylK`olCH;W0yL zr?JRY$Tg*NCy+uH_?~$ef#k6t@w!i+#kKD#r=d3(CR(gkZku+_X(uUq-{J8G4thDqVlh38rt7sCw6BXg)pea;uJZgav6K}U4kJBm7@ulS`VyI6rut8j#Rjpj$(ivv*7ibYZxG614L31CP8n_yPGIs6 D;>G!t literal 0 HcmV?d00001 diff --git a/out/production/helloworld/nyc/c4q/gmsyrimis/Lipz.class b/out/production/helloworld/nyc/c4q/gmsyrimis/Lipz.class new file mode 100644 index 0000000000000000000000000000000000000000..d72234cb76ebf7f0d76bb3b2ecca5a0cd1bc8073 GIT binary patch literal 824 zcmZuv+iuf95IyUpvEvxpCQS&}CM_4IEj3Wyig-anLNXUAs1o97iK zS_vdRfR94VI+apryz=bMnVB<}-QRzH`~t9tJsUP|nYi7=9jx0hFwm!=g$)~WM~sl=Nio{024pG1VT{UqSg0Z*mY&%t_rBr}G- zugbs+o__YiI4e^b%gpoT^xHo1#at?ep8L^1=3lrMaTR*wJe4Zkuk!IUB! zl#_&~hvYB|FLD`qyEAy(}PL4&8 z{{xN7EEh3@p=Z>cwI~zsm6{eg4N35rn(Vs^4SIUDq#(k1;5(Y@Jg`&cCcXCXVuvm|+iG>>*h`_k4K*!RkOm1Ls=EiBVn zyOIM|uu6LqZFC6H!3s56z~Cp04=1Rdq3)kxsogk*xqS-jH7PrEp7ZvI2UJLlR)?7T i#IsIWbe_SC3v1|-)*{)%HOkb7MgR4x@Ec??aPuz}?YW!) literal 0 HcmV?d00001 diff --git a/out/production/helloworld/nyc/c4q/gmsyrimis/PeopleCatsDogs.class b/out/production/helloworld/nyc/c4q/gmsyrimis/PeopleCatsDogs.class new file mode 100644 index 0000000000000000000000000000000000000000..0003d344a912da0dcc05e47652cea7ac5c877e44 GIT binary patch literal 1257 zcmah|?M@Rx6g|@xcBw@uh$4cH^{XIuRZvk7QPiZS2(e0H^v`rVl$Gsl-Q9wH9l{If z4^1@j0emR+&TJE^!MH!>XLx zDA{l{c-_Vg8#ist*_gL*%ffAj{v}U&@iIfYIK9b`Sq;=9Xhe&o+!UT-I9YsC zc_(&-;|tYrs&VM4#-hnA!Uk!L9&t=ATSkt7l}V{iiZr<-&S3AzPAw2&onjN^cI^31 z)fGy~kP;78W8vKVS*aPkgW#o(3MX;UEJuOZcEx=4#UVZz-MUPDPj1D+H!%XJ-wsVga2xSzu^ z9xyDt+?I-Wg7y`PZOB+F@vR_~u83m2Fo2{K!IoL>1)*Orl}b6R;331fZaY`O9uM2T z>|rqQhujZh9cPkIeH|h1j3|32% ze4Vf>{P%mbl>88v6)Dr7QO0>3r=LuJDUf^QX&j-QLo=hfZ{`cwM{_(%W4{4yoS=0s zAz%zAX*YmV7$<~+*(B2FBW&**Qm;QD{RNqOnNR2&>HiE%&o<4cGoLZAWXAhuT%I~} zfZ?gh102(wEOENXeu5k`$bJtecZhU3gM?_iX=uC4rnW({dYmi|VUj8=P>n^hSt7;) zp(|wn8JT~9(|C&s)QP1qgomi99w-U-YORF^H*`X+o e4D}V%n9MJd@3T-~j9It<r2Bl3Uf_A?)_?6L~W^K<-sPZf1Yg9p6vtt>n*-hlOyL@7g7KK delta 150 zcmaFG`-*qN7uI?n1~vvh25ts^1_2-xWe{YLVi01GXAovkVGv=^0*V+gh%uNkh%?wQ zNH91tNHTaZ$TIi=RRl9AFhnpYGQ=_{F(ff4Go%A`pPWG8i*F;$kpicmtI9#9%qOmMs?m0&N$x diff --git a/src/.DS_Store b/src/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..7b0dda939e2938b36d2c2716e25e284bedbe9dd3 GIT binary patch literal 6148 zcmeHK&1%~~5Z<-jM6xalX&}&xjt%(WrZKuIZW_p;U{FX1O>m`1)C)puEZHU)gU)@7 zHa~rgLTTTjkCIb5yE_gINv~~MW?=Rk&CaZ}--_KG#u)F8lNXG+j4=yTVa4(lU&q5t z6lJ^pgV*YfCritg-E9{M+lW-uXVHuUL-z;G1|ST94zd8DYIKUiVs9O z?YmE3$-In2o{oM=Jw6n9BBxzB&XeLeG~*qLq#X3!wcaS5Kx!|_(*se6SY)C+vuxY8 z?7q7`n{9SFEpOBJ=PhsM`|Xyu_0pfu-7l8)Y@@UN=4d$o@bT06#pTuKuix~98Hb-* z%PQgmzJq~uOu|u~$^1Qd7SW3+LSldzAO;>S1Gr&X&ZGT8`Y>XE82DQZsQtkMRTv;v z2KCkfjV=KI8{pOgw!ZuWdddM9AXWy!1Hw%zph@LeVsNY-xJifp0OKozCY^EpW*7(G z%&|h@SbA_zhcg}+q?Q;U2JSMTYCjNHo&T?YU;pbMYKQ@1;QwTRH+I6EF3b(j)_b#5 wXRQbN4pfPXs|?m`1#0x^}T5?P=2A%U5 z>F;9{Li!GUl%CSr-EnA0dQH+Y1GC>~c4nphR_yLD#&~y}JZH>hj9H)xYc@1@i0W5* zOKRw;19CNnJdQIN!;>10PwtzDfRvrYE?Rd!?jcA@7PD8IVW6Tzr>QVemGf5pR0 z6lJ^plh^8vg~cVyZaR+BblfM+qi`T6VHuUL-z;G1|ST9L()EQfAk76z_?2 z(sx&0%Djw3o{s)VJ=_<0A}3ur&XeLWG~?}yq#X3!)!ryQh16b@r+cChvB*UE!Ln`J zvit7Zbh^>$w7d=9pS8TH@3&jt<_mu|bH7{G)Ai2Q>x1F!?EK@W&tJZNySUU7W*mNM zEz5{=_yGpeaT<>DOy(!xnMco~2#En=fEakR4B&=kIgj=W>BEQtV&I_|Q2T=isxUyT z4C<`|8eIYaHo&a~Y<>9$^ppcIK&%Xc2ZWncK$FU`#Nb#vaFY)G0mfGbO*-TH%`gtW znPY{*vGm}c4re?tNG&ly4BTWu)qWtZI{$b6UjOSLYKQ@1;QwTRH@3s=F3b(j)?2ew wXRQbN4pfPXs|;SJfT53Kh*d}N8mJcVd&&R|5G#Y=0ilb4rhyt_;9eQ{4M_%Pw*UYD literal 0 HcmV?d00001 diff --git a/src/nyc/c4q/.DS_Store b/src/nyc/c4q/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..35e7348261ca097de874fb7f1a0b4bcf5c08e78d GIT binary patch literal 6148 zcmeHK-D=c86rS0xHrd=nv{3M7E*17-tuDDu*D81+EJRww%9@za9f+AF$#yBrLau!b zTYnxy5Pb(9#jERG;$Z3EYl0r~D+a)h^5krQ(1{fW0pE)tB&Pva@{9+aM+!>+AJ zX4S-0{7NP{uj*d!Cv9!CZ`|B;+>YmY9nZhjc^!?#EUM#rS`Fgzm3rc7mKc8+*W;!C zLWumrkCT0#%|`y6$D*iXUS#E^(!&E@q+&J@(;}@7BR$^%PwVl>-x`+LF-nJVk?r$} zCp_o%iQ~Gi|0>BE%YbFz|73u+_oBT4 z_Ga$Zm0ilamOAaUSAc>oQq1SpUL6vQph;88q)--KCvRndlU zLA#5oReiy59UJFPmSJ@FeA z(6h^M##6h&JwBaZeN|R<$zFXmPUr`1G`4^pGM2bQiMp5b*5OQ1ah(TT_i^NWgOlL` z3o;&i8Sfj6Ju;rjsrVKyP;k8$^1s{HD`$|lWpr}|Tme_$zbL?(tv1?C=+PB$1zdrZ z0{VRjbj94TNf-e$kNfZc>m+}21zdqYrGN~JX))oJthRPG vr?ocFFX?JJu1UC}un|i!$7(6wr$=KxXoHv=HVK)b`Hw)9!GkOCqY8WgmlIC_ literal 0 HcmV?d00001 diff --git a/src/nyc/c4q/gmsyrimis/BMI.java b/src/nyc/c4q/gmsyrimis/BMI.java new file mode 100644 index 0000000..9e36fde --- /dev/null +++ b/src/nyc/c4q/gmsyrimis/BMI.java @@ -0,0 +1,37 @@ +package nyc.c4q.gmsyrimis; + +/** + * Created by c4q-george on 3/5/15. + */ +import java.util.Scanner; + +public class BMI { + public static void main(String[] args){ + Scanner keyboard=new Scanner(System.in); + double height; + double weight; + double bmi; + String metricORimperial; + System.out.println("Are you entering in Metric or Imperial system?"); + metricORimperial=keyboard.nextLine(); + + if(metricORimperial.equalsIgnoreCase("metric")) { + System.out.print("Enter your weight: "); + weight = keyboard.nextDouble(); + System.out.print("Enter your height: "); + height = keyboard.nextDouble(); + bmi = weight / (height * height); + System.out.print("Your BMI is " + bmi); + } + if(metricORimperial.equalsIgnoreCase("imperial")){ + System.out.print("Enter your weight: "); + weight = keyboard.nextDouble(); + weight = weight*0.4535; + System.out.print("Enter your height(inches): "); + height = keyboard.nextDouble(); + height=height*0.0254; + bmi = weight / (height * height); + System.out.print("Your BMI is " + bmi); + } + } +} diff --git a/src/nyc/c4q/gmsyrimis/Convo.java b/src/nyc/c4q/gmsyrimis/Convo.java new file mode 100644 index 0000000..bcdc868 --- /dev/null +++ b/src/nyc/c4q/gmsyrimis/Convo.java @@ -0,0 +1,18 @@ +package nyc.c4q.gmsyrimis; + +/** + * Created by c4q-george on 3/5/15. + */ +import java.util.Scanner; + +public class Convo { + public static void main(String[] args){ + System.out.println("Hey, who the hell are you?"); + Scanner keyboard = new Scanner(System.in); + String name = keyboard.nextLine(); + System.out.println(name + " Why don't you go get me a coffee and explain why am I stuck in this thing?"); + String because = keyboard.nextLine(); + System.out.println("I don't want to hear this \"" + because + "\" bullshit!"); + System.out.println("Get me out of here!"); + } +} diff --git a/src/nyc/c4q/gmsyrimis/DumbCalc.java b/src/nyc/c4q/gmsyrimis/DumbCalc.java new file mode 100644 index 0000000..ea0b643 --- /dev/null +++ b/src/nyc/c4q/gmsyrimis/DumbCalc.java @@ -0,0 +1,22 @@ +package nyc.c4q.gmsyrimis; + +/** + * Created by c4q-george on 3/5/15. + */ +import java.util.Scanner; +public class DumbCalc { + public static void main(String[] args){ + double number1; + double number2; + double number3; + double answer; + Scanner keyboard = new Scanner(System.in); + System.out.println("Calculate 3 numbers"); + number1=keyboard.nextDouble(); + number2=keyboard.nextDouble(); + number3=keyboard.nextDouble(); + answer = number1 + number2 + number3; + System.out.println("You answer is:"); + System.out.println( "(" + number1 +" + "+number2+" + "+number3+") = "+answer); + } +} diff --git a/src/nyc/c4q/gmsyrimis/ForgetfulMachine.java b/src/nyc/c4q/gmsyrimis/ForgetfulMachine.java new file mode 100644 index 0000000..401d4f8 --- /dev/null +++ b/src/nyc/c4q/gmsyrimis/ForgetfulMachine.java @@ -0,0 +1,21 @@ +package nyc.c4q.gmsyrimis; + +/** + * Created by c4q-george on 3/5/15. + */ +import java.util.Scanner; + +public class ForgetfulMachine { + public static void main(String[] args){ + System.out.println("Hey what's up?"); + Scanner keyboard = new Scanner(System.in); + keyboard.nextLine(); + System.out.println("Oh, is that great! What are you doing tonight?"); + keyboard.nextLine(); + System.out.println("What time you going to bed?"); + keyboard.nextLine(); + System.out.println("What time you got to wake up?"); + keyboard.nextLine(); + System.out.println("I won't remember anything you said. BYE!"); + } +} diff --git a/src/nyc/c4q/gmsyrimis/Lipz.java b/src/nyc/c4q/gmsyrimis/Lipz.java new file mode 100644 index 0000000..fd23521 --- /dev/null +++ b/src/nyc/c4q/gmsyrimis/Lipz.java @@ -0,0 +1,16 @@ +package nyc.c4q.gmsyrimis; + +/** + * Created by c4q-george on 3/5/15. + */ +import java.util.Scanner; + +public class Lipz { + public static void main(String[] args){ + Scanner keyboard = new Scanner(System.in); + System.out.println("Say something human!!"); + String response = keyboard.nextLine();// .next() is recovering a string + System.out.println(response); + + } +} diff --git a/src/nyc/c4q/gmsyrimis/Mumbo.java b/src/nyc/c4q/gmsyrimis/Mumbo.java deleted file mode 100644 index 959bbae..0000000 --- a/src/nyc/c4q/gmsyrimis/Mumbo.java +++ /dev/null @@ -1,59 +0,0 @@ -package nyc.c4q.gmsyrimis; - -/** - * Created by c4q-george on 3/3/15. - */ -public class Mumbo { - - public static void main(String[] args) { - - String[] days; - - days = new String[12]; - - days[0] = "First"; - days[1] = "Second"; - days[2] = "Third"; - days[3] = "Fourth"; - days[4] = "Fifth"; - days[5] = "Sixth"; - days[6] = "Seventh"; - days[7] = "Eighth"; - days[8] = "Nineth"; - days[9] = "Tenth"; - days[10] = "Eleventh"; - days[11] = "Twelveth"; - - String[] gifts; - - gifts = new String[12]; - - gifts[0] = "a Partridge in a Pear Tree."; - gifts[1] = "Two Turtle Doves"; - gifts[2] = "Three French hens"; - gifts[3] = "Four Calling Birds"; - gifts[4] = "Five Gold Rings"; - gifts[5] = "Six Geese a-Laying"; - gifts[6] = "Seven Swans a-Swimming"; - gifts[7] = "Eight Maids a-Milking"; - gifts[8] = "Nine Ladies Dancing"; - gifts[9] = "Ten Lords a-Leaping"; - gifts[10] = "Eleven Pipers Piping"; - gifts[11] = "Twelve Drummers Drumming"; - - - - String bottom = "";//initializing an empty string to build up the many gifts said in the second block of the verse - for (int g = 0; g < gifts.length; g++) {//this is to loop through the array until the end of its length - int d=g;//this associates the days with the gifts, this was the most important part of my code - bottom = gifts[g] + "\n" + bottom;//this makes the gifts array actually contain the second block of each verse instead on the special gift given on the day - gifts[g]=bottom;//as mentioned above we are rebuilding our array with the bottom block of the verse. - System.out.println("On the " + days[d] + " day of Christmas my true love sent to me");//prints first sentence of song - System.out.println(gifts[g]);//prints the contents of the array which is now the second block of each verse - - - } - - } - } - diff --git a/src/nyc/c4q/gmsyrimis/PeopleCatsDogs.java b/src/nyc/c4q/gmsyrimis/PeopleCatsDogs.java new file mode 100644 index 0000000..e8b88ce --- /dev/null +++ b/src/nyc/c4q/gmsyrimis/PeopleCatsDogs.java @@ -0,0 +1,32 @@ +package nyc.c4q.gmsyrimis; + +/** + * Created by c4q-george on 3/5/15. + */ +import java.util.Scanner; + +public class PeopleCatsDogs { + public static void main(String[] args){ + int people; + int dogs; + int cats; + Scanner keyboard = new Scanner(System.in); + System.out.println("Enter 3 numbers and they will be assigned to people, dogs and cats."); + System.out.println("Then you'll get the forecast for the end of the world..."); + people = keyboard.nextInt(); + dogs=keyboard.nextInt(); + cats=keyboard.nextInt(); + if (cats>people&&cats>dogs){ + System.out.println("Cats now rule the world."); + } + if (cats>people&&catsdogs) { + System.out.println("Most people have cats"); + } + if (cats