diff --git a/homework/week-0/.DS_Store b/homework/week-0/.DS_Store new file mode 100644 index 00000000..67d6dea4 Binary files /dev/null and b/homework/week-0/.DS_Store differ diff --git a/homework/week-0/sarahkim/.DS_Store b/homework/week-0/sarahkim/.DS_Store new file mode 100644 index 00000000..d76738ca Binary files /dev/null and b/homework/week-0/sarahkim/.DS_Store differ diff --git a/homework/week-0/sarahkim/AdventureGame/.idea/compiler.xml b/homework/week-0/sarahkim/AdventureGame/.idea/compiler.xml new file mode 100644 index 00000000..a8523149 --- /dev/null +++ b/homework/week-0/sarahkim/AdventureGame/.idea/compiler.xml @@ -0,0 +1,23 @@ + + + + + \ No newline at end of file diff --git a/homework/week-0/sarahkim/AdventureGame/.idea/copyright/profiles_settings.xml b/homework/week-0/sarahkim/AdventureGame/.idea/copyright/profiles_settings.xml new file mode 100644 index 00000000..e7bedf33 --- /dev/null +++ b/homework/week-0/sarahkim/AdventureGame/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/homework/week-0/sarahkim/AdventureGame/.idea/description.html b/homework/week-0/sarahkim/AdventureGame/.idea/description.html new file mode 100644 index 00000000..db5f1295 --- /dev/null +++ b/homework/week-0/sarahkim/AdventureGame/.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/homework/week-0/sarahkim/AdventureGame/.idea/encodings.xml b/homework/week-0/sarahkim/AdventureGame/.idea/encodings.xml new file mode 100644 index 00000000..d8210482 --- /dev/null +++ b/homework/week-0/sarahkim/AdventureGame/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/homework/week-0/sarahkim/AdventureGame/.idea/misc.xml b/homework/week-0/sarahkim/AdventureGame/.idea/misc.xml new file mode 100644 index 00000000..ccf24ce4 --- /dev/null +++ b/homework/week-0/sarahkim/AdventureGame/.idea/misc.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/homework/week-0/sarahkim/AdventureGame/.idea/modules.xml b/homework/week-0/sarahkim/AdventureGame/.idea/modules.xml new file mode 100644 index 00000000..b4e016c7 --- /dev/null +++ b/homework/week-0/sarahkim/AdventureGame/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/homework/week-0/sarahkim/AdventureGame/.idea/project-template.xml b/homework/week-0/sarahkim/AdventureGame/.idea/project-template.xml new file mode 100644 index 00000000..1f08b887 --- /dev/null +++ b/homework/week-0/sarahkim/AdventureGame/.idea/project-template.xml @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/homework/week-0/sarahkim/AdventureGame/.idea/scopes/scope_settings.xml b/homework/week-0/sarahkim/AdventureGame/.idea/scopes/scope_settings.xml new file mode 100644 index 00000000..922003b8 --- /dev/null +++ b/homework/week-0/sarahkim/AdventureGame/.idea/scopes/scope_settings.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/homework/week-0/sarahkim/AdventureGame/.idea/uiDesigner.xml b/homework/week-0/sarahkim/AdventureGame/.idea/uiDesigner.xml new file mode 100644 index 00000000..e96534fb --- /dev/null +++ b/homework/week-0/sarahkim/AdventureGame/.idea/uiDesigner.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/homework/week-0/sarahkim/AdventureGame/.idea/vcs.xml b/homework/week-0/sarahkim/AdventureGame/.idea/vcs.xml new file mode 100644 index 00000000..6564d52d --- /dev/null +++ b/homework/week-0/sarahkim/AdventureGame/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/homework/week-0/sarahkim/AdventureGame/.idea/workspace.xml b/homework/week-0/sarahkim/AdventureGame/.idea/workspace.xml new file mode 100644 index 00000000..6719bdbb --- /dev/null +++ b/homework/week-0/sarahkim/AdventureGame/.idea/workspace.xml @@ -0,0 +1,979 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1430139142899 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/homework/week-0/sarahkim/AdventureGame/AdventureGame.iml b/homework/week-0/sarahkim/AdventureGame/AdventureGame.iml new file mode 100644 index 00000000..d5c07432 --- /dev/null +++ b/homework/week-0/sarahkim/AdventureGame/AdventureGame.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/homework/week-0/sarahkim/AdventureGame/out/production/AdventureGame/nyc/c4q/hyunj0/Boys.class b/homework/week-0/sarahkim/AdventureGame/out/production/AdventureGame/nyc/c4q/hyunj0/Boys.class new file mode 100644 index 00000000..e93a64d2 Binary files /dev/null and b/homework/week-0/sarahkim/AdventureGame/out/production/AdventureGame/nyc/c4q/hyunj0/Boys.class differ diff --git a/homework/week-0/sarahkim/AdventureGame/out/production/AdventureGame/nyc/c4q/hyunj0/Characters.class b/homework/week-0/sarahkim/AdventureGame/out/production/AdventureGame/nyc/c4q/hyunj0/Characters.class new file mode 100644 index 00000000..20bfa414 Binary files /dev/null and b/homework/week-0/sarahkim/AdventureGame/out/production/AdventureGame/nyc/c4q/hyunj0/Characters.class differ diff --git a/homework/week-0/sarahkim/AdventureGame/out/production/AdventureGame/nyc/c4q/hyunj0/Dice.class b/homework/week-0/sarahkim/AdventureGame/out/production/AdventureGame/nyc/c4q/hyunj0/Dice.class new file mode 100644 index 00000000..c0b10b6b Binary files /dev/null and b/homework/week-0/sarahkim/AdventureGame/out/production/AdventureGame/nyc/c4q/hyunj0/Dice.class differ diff --git a/homework/week-0/sarahkim/AdventureGame/out/production/AdventureGame/nyc/c4q/hyunj0/Girls.class b/homework/week-0/sarahkim/AdventureGame/out/production/AdventureGame/nyc/c4q/hyunj0/Girls.class new file mode 100644 index 00000000..52cb1c1a Binary files /dev/null and b/homework/week-0/sarahkim/AdventureGame/out/production/AdventureGame/nyc/c4q/hyunj0/Girls.class differ diff --git a/homework/week-0/sarahkim/AdventureGame/out/production/AdventureGame/nyc/c4q/hyunj0/Main.class b/homework/week-0/sarahkim/AdventureGame/out/production/AdventureGame/nyc/c4q/hyunj0/Main.class new file mode 100644 index 00000000..541734bc Binary files /dev/null and b/homework/week-0/sarahkim/AdventureGame/out/production/AdventureGame/nyc/c4q/hyunj0/Main.class differ diff --git a/homework/week-0/sarahkim/AdventureGame/out/production/AdventureGame/nyc/c4q/hyunj0/Room.class b/homework/week-0/sarahkim/AdventureGame/out/production/AdventureGame/nyc/c4q/hyunj0/Room.class new file mode 100644 index 00000000..8cb27494 Binary files /dev/null and b/homework/week-0/sarahkim/AdventureGame/out/production/AdventureGame/nyc/c4q/hyunj0/Room.class differ diff --git a/homework/week-0/sarahkim/AdventureGame/out/production/AdventureGame/nyc/c4q/hyunj0/Weapon.class b/homework/week-0/sarahkim/AdventureGame/out/production/AdventureGame/nyc/c4q/hyunj0/Weapon.class new file mode 100644 index 00000000..15bdf33c Binary files /dev/null and b/homework/week-0/sarahkim/AdventureGame/out/production/AdventureGame/nyc/c4q/hyunj0/Weapon.class differ diff --git a/homework/week-0/sarahkim/AdventureGame/src/nyc/c4q/hyunj0/Air.java b/homework/week-0/sarahkim/AdventureGame/src/nyc/c4q/hyunj0/Air.java new file mode 100644 index 00000000..4eaa3a80 --- /dev/null +++ b/homework/week-0/sarahkim/AdventureGame/src/nyc/c4q/hyunj0/Air.java @@ -0,0 +1,22 @@ +package nyc.c4q.hyunj0; +/** + * Created by c4q-sarahkim on 5/2/15. + */ +public class Air extends Room +{ + public Air (int capacity) { + super(capacity); + } + + @Override + public void release() + { + int release = this.getCapacity() - 2; + } + + @Override + void receive() + { + int receive = this.getCapacity() + 2; + } +} diff --git a/homework/week-0/sarahkim/AdventureGame/src/nyc/c4q/hyunj0/Boys.java b/homework/week-0/sarahkim/AdventureGame/src/nyc/c4q/hyunj0/Boys.java new file mode 100644 index 00000000..e255cf30 --- /dev/null +++ b/homework/week-0/sarahkim/AdventureGame/src/nyc/c4q/hyunj0/Boys.java @@ -0,0 +1,13 @@ +package nyc.c4q.hyunj0; + +public class Boys extends Characters +{ + public Boys () { + super(); + } + + public Boys (String name, int age) { + super(name, age); + } + +} \ No newline at end of file diff --git a/homework/week-0/sarahkim/AdventureGame/src/nyc/c4q/hyunj0/Characters.java b/homework/week-0/sarahkim/AdventureGame/src/nyc/c4q/hyunj0/Characters.java new file mode 100644 index 00000000..96488570 --- /dev/null +++ b/homework/week-0/sarahkim/AdventureGame/src/nyc/c4q/hyunj0/Characters.java @@ -0,0 +1,53 @@ +package nyc.c4q.hyunj0; + +public abstract class Characters +{ + private String name; + private int age; + + public Characters () { + + } + + public Characters (String name, int age) { + this.name = name; + this.age = age; + } + + public String getName () { + return this.name; + } + + public void setName (String name) { + this.name = name; + } + + public int getAge () { + return this.age; + } + + public void setAge (int age) { + this.age = age; + } + + public boolean haveDice (int diceCount) + { + if (diceCount == 3) + return true; + else + return false; + } + + public int playCeelo (int x, int y, int z) { + if (x == y && x == z) { + return x; + } else if (x == y && x != z) { + return z; + } else if (x != y && x == z) { + return y; + } else if (x != y && x != z) { + + } + return -1; + } +} diff --git a/homework/week-0/sarahkim/AdventureGame/src/nyc/c4q/hyunj0/Dice.java b/homework/week-0/sarahkim/AdventureGame/src/nyc/c4q/hyunj0/Dice.java new file mode 100644 index 00000000..15bf2b64 --- /dev/null +++ b/homework/week-0/sarahkim/AdventureGame/src/nyc/c4q/hyunj0/Dice.java @@ -0,0 +1,19 @@ +package nyc.c4q.hyunj0; + +import java.util.Random; + +public class Dice +{ + private int side; + + public Dice () { + + } + + public int rollDice () { + Random random = new Random(); + int outcome = random.nextInt(6)+1; + return outcome; + } + +} diff --git a/homework/week-0/sarahkim/AdventureGame/src/nyc/c4q/hyunj0/Earth.java b/homework/week-0/sarahkim/AdventureGame/src/nyc/c4q/hyunj0/Earth.java new file mode 100644 index 00000000..de0815fd --- /dev/null +++ b/homework/week-0/sarahkim/AdventureGame/src/nyc/c4q/hyunj0/Earth.java @@ -0,0 +1,22 @@ +package nyc.c4q.hyunj0; +/** + * Created by c4q-sarahkim on 5/2/15. + */ +public class Earth extends Room +{ + public Earth (int capacity) { + super(capacity); + } + + @Override + public void release() + { + int release = this.getCapacity() - 1; + } + + @Override + void receive() + { + int receive = this.getCapacity() + 1; + } +} diff --git a/homework/week-0/sarahkim/AdventureGame/src/nyc/c4q/hyunj0/Fire.java b/homework/week-0/sarahkim/AdventureGame/src/nyc/c4q/hyunj0/Fire.java new file mode 100644 index 00000000..59cca4d4 --- /dev/null +++ b/homework/week-0/sarahkim/AdventureGame/src/nyc/c4q/hyunj0/Fire.java @@ -0,0 +1,22 @@ +package nyc.c4q.hyunj0; +/** + * Created by c4q-sarahkim on 5/2/15. + */ +public class Fire extends Room +{ + public Fire (int capacity) { + super(capacity); + } + + @Override + public void release() + { + int release = this.getCapacity() - 2; + } + + @Override + void receive() + { + int receive = this.getCapacity() + 1; + } +} diff --git a/homework/week-0/sarahkim/AdventureGame/src/nyc/c4q/hyunj0/Girls.java b/homework/week-0/sarahkim/AdventureGame/src/nyc/c4q/hyunj0/Girls.java new file mode 100644 index 00000000..61c20ff3 --- /dev/null +++ b/homework/week-0/sarahkim/AdventureGame/src/nyc/c4q/hyunj0/Girls.java @@ -0,0 +1,13 @@ +package nyc.c4q.hyunj0; + +public class Girls extends Characters +{ + public Girls () { + super(); + } + + public Girls (String name, int age) { + super(name, age); + } + +} diff --git a/homework/week-0/sarahkim/AdventureGame/src/nyc/c4q/hyunj0/Main.java b/homework/week-0/sarahkim/AdventureGame/src/nyc/c4q/hyunj0/Main.java new file mode 100644 index 00000000..fddb0df8 --- /dev/null +++ b/homework/week-0/sarahkim/AdventureGame/src/nyc/c4q/hyunj0/Main.java @@ -0,0 +1,16 @@ +package nyc.c4q.hyunj0; + +public class Main { + + public static void main(String[] args) { + Boys robert = new Boys("Robert", 13); + Girls elizabeth = new Girls("Elizabeth", 15); + for (int x = 1; x < 7; x++) { + for (int y = 1; y < 7; y++) { + for (int z = 1; z < 7; z ++) { + System.out.println(" " + x + " " + y + " " + z + " " + robert.playCeelo(x, y, z)); + } + } + } + } +} diff --git a/homework/week-0/sarahkim/AdventureGame/src/nyc/c4q/hyunj0/Room.java b/homework/week-0/sarahkim/AdventureGame/src/nyc/c4q/hyunj0/Room.java new file mode 100644 index 00000000..1eefb4c8 --- /dev/null +++ b/homework/week-0/sarahkim/AdventureGame/src/nyc/c4q/hyunj0/Room.java @@ -0,0 +1,35 @@ +package nyc.c4q.hyunj0; + +public abstract class Room +{ + private int capacity; + + public Room (int capacity) { + this.capacity = capacity; + } + + public int getCapacity() + { + return capacity; + } + + public void setCapacity(int capacity) + { + this.capacity = capacity; + } + + public int maxCapacity () { + return 10; + } + + public boolean exceedsMax () { + if (this.getCapacity() > 10) + return true; + else + return false; + } + + abstract void release (); + abstract void receive (); + +} diff --git a/homework/week-0/sarahkim/AdventureGame/src/nyc/c4q/hyunj0/Water.java b/homework/week-0/sarahkim/AdventureGame/src/nyc/c4q/hyunj0/Water.java new file mode 100644 index 00000000..1dcbe52b --- /dev/null +++ b/homework/week-0/sarahkim/AdventureGame/src/nyc/c4q/hyunj0/Water.java @@ -0,0 +1,22 @@ +package nyc.c4q.hyunj0; +/** + * Created by c4q-sarahkim on 5/2/15. + */ +public class Water extends Room +{ + public Water (int capacity) { + super(capacity); + } + + @Override + public void release() + { + int release = this.getCapacity() - 1; + } + + @Override + void receive() + { + int receive = this.getCapacity() + 2; + } +} diff --git a/homework/week-0/sarahkim/AdventureGame/src/nyc/c4q/hyunj0/Weapon.java b/homework/week-0/sarahkim/AdventureGame/src/nyc/c4q/hyunj0/Weapon.java new file mode 100644 index 00000000..4b4874f0 --- /dev/null +++ b/homework/week-0/sarahkim/AdventureGame/src/nyc/c4q/hyunj0/Weapon.java @@ -0,0 +1,6 @@ +package nyc.c4q.hyunj0; + +public interface Weapon +{ + +} diff --git a/homework/week-0/sarahkim/AnimalSort/.idea/compiler.xml b/homework/week-0/sarahkim/AnimalSort/.idea/compiler.xml new file mode 100644 index 00000000..a8523149 --- /dev/null +++ b/homework/week-0/sarahkim/AnimalSort/.idea/compiler.xml @@ -0,0 +1,23 @@ + + + + + \ No newline at end of file diff --git a/homework/week-0/sarahkim/AnimalSort/.idea/copyright/profiles_settings.xml b/homework/week-0/sarahkim/AnimalSort/.idea/copyright/profiles_settings.xml new file mode 100644 index 00000000..e7bedf33 --- /dev/null +++ b/homework/week-0/sarahkim/AnimalSort/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/homework/week-0/sarahkim/AnimalSort/.idea/description.html b/homework/week-0/sarahkim/AnimalSort/.idea/description.html new file mode 100644 index 00000000..db5f1295 --- /dev/null +++ b/homework/week-0/sarahkim/AnimalSort/.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/homework/week-0/sarahkim/AnimalSort/.idea/encodings.xml b/homework/week-0/sarahkim/AnimalSort/.idea/encodings.xml new file mode 100644 index 00000000..d8210482 --- /dev/null +++ b/homework/week-0/sarahkim/AnimalSort/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/homework/week-0/sarahkim/AnimalSort/.idea/misc.xml b/homework/week-0/sarahkim/AnimalSort/.idea/misc.xml new file mode 100644 index 00000000..b63395b0 --- /dev/null +++ b/homework/week-0/sarahkim/AnimalSort/.idea/misc.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/homework/week-0/sarahkim/AnimalSort/.idea/modules.xml b/homework/week-0/sarahkim/AnimalSort/.idea/modules.xml new file mode 100644 index 00000000..cef7570c --- /dev/null +++ b/homework/week-0/sarahkim/AnimalSort/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/homework/week-0/sarahkim/AnimalSort/.idea/project-template.xml b/homework/week-0/sarahkim/AnimalSort/.idea/project-template.xml new file mode 100644 index 00000000..1f08b887 --- /dev/null +++ b/homework/week-0/sarahkim/AnimalSort/.idea/project-template.xml @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/homework/week-0/sarahkim/AnimalSort/.idea/scopes/scope_settings.xml b/homework/week-0/sarahkim/AnimalSort/.idea/scopes/scope_settings.xml new file mode 100644 index 00000000..922003b8 --- /dev/null +++ b/homework/week-0/sarahkim/AnimalSort/.idea/scopes/scope_settings.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/homework/week-0/sarahkim/AnimalSort/.idea/uiDesigner.xml b/homework/week-0/sarahkim/AnimalSort/.idea/uiDesigner.xml new file mode 100644 index 00000000..e96534fb --- /dev/null +++ b/homework/week-0/sarahkim/AnimalSort/.idea/uiDesigner.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/homework/week-0/sarahkim/AnimalSort/.idea/vcs.xml b/homework/week-0/sarahkim/AnimalSort/.idea/vcs.xml new file mode 100644 index 00000000..6564d52d --- /dev/null +++ b/homework/week-0/sarahkim/AnimalSort/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/homework/week-0/sarahkim/AnimalSort/.idea/workspace.xml b/homework/week-0/sarahkim/AnimalSort/.idea/workspace.xml new file mode 100644 index 00000000..a26d710e --- /dev/null +++ b/homework/week-0/sarahkim/AnimalSort/.idea/workspace.xml @@ -0,0 +1,810 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1430100149854 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/homework/week-0/sarahkim/AnimalSort/AnimalSort.iml b/homework/week-0/sarahkim/AnimalSort/AnimalSort.iml new file mode 100644 index 00000000..d5c07432 --- /dev/null +++ b/homework/week-0/sarahkim/AnimalSort/AnimalSort.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/homework/week-0/sarahkim/AnimalSort/out/production/AnimalSort/nyc/c4q/hyunj0/Animal.class b/homework/week-0/sarahkim/AnimalSort/out/production/AnimalSort/nyc/c4q/hyunj0/Animal.class new file mode 100644 index 00000000..f1678d19 Binary files /dev/null and b/homework/week-0/sarahkim/AnimalSort/out/production/AnimalSort/nyc/c4q/hyunj0/Animal.class differ diff --git a/homework/week-0/sarahkim/AnimalSort/out/production/AnimalSort/nyc/c4q/hyunj0/Domestic.class b/homework/week-0/sarahkim/AnimalSort/out/production/AnimalSort/nyc/c4q/hyunj0/Domestic.class new file mode 100644 index 00000000..ad5f20c5 Binary files /dev/null and b/homework/week-0/sarahkim/AnimalSort/out/production/AnimalSort/nyc/c4q/hyunj0/Domestic.class differ diff --git a/homework/week-0/sarahkim/AnimalSort/out/production/AnimalSort/nyc/c4q/hyunj0/DomesticCat.class b/homework/week-0/sarahkim/AnimalSort/out/production/AnimalSort/nyc/c4q/hyunj0/DomesticCat.class new file mode 100644 index 00000000..63a49dc6 Binary files /dev/null and b/homework/week-0/sarahkim/AnimalSort/out/production/AnimalSort/nyc/c4q/hyunj0/DomesticCat.class differ diff --git a/homework/week-0/sarahkim/AnimalSort/out/production/AnimalSort/nyc/c4q/hyunj0/Main.class b/homework/week-0/sarahkim/AnimalSort/out/production/AnimalSort/nyc/c4q/hyunj0/Main.class new file mode 100644 index 00000000..d4b26c95 Binary files /dev/null and b/homework/week-0/sarahkim/AnimalSort/out/production/AnimalSort/nyc/c4q/hyunj0/Main.class differ diff --git a/homework/week-0/sarahkim/AnimalSort/src/nyc/c4q/hyunj0/Animal.java b/homework/week-0/sarahkim/AnimalSort/src/nyc/c4q/hyunj0/Animal.java new file mode 100644 index 00000000..2ff2dffb --- /dev/null +++ b/homework/week-0/sarahkim/AnimalSort/src/nyc/c4q/hyunj0/Animal.java @@ -0,0 +1,30 @@ +package nyc.c4q.hyunj0; + +public class Animal implements Comparable +{ + private String speciesName; + + public Animal (String speciesName) { + this.speciesName = speciesName; + } + + public String getSpeciesName () { + return speciesName; + } + + public void setSpeciesName (String speciesName) { + this.speciesName = speciesName; + } + + @Override + public int compareTo (Animal animal) { + return this.getSpeciesName().compareTo(animal.getSpeciesName()); + } + + @Override + public boolean equals(Object animal) + { + Animal animalNow = (Animal) animal; + return this.getSpeciesName().equals(animalNow.getSpeciesName()); + } +} diff --git a/homework/week-0/sarahkim/AnimalSort/src/nyc/c4q/hyunj0/Domestic.java b/homework/week-0/sarahkim/AnimalSort/src/nyc/c4q/hyunj0/Domestic.java new file mode 100644 index 00000000..3af2c5a5 --- /dev/null +++ b/homework/week-0/sarahkim/AnimalSort/src/nyc/c4q/hyunj0/Domestic.java @@ -0,0 +1,7 @@ +package nyc.c4q.hyunj0; + +public interface Domestic +{ + public String getName (); + public void setName (String name); +} diff --git a/homework/week-0/sarahkim/AnimalSort/src/nyc/c4q/hyunj0/DomesticCat.java b/homework/week-0/sarahkim/AnimalSort/src/nyc/c4q/hyunj0/DomesticCat.java new file mode 100644 index 00000000..62a9dec7 --- /dev/null +++ b/homework/week-0/sarahkim/AnimalSort/src/nyc/c4q/hyunj0/DomesticCat.java @@ -0,0 +1,38 @@ +package nyc.c4q.hyunj0; + +/** +* Created by c4q-sarahkim on 5/1/15. +*/ +public class DomesticCat extends Animal implements Domestic +{ + private String name; + + public DomesticCat(String speciesName, String name) + { + super(speciesName); + this.name = name; + } + + public String getName() + { + return this.name; + } + + public void setName(String givenName) { + this.name = givenName; + } + + @Override + public int compareTo (Animal animal) { + DomesticCat animalNow = (DomesticCat) animal; + return this.getName().compareTo(animalNow.getName()); + } + + @Override + public boolean equals(Object animal) + { + DomesticCat animalNow = (DomesticCat) animal; + return this.getName().equals(animalNow.getName()); + } + +} diff --git a/homework/week-0/sarahkim/AnimalSort/src/nyc/c4q/hyunj0/Main.java b/homework/week-0/sarahkim/AnimalSort/src/nyc/c4q/hyunj0/Main.java new file mode 100644 index 00000000..cc04ec06 --- /dev/null +++ b/homework/week-0/sarahkim/AnimalSort/src/nyc/c4q/hyunj0/Main.java @@ -0,0 +1,38 @@ +package nyc.c4q.hyunj0; + +public class Main { + public static void main(String[] args) + { + Animal frankie = new Animal("Dog"); + Animal cathy = new Animal("Cat"); + Animal henry = new Animal("Hamster"); + Animal ginnie = new Animal("Gerbil"); + Animal kirin = new Animal("Giraffe"); + + Animal[] animals = new Animal[]{frankie,cathy,henry,ginnie,kirin}; + + Animal sugar = new Animal("Giraffe"); + + for (Animal animal : animals) { + System.out.println(animal.compareTo(sugar)); + System.out.println(animal.equals(sugar)); + } + + DomesticCat piper = new DomesticCat("Cat", "Piper"); + DomesticCat paige = new DomesticCat("Cat", "Paige"); + DomesticCat penny = new DomesticCat("Cat", "Penny"); + DomesticCat phoebe = new DomesticCat("Cat", "Phoebe"); + DomesticCat pony = new DomesticCat("Cat", "Pony"); + + DomesticCat[] cats = new DomesticCat[]{piper,paige,penny,phoebe,pony}; + + DomesticCat sugars = new DomesticCat("Cat", "Penny"); + + for (DomesticCat animal : cats) { + System.out.println(animal.compareTo(sugars)); + System.out.println(animal.equals(sugars)); + } + + } + +} diff --git a/homework/week-0/sarahkim/Cards/.idea/compiler.xml b/homework/week-0/sarahkim/Cards/.idea/compiler.xml new file mode 100644 index 00000000..a8523149 --- /dev/null +++ b/homework/week-0/sarahkim/Cards/.idea/compiler.xml @@ -0,0 +1,23 @@ + + + + + \ No newline at end of file diff --git a/homework/week-0/sarahkim/Cards/.idea/copyright/profiles_settings.xml b/homework/week-0/sarahkim/Cards/.idea/copyright/profiles_settings.xml new file mode 100644 index 00000000..e7bedf33 --- /dev/null +++ b/homework/week-0/sarahkim/Cards/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/homework/week-0/sarahkim/Cards/.idea/description.html b/homework/week-0/sarahkim/Cards/.idea/description.html new file mode 100644 index 00000000..db5f1295 --- /dev/null +++ b/homework/week-0/sarahkim/Cards/.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/homework/week-0/sarahkim/Cards/.idea/encodings.xml b/homework/week-0/sarahkim/Cards/.idea/encodings.xml new file mode 100644 index 00000000..d8210482 --- /dev/null +++ b/homework/week-0/sarahkim/Cards/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/homework/week-0/sarahkim/Cards/.idea/misc.xml b/homework/week-0/sarahkim/Cards/.idea/misc.xml new file mode 100644 index 00000000..ccf24ce4 --- /dev/null +++ b/homework/week-0/sarahkim/Cards/.idea/misc.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/homework/week-0/sarahkim/Cards/.idea/modules.xml b/homework/week-0/sarahkim/Cards/.idea/modules.xml new file mode 100644 index 00000000..a8fcf040 --- /dev/null +++ b/homework/week-0/sarahkim/Cards/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/homework/week-0/sarahkim/Cards/.idea/project-template.xml b/homework/week-0/sarahkim/Cards/.idea/project-template.xml new file mode 100644 index 00000000..1f08b887 --- /dev/null +++ b/homework/week-0/sarahkim/Cards/.idea/project-template.xml @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/homework/week-0/sarahkim/Cards/.idea/scopes/scope_settings.xml b/homework/week-0/sarahkim/Cards/.idea/scopes/scope_settings.xml new file mode 100644 index 00000000..922003b8 --- /dev/null +++ b/homework/week-0/sarahkim/Cards/.idea/scopes/scope_settings.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/homework/week-0/sarahkim/Cards/.idea/vcs.xml b/homework/week-0/sarahkim/Cards/.idea/vcs.xml new file mode 100644 index 00000000..6564d52d --- /dev/null +++ b/homework/week-0/sarahkim/Cards/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/homework/week-0/sarahkim/Cards/.idea/workspace.xml b/homework/week-0/sarahkim/Cards/.idea/workspace.xml new file mode 100644 index 00000000..0c51e8de --- /dev/null +++ b/homework/week-0/sarahkim/Cards/.idea/workspace.xml @@ -0,0 +1,546 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1430139050868 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/homework/week-0/sarahkim/Cards/Cards.iml b/homework/week-0/sarahkim/Cards/Cards.iml new file mode 100644 index 00000000..d5c07432 --- /dev/null +++ b/homework/week-0/sarahkim/Cards/Cards.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/homework/week-0/sarahkim/Cards/out/production/Cards/nyc/c4q/hyunj0/Card.class b/homework/week-0/sarahkim/Cards/out/production/Cards/nyc/c4q/hyunj0/Card.class new file mode 100644 index 00000000..ca1016a7 Binary files /dev/null and b/homework/week-0/sarahkim/Cards/out/production/Cards/nyc/c4q/hyunj0/Card.class differ diff --git a/homework/week-0/sarahkim/Cards/out/production/Cards/nyc/c4q/hyunj0/Game.class b/homework/week-0/sarahkim/Cards/out/production/Cards/nyc/c4q/hyunj0/Game.class new file mode 100644 index 00000000..0ec54653 Binary files /dev/null and b/homework/week-0/sarahkim/Cards/out/production/Cards/nyc/c4q/hyunj0/Game.class differ diff --git a/homework/week-0/sarahkim/Cards/out/production/Cards/nyc/c4q/hyunj0/Main.class b/homework/week-0/sarahkim/Cards/out/production/Cards/nyc/c4q/hyunj0/Main.class new file mode 100644 index 00000000..40bd6ab6 Binary files /dev/null and b/homework/week-0/sarahkim/Cards/out/production/Cards/nyc/c4q/hyunj0/Main.class differ diff --git a/homework/week-0/sarahkim/Cards/out/production/Cards/nyc/c4q/hyunj0/PlayingCards.class b/homework/week-0/sarahkim/Cards/out/production/Cards/nyc/c4q/hyunj0/PlayingCards.class new file mode 100644 index 00000000..697647c9 Binary files /dev/null and b/homework/week-0/sarahkim/Cards/out/production/Cards/nyc/c4q/hyunj0/PlayingCards.class differ diff --git a/homework/week-0/sarahkim/Cards/src/nyc/c4q/hyunj0/Card.java b/homework/week-0/sarahkim/Cards/src/nyc/c4q/hyunj0/Card.java new file mode 100644 index 00000000..b649fc8b --- /dev/null +++ b/homework/week-0/sarahkim/Cards/src/nyc/c4q/hyunj0/Card.java @@ -0,0 +1,19 @@ +package nyc.c4q.hyunj0; + +public class Card +{ + String suit, rank; + + public Card (String suit, String rank) { + this.suit = suit; + this.rank = rank; + } + + String getSuit () { + return this.suit; + } + + String getRank () { + return this.rank; + } +} diff --git a/homework/week-0/sarahkim/Cards/src/nyc/c4q/hyunj0/Game.java b/homework/week-0/sarahkim/Cards/src/nyc/c4q/hyunj0/Game.java new file mode 100644 index 00000000..57e78af5 --- /dev/null +++ b/homework/week-0/sarahkim/Cards/src/nyc/c4q/hyunj0/Game.java @@ -0,0 +1,6 @@ +package nyc.c4q.hyunj0; + +public abstract class Game +{ + public abstract Card getpieces (int i); +} diff --git a/homework/week-0/sarahkim/Cards/src/nyc/c4q/hyunj0/Main.java b/homework/week-0/sarahkim/Cards/src/nyc/c4q/hyunj0/Main.java new file mode 100644 index 00000000..31927c6a --- /dev/null +++ b/homework/week-0/sarahkim/Cards/src/nyc/c4q/hyunj0/Main.java @@ -0,0 +1,13 @@ +package nyc.c4q.hyunj0; + +public class Main { + + public static void main(String[] args) + { + PlayingCards newDeck = new PlayingCards(); + for(int i = 0; i < 52; i++) + { + System.out.println(newDeck.getpieces(i).getSuit() + " " + newDeck.getpieces(i).getRank()); + } + } +} diff --git a/homework/week-0/sarahkim/Cards/src/nyc/c4q/hyunj0/PlayingCards.java b/homework/week-0/sarahkim/Cards/src/nyc/c4q/hyunj0/PlayingCards.java new file mode 100644 index 00000000..101809c3 --- /dev/null +++ b/homework/week-0/sarahkim/Cards/src/nyc/c4q/hyunj0/PlayingCards.java @@ -0,0 +1,21 @@ +package nyc.c4q.hyunj0; +import java.util.ArrayList; + +public class PlayingCards extends Game +{ + ArrayList deck = new ArrayList(); + String[] suits = new String[] {"Diamonds", "Clubs", "Hearts", "Spades"}; + String[] ranks = new String[] {"A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K"}; + + public PlayingCards () { + for (int i = 0; i < suits.length; i++) { + for (int j = 0; j < ranks.length; j++) { + deck.add(new Card(suits[i], ranks[j])); + } + } + } + + public Card getpieces (int i) { + return this.deck.get(i); + } +} diff --git a/homework/week-1/.DS_Store b/homework/week-1/.DS_Store new file mode 100644 index 00000000..98b37eab Binary files /dev/null and b/homework/week-1/.DS_Store differ diff --git a/homework/week-1/sarahkim/.DS_Store b/homework/week-1/sarahkim/.DS_Store new file mode 100644 index 00000000..df5816dd Binary files /dev/null and b/homework/week-1/sarahkim/.DS_Store differ diff --git a/homework/week-1/sarahkim/Horoscope/.gitignore b/homework/week-1/sarahkim/Horoscope/.gitignore new file mode 100644 index 00000000..afbdab33 --- /dev/null +++ b/homework/week-1/sarahkim/Horoscope/.gitignore @@ -0,0 +1,6 @@ +.gradle +/local.properties +/.idea/workspace.xml +/.idea/libraries +.DS_Store +/build diff --git a/homework/week-1/sarahkim/Horoscope/.idea/.name b/homework/week-1/sarahkim/Horoscope/.idea/.name new file mode 100644 index 00000000..b6e2a0b0 --- /dev/null +++ b/homework/week-1/sarahkim/Horoscope/.idea/.name @@ -0,0 +1 @@ +Horoscope \ No newline at end of file diff --git a/homework/week-1/sarahkim/Horoscope/.idea/compiler.xml b/homework/week-1/sarahkim/Horoscope/.idea/compiler.xml new file mode 100644 index 00000000..217af471 --- /dev/null +++ b/homework/week-1/sarahkim/Horoscope/.idea/compiler.xml @@ -0,0 +1,23 @@ + + + + + + diff --git a/homework/week-1/sarahkim/Horoscope/.idea/copyright/profiles_settings.xml b/homework/week-1/sarahkim/Horoscope/.idea/copyright/profiles_settings.xml new file mode 100644 index 00000000..e7bedf33 --- /dev/null +++ b/homework/week-1/sarahkim/Horoscope/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/homework/week-1/sarahkim/Horoscope/.idea/encodings.xml b/homework/week-1/sarahkim/Horoscope/.idea/encodings.xml new file mode 100644 index 00000000..e206d70d --- /dev/null +++ b/homework/week-1/sarahkim/Horoscope/.idea/encodings.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/homework/week-1/sarahkim/Horoscope/.idea/gradle.xml b/homework/week-1/sarahkim/Horoscope/.idea/gradle.xml new file mode 100644 index 00000000..736c7b5c --- /dev/null +++ b/homework/week-1/sarahkim/Horoscope/.idea/gradle.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/homework/week-1/sarahkim/Horoscope/.idea/misc.xml b/homework/week-1/sarahkim/Horoscope/.idea/misc.xml new file mode 100644 index 00000000..59436c98 --- /dev/null +++ b/homework/week-1/sarahkim/Horoscope/.idea/misc.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/homework/week-1/sarahkim/Horoscope/.idea/modules.xml b/homework/week-1/sarahkim/Horoscope/.idea/modules.xml new file mode 100644 index 00000000..86657337 --- /dev/null +++ b/homework/week-1/sarahkim/Horoscope/.idea/modules.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/homework/week-1/sarahkim/Horoscope/.idea/scopes/scope_settings.xml b/homework/week-1/sarahkim/Horoscope/.idea/scopes/scope_settings.xml new file mode 100644 index 00000000..922003b8 --- /dev/null +++ b/homework/week-1/sarahkim/Horoscope/.idea/scopes/scope_settings.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/homework/week-1/sarahkim/Horoscope/.idea/vcs.xml b/homework/week-1/sarahkim/Horoscope/.idea/vcs.xml new file mode 100644 index 00000000..def6a6a1 --- /dev/null +++ b/homework/week-1/sarahkim/Horoscope/.idea/vcs.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/homework/week-1/sarahkim/Horoscope/Horoscope.iml b/homework/week-1/sarahkim/Horoscope/Horoscope.iml new file mode 100644 index 00000000..0bb6048a --- /dev/null +++ b/homework/week-1/sarahkim/Horoscope/Horoscope.iml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + diff --git a/homework/week-1/sarahkim/Horoscope/app/.gitignore b/homework/week-1/sarahkim/Horoscope/app/.gitignore new file mode 100644 index 00000000..796b96d1 --- /dev/null +++ b/homework/week-1/sarahkim/Horoscope/app/.gitignore @@ -0,0 +1 @@ +/build diff --git a/homework/week-1/sarahkim/Horoscope/app/app.iml b/homework/week-1/sarahkim/Horoscope/app/app.iml new file mode 100644 index 00000000..b2b8360b --- /dev/null +++ b/homework/week-1/sarahkim/Horoscope/app/app.iml @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/homework/week-1/sarahkim/Horoscope/app/build.gradle b/homework/week-1/sarahkim/Horoscope/app/build.gradle new file mode 100644 index 00000000..423a8175 --- /dev/null +++ b/homework/week-1/sarahkim/Horoscope/app/build.gradle @@ -0,0 +1,25 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion 22 + buildToolsVersion "22.0.1" + + defaultConfig { + applicationId "nyc.c4q.hyunj0.horoscope" + minSdkVersion 15 + targetSdkVersion 22 + versionCode 1 + versionName "1.0" + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } +} + +dependencies { + compile fileTree(dir: 'libs', include: ['*.jar']) + compile 'com.android.support:appcompat-v7:22.1.1' +} diff --git a/homework/week-1/sarahkim/Horoscope/app/proguard-rules.pro b/homework/week-1/sarahkim/Horoscope/app/proguard-rules.pro new file mode 100644 index 00000000..bbb5c5c6 --- /dev/null +++ b/homework/week-1/sarahkim/Horoscope/app/proguard-rules.pro @@ -0,0 +1,17 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in /Users/c4q-sarahkim/Library/Android/sdk/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the proguardFiles +# directive in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} diff --git a/homework/week-1/sarahkim/Horoscope/app/src/androidTest/java/nyc/c4q/hyunj0/horoscope/ApplicationTest.java b/homework/week-1/sarahkim/Horoscope/app/src/androidTest/java/nyc/c4q/hyunj0/horoscope/ApplicationTest.java new file mode 100644 index 00000000..da1e7edb --- /dev/null +++ b/homework/week-1/sarahkim/Horoscope/app/src/androidTest/java/nyc/c4q/hyunj0/horoscope/ApplicationTest.java @@ -0,0 +1,13 @@ +package nyc.c4q.hyunj0.horoscope; + +import android.app.Application; +import android.test.ApplicationTestCase; + +/** + * Testing Fundamentals + */ +public class ApplicationTest extends ApplicationTestCase { + public ApplicationTest() { + super(Application.class); + } +} \ No newline at end of file diff --git a/homework/week-1/sarahkim/Horoscope/app/src/main/AndroidManifest.xml b/homework/week-1/sarahkim/Horoscope/app/src/main/AndroidManifest.xml new file mode 100644 index 00000000..2d81ac11 --- /dev/null +++ b/homework/week-1/sarahkim/Horoscope/app/src/main/AndroidManifest.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + diff --git a/homework/week-1/sarahkim/Horoscope/app/src/main/java/nyc/c4q/hyunj0/horoscope/HoroscopeCheck.java b/homework/week-1/sarahkim/Horoscope/app/src/main/java/nyc/c4q/hyunj0/horoscope/HoroscopeCheck.java new file mode 100644 index 00000000..2bed05b6 --- /dev/null +++ b/homework/week-1/sarahkim/Horoscope/app/src/main/java/nyc/c4q/hyunj0/horoscope/HoroscopeCheck.java @@ -0,0 +1,16 @@ +package nyc.c4q.hyunj0.horoscope; + +import android.app.Fragment; +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +public class HoroscopeCheck extends Fragment { + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { +// return super.onCreateView(inflater, container, savedInstanceState); + return inflater.inflate(R.layout.horoscope_check_layout, container, false); + } +} diff --git a/homework/week-1/sarahkim/Horoscope/app/src/main/java/nyc/c4q/hyunj0/horoscope/HoroscopeGame.java b/homework/week-1/sarahkim/Horoscope/app/src/main/java/nyc/c4q/hyunj0/horoscope/HoroscopeGame.java new file mode 100644 index 00000000..f2454577 --- /dev/null +++ b/homework/week-1/sarahkim/Horoscope/app/src/main/java/nyc/c4q/hyunj0/horoscope/HoroscopeGame.java @@ -0,0 +1,80 @@ +package nyc.c4q.hyunj0.horoscope; + +import android.app.Activity; +import android.os.Bundle; +import android.view.View; +import android.widget.ImageButton; +import android.widget.TextView; +import android.widget.Toast; + +import java.util.Random; + +public class HoroscopeGame extends Activity { + + TextView title, sign; + ImageButton fire, water, earth, air; + public String[] horoscopes = {"aries", "taurus", "gemini", "cancer", "leo", "virgo", "libra", "scorpio", "sagittarius", "capricorn", "aquarius", "pisces"}; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_horoscope_game); + title = (TextView) findViewById(R.id.title); + sign = (TextView) findViewById(R.id.sign); + sign.setText(getHoroscope()); + fire = (ImageButton) findViewById(R.id.fire); + water = (ImageButton) findViewById(R.id.water); + earth = (ImageButton) findViewById(R.id.earth); + air = (ImageButton) findViewById(R.id.air); + View.OnClickListener listener = new View.OnClickListener() { + @Override + public void onClick(View view) { + if (view == fire && isElement(sign).equals("fire")) + Toast.makeText(getApplicationContext(),"Correct!",Toast.LENGTH_SHORT).show(); + if (view == water && isElement(sign).equals("water")) + Toast.makeText(getApplicationContext(),"Correct!",Toast.LENGTH_SHORT).show(); + if (view == earth && isElement(sign).equals("earth")) + Toast.makeText(getApplicationContext(),"Correct!",Toast.LENGTH_SHORT).show(); + if (view == air && isElement(sign).equals("air")) + Toast.makeText(getApplicationContext(),"Correct!",Toast.LENGTH_SHORT).show(); + + } + }; + } + + public String getHoroscope() { + + String horoscope = ""; + + // Randomly select a fact + Random randomGenerator = new Random(); // Construct a new Random number generator + int randomNumber = randomGenerator.nextInt(horoscopes.length); + + horoscope = horoscopes[randomNumber]; + + return horoscope; + } + + public String isElement (TextView sign) { + String horoscopeSign = sign.getText().toString(); + if ((horoscopeSign.equalsIgnoreCase("aries") || + horoscopeSign.equalsIgnoreCase("leo") || + horoscopeSign.equalsIgnoreCase("sagittarius"))) + return "fire"; + else if ((horoscopeSign.equalsIgnoreCase("cancer") || + horoscopeSign.equalsIgnoreCase("scorpio") || + horoscopeSign.equalsIgnoreCase("pisces"))) + return "water"; + else if ((horoscopeSign.equalsIgnoreCase("taurus") || + horoscopeSign.equalsIgnoreCase("virgo") || + horoscopeSign.equalsIgnoreCase("capricorn"))) + return "earth"; + else if ((horoscopeSign.equalsIgnoreCase("gemini") || + horoscopeSign.equalsIgnoreCase("libra") || + horoscopeSign.equalsIgnoreCase("aquarius"))) + return "air"; + else + return "Did you make a typo?"; + } + +} diff --git a/homework/week-1/sarahkim/Horoscope/app/src/main/java/nyc/c4q/hyunj0/horoscope/MainActivity.java b/homework/week-1/sarahkim/Horoscope/app/src/main/java/nyc/c4q/hyunj0/horoscope/MainActivity.java new file mode 100644 index 00000000..59946968 --- /dev/null +++ b/homework/week-1/sarahkim/Horoscope/app/src/main/java/nyc/c4q/hyunj0/horoscope/MainActivity.java @@ -0,0 +1,112 @@ +package nyc.c4q.hyunj0.horoscope; + +import android.app.FragmentManager; +import android.app.FragmentTransaction; +import android.content.Intent; +import android.content.res.Configuration; +import android.support.v4.app.ActionBarDrawerToggle; +import android.support.v4.widget.DrawerLayout; +import android.support.v7.app.ActionBarActivity; +import android.os.Bundle; +import android.view.MenuItem; +import android.view.View; +import android.widget.AdapterView; +import android.widget.ArrayAdapter; +import android.widget.Button; +import android.widget.ListView; +import android.widget.Toast; + + +public class MainActivity extends ActionBarActivity implements AdapterView.OnItemClickListener{ + + private DrawerLayout drawerLayout; + private ListView listView; + private String[] navigationMenu; + private ActionBarDrawerToggle drawerListener; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); +// drawerLayout = (DrawerLayout) findViewById(R.id.drawerLayout); +// navigationMenu = getResources().getStringArray(R.array.navigation_menu); +// listView = (ListView) findViewById(R.id.drawerList); +// listView.setAdapter(new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, navigationMenu)); +// listView.setOnItemClickListener(this); +// drawerListener = new ActionBarDrawerToggle(this, drawerLayout, R.drawable.ic_drawer, R.string.drawer_open, R.string.drawer_close){ +// @Override +// public void onDrawerClosed(View drawerView) { +// super.onDrawerClosed(drawerView); +// Toast.makeText(MainActivity.this, "Drawer Closed", Toast.LENGTH_SHORT).show(); +// } +// +// @Override +// public void onDrawerOpened(View drawerView) { +// super.onDrawerOpened(drawerView); +// Toast.makeText(MainActivity.this, "Drawer Opened", Toast.LENGTH_SHORT).show(); +// } +// }; +// drawerLayout.setDrawerListener(drawerListener); +// getSupportActionBar().setHomeButtonEnabled(true); +// getSupportActionBar().setDisplayHomeAsUpEnabled(true); + Button button = (Button) findViewById(R.id.button); + button.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + Intent intent = new Intent(MainActivity.this, HoroscopeGame.class); + startActivity(intent); + } + }); + +// HoroscopeCheck frag = new HoroscopeCheck(); +// FragmentManager manager = getFragmentManager(); +// FragmentTransaction transaction = manager.beginTransaction(); +// transaction.add(R.id.drawerLayout, frag, "horoscopeFrag"); +// transaction.commit(); + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + if(drawerListener.onOptionsItemSelected(item)) + return true; + return super.onOptionsItemSelected(item); + } + + @Override + public void onConfigurationChanged(Configuration newConfig) { + super.onConfigurationChanged(newConfig); + drawerListener.onConfigurationChanged(newConfig); + } + + @Override + public void onPostCreate(Bundle savedInstanceState) { + super.onPostCreate(savedInstanceState); + drawerListener.syncState(); + } + + @Override + public void onItemClick(AdapterView adapterView, View view, int position, long l) { + Toast.makeText(this, navigationMenu[position] + " was selected ", Toast.LENGTH_LONG).show(); + selectItem(position); + } + + Intent intent; + + public void selectItem(int position) { + listView.setItemChecked(position, true); + setTitle(navigationMenu[position]); + + switch(position) { + case 0: { + intent = new Intent(this, HoroscopeGame.class); + startActivity(intent); + break; + } + } + } + + public void setTitle(String title) { + getSupportActionBar().setTitle(title); + } + +} diff --git a/homework/week-1/sarahkim/Horoscope/app/src/main/java/nyc/c4q/hyunj0/horoscope/dummy/DummyContent.java b/homework/week-1/sarahkim/Horoscope/app/src/main/java/nyc/c4q/hyunj0/horoscope/dummy/DummyContent.java new file mode 100644 index 00000000..cd520358 --- /dev/null +++ b/homework/week-1/sarahkim/Horoscope/app/src/main/java/nyc/c4q/hyunj0/horoscope/dummy/DummyContent.java @@ -0,0 +1,55 @@ +package nyc.c4q.hyunj0.horoscope.dummy; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Helper class for providing sample content for user interfaces created by + * Android template wizards. + *

+ * TODO: Replace all uses of this class before publishing your app. + */ +public class DummyContent { + + /** + * An array of sample (dummy) items. + */ + public static List ITEMS = new ArrayList(); + + /** + * A map of sample (dummy) items, by ID. + */ + public static Map ITEM_MAP = new HashMap(); + + static { + // Add 3 sample items. + addItem(new DummyItem("1", "Item 1")); + addItem(new DummyItem("2", "Item 2")); + addItem(new DummyItem("3", "Item 3")); + } + + private static void addItem(DummyItem item) { + ITEMS.add(item); + ITEM_MAP.put(item.id, item); + } + + /** + * A dummy item representing a piece of content. + */ + public static class DummyItem { + public String id; + public String content; + + public DummyItem(String id, String content) { + this.id = id; + this.content = content; + } + + @Override + public String toString() { + return content; + } + } +} diff --git a/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable-hdpi/drawer_shadow.9.png b/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable-hdpi/drawer_shadow.9.png new file mode 100644 index 00000000..236bff55 Binary files /dev/null and b/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable-hdpi/drawer_shadow.9.png differ diff --git a/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable-hdpi/ic_drawer.png b/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable-hdpi/ic_drawer.png new file mode 100644 index 00000000..c59f601c Binary files /dev/null and b/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable-hdpi/ic_drawer.png differ diff --git a/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable-mdpi/drawer_shadow.9.png b/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable-mdpi/drawer_shadow.9.png new file mode 100644 index 00000000..ffe3a28d Binary files /dev/null and b/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable-mdpi/drawer_shadow.9.png differ diff --git a/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable-mdpi/ic_drawer.png b/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable-mdpi/ic_drawer.png new file mode 100644 index 00000000..1ed2c56e Binary files /dev/null and b/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable-mdpi/ic_drawer.png differ diff --git a/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable-xhdpi/drawer_shadow.9.png b/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable-xhdpi/drawer_shadow.9.png new file mode 100644 index 00000000..fabe9d96 Binary files /dev/null and b/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable-xhdpi/drawer_shadow.9.png differ diff --git a/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable-xhdpi/ic_drawer.png b/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable-xhdpi/ic_drawer.png new file mode 100644 index 00000000..a5fa74de Binary files /dev/null and b/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable-xhdpi/ic_drawer.png differ diff --git a/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable-xxhdpi/drawer_shadow.9.png b/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable-xxhdpi/drawer_shadow.9.png new file mode 100644 index 00000000..b91e9d7f Binary files /dev/null and b/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable-xxhdpi/drawer_shadow.9.png differ diff --git a/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable-xxhdpi/ic_drawer.png b/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable-xxhdpi/ic_drawer.png new file mode 100644 index 00000000..9c4685d6 Binary files /dev/null and b/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable-xxhdpi/ic_drawer.png differ diff --git a/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable/air.png b/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable/air.png new file mode 100644 index 00000000..d51e1abf Binary files /dev/null and b/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable/air.png differ diff --git a/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable/aquarius.png b/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable/aquarius.png new file mode 100644 index 00000000..0a1222df Binary files /dev/null and b/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable/aquarius.png differ diff --git a/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable/aries.png b/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable/aries.png new file mode 100644 index 00000000..08353f87 Binary files /dev/null and b/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable/aries.png differ diff --git a/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable/cancer.png b/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable/cancer.png new file mode 100644 index 00000000..d83b5d58 Binary files /dev/null and b/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable/cancer.png differ diff --git a/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable/capricorn.png b/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable/capricorn.png new file mode 100644 index 00000000..cd06256f Binary files /dev/null and b/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable/capricorn.png differ diff --git a/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable/earth.png b/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable/earth.png new file mode 100644 index 00000000..8362210f Binary files /dev/null and b/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable/earth.png differ diff --git a/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable/fire.png b/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable/fire.png new file mode 100644 index 00000000..e4f73f8c Binary files /dev/null and b/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable/fire.png differ diff --git a/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable/gemini.png b/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable/gemini.png new file mode 100644 index 00000000..56ff9ca5 Binary files /dev/null and b/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable/gemini.png differ diff --git a/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable/leo.png b/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable/leo.png new file mode 100644 index 00000000..c15ad137 Binary files /dev/null and b/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable/leo.png differ diff --git a/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable/libra.png b/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable/libra.png new file mode 100644 index 00000000..48aa642c Binary files /dev/null and b/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable/libra.png differ diff --git a/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable/pisces.png b/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable/pisces.png new file mode 100644 index 00000000..01026591 Binary files /dev/null and b/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable/pisces.png differ diff --git a/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable/sagittarius.png b/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable/sagittarius.png new file mode 100644 index 00000000..8f089a4e Binary files /dev/null and b/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable/sagittarius.png differ diff --git a/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable/scorpio.png b/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable/scorpio.png new file mode 100644 index 00000000..3fbb92f4 Binary files /dev/null and b/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable/scorpio.png differ diff --git a/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable/taurus.png b/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable/taurus.png new file mode 100644 index 00000000..425d352c Binary files /dev/null and b/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable/taurus.png differ diff --git a/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable/virgo.png b/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable/virgo.png new file mode 100644 index 00000000..cacb2fbf Binary files /dev/null and b/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable/virgo.png differ diff --git a/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable/water.png b/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable/water.png new file mode 100644 index 00000000..457707e3 Binary files /dev/null and b/homework/week-1/sarahkim/Horoscope/app/src/main/res/drawable/water.png differ diff --git a/homework/week-1/sarahkim/Horoscope/app/src/main/res/layout/activity_horoscope_game.xml b/homework/week-1/sarahkim/Horoscope/app/src/main/res/layout/activity_horoscope_game.xml new file mode 100644 index 00000000..13876408 --- /dev/null +++ b/homework/week-1/sarahkim/Horoscope/app/src/main/res/layout/activity_horoscope_game.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/homework/week-1/sarahkim/Horoscope/app/src/main/res/layout/activity_main.xml b/homework/week-1/sarahkim/Horoscope/app/src/main/res/layout/activity_main.xml new file mode 100644 index 00000000..616f7aa5 --- /dev/null +++ b/homework/week-1/sarahkim/Horoscope/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,30 @@ + + + + +