====== Assignment 8 ======
===== Part 1 =====
Go to pastebin.com
{{:epgy:msp2013:screen_shot_2013-06-28_at_11.31.34_am.png?500|}}
* Sign up.
* Write down your user information.
* Verify your account.
* Go to your Wordpress page and paste YOUR link with YOUR username into Links:
* http://pastebin.com/u/ffpaladin (this one has my user name)
----
If you have not done so, please put your PasteBin account into your Links page on your Wordpress site.
Create a new PASTE in your own PasteBin account:
Put this code in it:
public class HelloWorld {
public static void main (String [] args)
{
System.out.println("Hello World");
}
}
Save it as Hello World.
Make sure you select the right options for it:
* **Syntax Highlighting:** JAVA
* **Paste Expiration:** NEVER
* **Paste Exposure:** PUBLIC
* **Paste Name / Title:** My Favorite Java Program :)
{{:epgy:msp2013:screen_shot_2013-06-28_at_11.40.56_am.png|}}
You can use this as a reference for future Java Projects.
----
===== Part 2 =====
Extra References on Eclipse:
* [[https://dl.dropboxusercontent.com/u/3235343/Teaching/DMA/Java13/Java1_Day1/00-Setup/Eclipse%20%28existing%20material%29/Eclipse_Cheat_Sheet.pdf|Cheat Sheet]]
* [[https://dl.dropboxusercontent.com/u/3235343/Teaching/DMA/Java13/Java1_Day1/00-Setup/Eclipse%20%28existing%20material%29/Eclipse_Layout.pdf|Layout]]
You are allowed to work in pairs. No groups of 3, but you can work alone.
Java Materials (Credit: Cameron Alston) - [[https://dl.dropboxusercontent.com/u/3235343/Teaching/CameronJava/Lesson%201.docx|1]] [[https://dl.dropboxusercontent.com/u/3235343/Teaching/CameronJava/Lesson%202.docx|2]] [[https://dl.dropboxusercontent.com/u/3235343/Teaching/CameronJava/Lesson%203.docx|3]] [[https://dl.dropboxusercontent.com/u/3235343/Teaching/CameronJava/Lesson%204.docx|4]] [[https://dl.dropboxusercontent.com/u/3235343/Teaching/CameronJava/Lesson%205.docx|5]] [[https://dl.dropboxusercontent.com/u/3235343/Teaching/CameronJava/Lesson%206.docx|6]]
Lessons 1-6 in a PDF: [[https://dl.dropboxusercontent.com/u/3235343/Teaching/CameronJava/Lessons.pdf|PDF]]
Save everything you do in a Paste for YOUR PasteBin, so you can find it later.
{{:epgy:msp2013:functionsinjava.png|}}
Code we went over in class:
public class HelloWorld {
// This is my main function
public static void main (String[] args){
print("Hello World");
int num1 = 10;
int num2 = 55;
print("num1 = " + num1);
int num3 = num2;
num2 = num1;
num1 = num3;
System.out.println("num1 = " + num1);
// adding two numbers
System.out.println( add(num1,num2) );
System.out.println( num1 + num2 );
// subtract
System.out.println( "difference = " + subtract(num1,num2) );
print ("PRINT FUNCTION!!!");
int[] array = {2, 4, 6, 2, 4, 1, 88};
for (int i=0;i
Check out random!
import java.util.Random;
public class HelloWorld {
public static void main (String [] args)
{
Random rand = new Random();
for (int i=0; i<100; i++)
System.out.println(i + " = " + rand.nextInt(2000));
}
}
===== Animation =====
* [[https://dl.dropboxusercontent.com/u/3235343/Teaching/DMA/Java13/Programming%20with%20JAVA/Handouts/Day2/1_random_circles.pdf|Random Circles]]
* [[https://dl.dropboxusercontent.com/u/3235343/Teaching/DMA/Java13/Programming%20with%20JAVA/Handouts/Day2/2_seurat.pdf|Seurat]]
* [[https://dl.dropboxusercontent.com/u/3235343/Teaching/DMA/Java13/Programming%20with%20JAVA/Handouts/Day2/5_extensions.pdf|Meme Gen]]