From eeda1dbdebcdf0d75ba3f7fa7bd89abbba24535b Mon Sep 17 00:00:00 2001 From: rayacevdo45 Date: Thu, 30 Apr 2015 22:04:08 -0400 Subject: [PATCH 1/5] oop --- .../5_OOP-and-Intents/oop/src/Clarinet.java | 67 +++++++++++++++++++ .../oop/src/ClarinetPlayer.java | 44 ++++++++++++ .../5_OOP-and-Intents/oop/src/Instrument.java | 7 +- exercises/5_OOP-and-Intents/oop/src/Main.java | 8 +++ .../5_OOP-and-Intents/oop/src/Musician.java | 7 +- .../oop/src/ReedInstrument.java | 50 ++++++++++++++ .../5_OOP-and-Intents/oop/src/ReedPlayer.java | 44 ++++++++++++ 7 files changed, 223 insertions(+), 4 deletions(-) create mode 100644 exercises/5_OOP-and-Intents/oop/src/Clarinet.java create mode 100644 exercises/5_OOP-and-Intents/oop/src/ClarinetPlayer.java create mode 100644 exercises/5_OOP-and-Intents/oop/src/Main.java create mode 100644 exercises/5_OOP-and-Intents/oop/src/ReedInstrument.java create mode 100644 exercises/5_OOP-and-Intents/oop/src/ReedPlayer.java diff --git a/exercises/5_OOP-and-Intents/oop/src/Clarinet.java b/exercises/5_OOP-and-Intents/oop/src/Clarinet.java new file mode 100644 index 00000000..72e98c77 --- /dev/null +++ b/exercises/5_OOP-and-Intents/oop/src/Clarinet.java @@ -0,0 +1,67 @@ +package ac0430; +/** + * Access Code 2.1 + * Ray Acevedo + * Clarinet.java + */ +public class Clarinet extends ReedInstrument implements Instrument +{ + String name; + boolean hasReed = true; + + public Clarinet() + { + } + + public Clarinet(String name) + { + this.name = name; + } + + public Clarinet(String name, boolean hasReed) + { + this.name = name; + this.hasReed = hasReed; + } + + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + + public void setHasReed(boolean hasReed) + { + this.hasReed = hasReed; + } + + public boolean getHasReed() + { + return hasReed; + } + + @Override + public String play() + { + return null; + } + + public boolean hasReed(Clarinet Clarinet) + { + return (Clarinet.hasReed); + } + + public void placeReed(Clarinet Clarinet) + { + Clarinet.hasReed = true; + } + + public void removeReed(Clarinet Clarinet) + { + Clarinet.hasReed = false; + } +} diff --git a/exercises/5_OOP-and-Intents/oop/src/ClarinetPlayer.java b/exercises/5_OOP-and-Intents/oop/src/ClarinetPlayer.java new file mode 100644 index 00000000..1b93eb0f --- /dev/null +++ b/exercises/5_OOP-and-Intents/oop/src/ClarinetPlayer.java @@ -0,0 +1,44 @@ +package ac0430; +/** + * Access Code 2.1 + * Ray Acevedo + * ClarinetPlayer.java + */ +public class ClarinetPlayer extends ReedPlayer +{ + String name; + Clarinet myClarinet; + + public ClarinetPlayer(){} + + public ClarinetPlayer(String name, Clarinet myClarinet) + { + this.name = name; + this.myClarinet = myClarinet; + } + public void playInstrument(Clarinet myClarinet) + { + if(myClarinet.hasReed = false) + { + System.out.println(); + } + else + { + System.out.println("lalalalalalala"); + } + } + +// public void toggleReed (Clarinet myClarinet){ +// if (myClarinet.hasReed = true){ +// myClarinet.hasReed = false; +// } +// if(myClarinet.hasReed = false){ +// myClarinet.hasReed = true; +// } + // } + @Override + public String play_instrument() + { + return null; + } +} diff --git a/exercises/5_OOP-and-Intents/oop/src/Instrument.java b/exercises/5_OOP-and-Intents/oop/src/Instrument.java index e3f342e9..79c4ad6c 100644 --- a/exercises/5_OOP-and-Intents/oop/src/Instrument.java +++ b/exercises/5_OOP-and-Intents/oop/src/Instrument.java @@ -1,7 +1,10 @@ +package ac0430; /** - * Created by amyquispe on 4/30/15. + * Access Code 2.1 + * Ray Acevedo + * Instrument.java */ public interface Instrument { /* expected behavior: when play() is called, return a String that represents the Instrument's noise */ public String play(); -} +} \ No newline at end of file diff --git a/exercises/5_OOP-and-Intents/oop/src/Main.java b/exercises/5_OOP-and-Intents/oop/src/Main.java new file mode 100644 index 00000000..abe70377 --- /dev/null +++ b/exercises/5_OOP-and-Intents/oop/src/Main.java @@ -0,0 +1,8 @@ +package ac0430; + +public class Main { + + public static void main(String[] args) { + // write your code here + } +} diff --git a/exercises/5_OOP-and-Intents/oop/src/Musician.java b/exercises/5_OOP-and-Intents/oop/src/Musician.java index fe90f5ff..3feed467 100644 --- a/exercises/5_OOP-and-Intents/oop/src/Musician.java +++ b/exercises/5_OOP-and-Intents/oop/src/Musician.java @@ -1,7 +1,10 @@ +package ac0430; /** - * Created by amyquispe on 4/30/15. + * Access Code 2.1 + * Ray Acevedo + * Musician.java */ public abstract class Musician { /* expected behavior: when play_instrument() is called, return a String that represents the instrument's noise */ public abstract String play_instrument(); -} +} \ No newline at end of file diff --git a/exercises/5_OOP-and-Intents/oop/src/ReedInstrument.java b/exercises/5_OOP-and-Intents/oop/src/ReedInstrument.java new file mode 100644 index 00000000..c71dc078 --- /dev/null +++ b/exercises/5_OOP-and-Intents/oop/src/ReedInstrument.java @@ -0,0 +1,50 @@ +package ac0430; +import java.util.ArrayList; + +/** + * Access Code 2.1 + * Ray Acevedo + * ReedInstrument.java + */ +public abstract class ReedInstrument implements Instrument +{ + String name; + boolean hasReed = true; + + public ReedInstrument(){} + + public ReedInstrument(String name) + { + this.name = name; + } + public ReedInstrument(String name, boolean hasReed){ + this.name = name; + this.hasReed = hasReed; + } + public void setName (String name){ + this.name=name; + } + public String getName(){ + return name; + } + public void setHasReed (boolean hasReed){ + this.hasReed = hasReed; + } + public boolean getHasReed (){ + return hasReed; + } + @Override + public String play() + { + return null; + } + public boolean hasReed (ReedInstrument reedInstrument){ + return (reedInstrument.hasReed); + } + public void placeReed (ReedInstrument reedInstrument){ + reedInstrument.hasReed = true; + } + public void removeReed (ReedInstrument reedInstrument){ + reedInstrument.hasReed = false; + } +} \ No newline at end of file diff --git a/exercises/5_OOP-and-Intents/oop/src/ReedPlayer.java b/exercises/5_OOP-and-Intents/oop/src/ReedPlayer.java new file mode 100644 index 00000000..5a5780dd --- /dev/null +++ b/exercises/5_OOP-and-Intents/oop/src/ReedPlayer.java @@ -0,0 +1,44 @@ +package ac0430; +/** + * Access Code 2.1 + * Ray Acevedo + * ReedPlayer.java + */ +public abstract class ReedPlayer extends Musician +{ + String name; + ReedInstrument reedInstrument; + + public ReedPlayer(){} + + public ReedPlayer(String name, ReedInstrument reedInstrument) + { + this.name = name; + this.reedInstrument = reedInstrument; + } + public void playInstrument(ReedInstrument reedInstrument) + { + if(reedInstrument.hasReed = false) + { + System.out.println(); + } + else + { + System.out.println(""); + } + } + + public void toggleReed (ReedInstrument reedInstrument){ + if (reedInstrument.hasReed = true){ + reedInstrument.hasReed = false; + } + if(reedInstrument.hasReed = false){ + reedInstrument.hasReed = true; + } + } + @Override + public String play_instrument() + { + return null; + } +} From 0241c4a49a296a5978b3f3712a9edb10bf581ab8 Mon Sep 17 00:00:00 2001 From: rayacevdo45 Date: Sun, 3 May 2015 11:34:14 -0400 Subject: [PATCH 2/5] hw0 --- HW_05-01/.idea/compiler.xml | 23 + .../.idea/copyright/profiles_settings.xml | 3 + HW_05-01/.idea/description.html | 1 + HW_05-01/.idea/encodings.xml | 4 + HW_05-01/.idea/misc.xml | 12 + HW_05-01/.idea/modules.xml | 8 + HW_05-01/.idea/project-template.xml | 3 + HW_05-01/.idea/scopes/scope_settings.xml | 5 + HW_05-01/.idea/uiDesigner.xml | 124 +++ HW_05-01/.idea/vcs.xml | 6 + HW_05-01/.idea/workspace.xml | 861 ++++++++++++++++++ HW_05-01/HW_05-01.iml | 12 + .../production/HW_05-01/hw0501/Animal.class | Bin 0 -> 1818 bytes .../production/HW_05-01/hw0501/Cards.class | Bin 0 -> 961 bytes .../HW_05-01/hw0501/Character.class | Bin 0 -> 375 bytes .../production/HW_05-01/hw0501/Domestic.class | Bin 0 -> 187 bytes .../HW_05-01/hw0501/DomesticCat.class | Bin 0 -> 1473 bytes .../out/production/HW_05-01/hw0501/Game.class | Bin 0 -> 297 bytes .../out/production/HW_05-01/hw0501/Main.class | Bin 0 -> 369 bytes .../HW_05-01/hw0501/MyCharacter.class | Bin 0 -> 1331 bytes .../production/HW_05-01/hw0501/MyWeapon.class | Bin 0 -> 730 bytes .../HW_05-01/hw0501/PlayingCards.class | Bin 0 -> 2114 bytes .../out/production/HW_05-01/hw0501/Room.class | Bin 0 -> 306 bytes .../HW_05-01/hw0501/UseWeapon.class | Bin 0 -> 132 bytes .../production/HW_05-01/hw0501/Weapon.class | Bin 0 -> 142 bytes HW_05-01/src/hw0501/Animal.java | 67 ++ HW_05-01/src/hw0501/Cards.java | 37 + HW_05-01/src/hw0501/Character.java | 14 + HW_05-01/src/hw0501/Domestic.java | 13 + HW_05-01/src/hw0501/DomesticCat.java | 45 + HW_05-01/src/hw0501/Game.java | 22 + HW_05-01/src/hw0501/Main.java | 26 + HW_05-01/src/hw0501/MyCharacter.java | 24 + HW_05-01/src/hw0501/MyRoom.java | 20 + HW_05-01/src/hw0501/MyWeapon.java | 19 + HW_05-01/src/hw0501/PlayingCards.java | 45 + HW_05-01/src/hw0501/Room.java | 11 + HW_05-01/src/hw0501/UseWeapon.java | 14 + HW_05-01/src/hw0501/Weapon.java | 11 + exercises/.DS_Store | Bin 0 -> 6148 bytes exercises/.idea/.name | 1 + exercises/.idea/compiler.xml | 23 + .../.idea/copyright/profiles_settings.xml | 3 + exercises/.idea/encodings.xml | 4 + exercises/.idea/exercises.iml | 9 + exercises/.idea/misc.xml | 211 +++++ exercises/.idea/modules.xml | 8 + exercises/.idea/scopes/scope_settings.xml | 5 + exercises/.idea/vcs.xml | 6 + exercises/.idea/workspace.xml | 470 ++++++++++ .../MyPhone/app/build.gradle | 25 - .../MyPhone/app/proguard-rules.pro | 17 - .../accesscode/myphone/ApplicationTest.java | 13 - .../MyPhone/app/src/main/AndroidManifest.xml | 22 - .../accesscode/myphone/DialerActivity.java | 33 - .../accesscode/myphone/EmailActivity.java | 37 - .../accesscode/myphone/MainActivity.java | 66 -- .../src/main/res/layout/activity_dialer.xml | 25 - .../src/main/res/layout/activity_email.xml | 30 - .../app/src/main/res/layout/activity_main.xml | 27 - .../app/src/main/res/menu/menu_main.xml | 6 - .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 3418 -> 0 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 2206 -> 0 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 4842 -> 0 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 7718 -> 0 bytes .../app/src/main/res/values-w820dp/dimens.xml | 6 - .../app/src/main/res/values/dimens.xml | 5 - .../app/src/main/res/values/strings.xml | 6 - .../app/src/main/res/values/styles.xml | 8 - .../5_OOP-and-Intents/MyPhone/build.gradle | 19 - .../MyPhone/gradle/wrapper/gradle-wrapper.jar | Bin 49896 -> 0 bytes .../gradle/wrapper/gradle-wrapper.properties | 6 - exercises/5_OOP-and-Intents/MyPhone/gradlew | 164 ---- .../5_OOP-and-Intents/MyPhone/gradlew.bat | 90 -- .../5_OOP-and-Intents/MyPhone/settings.gradle | 1 - .../5_OOP-and-Intents/oop/src/Clarinet.java | 67 -- .../oop/src/ClarinetPlayer.java | 44 - .../5_OOP-and-Intents/oop/src/Instrument.java | 10 - exercises/5_OOP-and-Intents/oop/src/Main.java | 8 - .../5_OOP-and-Intents/oop/src/Musician.java | 10 - .../oop/src/ReedInstrument.java | 50 - .../5_OOP-and-Intents/oop/src/ReedPlayer.java | 44 - 82 files changed, 2170 insertions(+), 839 deletions(-) create mode 100644 HW_05-01/.idea/compiler.xml create mode 100644 HW_05-01/.idea/copyright/profiles_settings.xml create mode 100644 HW_05-01/.idea/description.html create mode 100644 HW_05-01/.idea/encodings.xml create mode 100644 HW_05-01/.idea/misc.xml create mode 100644 HW_05-01/.idea/modules.xml create mode 100644 HW_05-01/.idea/project-template.xml create mode 100644 HW_05-01/.idea/scopes/scope_settings.xml create mode 100644 HW_05-01/.idea/uiDesigner.xml create mode 100644 HW_05-01/.idea/vcs.xml create mode 100644 HW_05-01/.idea/workspace.xml create mode 100644 HW_05-01/HW_05-01.iml create mode 100644 HW_05-01/out/production/HW_05-01/hw0501/Animal.class create mode 100644 HW_05-01/out/production/HW_05-01/hw0501/Cards.class create mode 100644 HW_05-01/out/production/HW_05-01/hw0501/Character.class create mode 100644 HW_05-01/out/production/HW_05-01/hw0501/Domestic.class create mode 100644 HW_05-01/out/production/HW_05-01/hw0501/DomesticCat.class create mode 100644 HW_05-01/out/production/HW_05-01/hw0501/Game.class create mode 100644 HW_05-01/out/production/HW_05-01/hw0501/Main.class create mode 100644 HW_05-01/out/production/HW_05-01/hw0501/MyCharacter.class create mode 100644 HW_05-01/out/production/HW_05-01/hw0501/MyWeapon.class create mode 100644 HW_05-01/out/production/HW_05-01/hw0501/PlayingCards.class create mode 100644 HW_05-01/out/production/HW_05-01/hw0501/Room.class create mode 100644 HW_05-01/out/production/HW_05-01/hw0501/UseWeapon.class create mode 100644 HW_05-01/out/production/HW_05-01/hw0501/Weapon.class create mode 100644 HW_05-01/src/hw0501/Animal.java create mode 100644 HW_05-01/src/hw0501/Cards.java create mode 100644 HW_05-01/src/hw0501/Character.java create mode 100644 HW_05-01/src/hw0501/Domestic.java create mode 100644 HW_05-01/src/hw0501/DomesticCat.java create mode 100644 HW_05-01/src/hw0501/Game.java create mode 100644 HW_05-01/src/hw0501/Main.java create mode 100644 HW_05-01/src/hw0501/MyCharacter.java create mode 100644 HW_05-01/src/hw0501/MyRoom.java create mode 100644 HW_05-01/src/hw0501/MyWeapon.java create mode 100644 HW_05-01/src/hw0501/PlayingCards.java create mode 100644 HW_05-01/src/hw0501/Room.java create mode 100644 HW_05-01/src/hw0501/UseWeapon.java create mode 100644 HW_05-01/src/hw0501/Weapon.java create mode 100644 exercises/.DS_Store create mode 100644 exercises/.idea/.name create mode 100644 exercises/.idea/compiler.xml create mode 100644 exercises/.idea/copyright/profiles_settings.xml create mode 100644 exercises/.idea/encodings.xml create mode 100644 exercises/.idea/exercises.iml create mode 100644 exercises/.idea/misc.xml create mode 100644 exercises/.idea/modules.xml create mode 100644 exercises/.idea/scopes/scope_settings.xml create mode 100644 exercises/.idea/vcs.xml create mode 100644 exercises/.idea/workspace.xml delete mode 100644 exercises/5_OOP-and-Intents/MyPhone/app/build.gradle delete mode 100644 exercises/5_OOP-and-Intents/MyPhone/app/proguard-rules.pro delete mode 100644 exercises/5_OOP-and-Intents/MyPhone/app/src/androidTest/java/com/example/accesscode/myphone/ApplicationTest.java delete mode 100644 exercises/5_OOP-and-Intents/MyPhone/app/src/main/AndroidManifest.xml delete mode 100644 exercises/5_OOP-and-Intents/MyPhone/app/src/main/java/com/example/accesscode/myphone/DialerActivity.java delete mode 100644 exercises/5_OOP-and-Intents/MyPhone/app/src/main/java/com/example/accesscode/myphone/EmailActivity.java delete mode 100644 exercises/5_OOP-and-Intents/MyPhone/app/src/main/java/com/example/accesscode/myphone/MainActivity.java delete mode 100644 exercises/5_OOP-and-Intents/MyPhone/app/src/main/res/layout/activity_dialer.xml delete mode 100644 exercises/5_OOP-and-Intents/MyPhone/app/src/main/res/layout/activity_email.xml delete mode 100644 exercises/5_OOP-and-Intents/MyPhone/app/src/main/res/layout/activity_main.xml delete mode 100644 exercises/5_OOP-and-Intents/MyPhone/app/src/main/res/menu/menu_main.xml delete mode 100644 exercises/5_OOP-and-Intents/MyPhone/app/src/main/res/mipmap-hdpi/ic_launcher.png delete mode 100644 exercises/5_OOP-and-Intents/MyPhone/app/src/main/res/mipmap-mdpi/ic_launcher.png delete mode 100644 exercises/5_OOP-and-Intents/MyPhone/app/src/main/res/mipmap-xhdpi/ic_launcher.png delete mode 100644 exercises/5_OOP-and-Intents/MyPhone/app/src/main/res/mipmap-xxhdpi/ic_launcher.png delete mode 100644 exercises/5_OOP-and-Intents/MyPhone/app/src/main/res/values-w820dp/dimens.xml delete mode 100644 exercises/5_OOP-and-Intents/MyPhone/app/src/main/res/values/dimens.xml delete mode 100644 exercises/5_OOP-and-Intents/MyPhone/app/src/main/res/values/strings.xml delete mode 100644 exercises/5_OOP-and-Intents/MyPhone/app/src/main/res/values/styles.xml delete mode 100644 exercises/5_OOP-and-Intents/MyPhone/build.gradle delete mode 100644 exercises/5_OOP-and-Intents/MyPhone/gradle/wrapper/gradle-wrapper.jar delete mode 100644 exercises/5_OOP-and-Intents/MyPhone/gradle/wrapper/gradle-wrapper.properties delete mode 100755 exercises/5_OOP-and-Intents/MyPhone/gradlew delete mode 100644 exercises/5_OOP-and-Intents/MyPhone/gradlew.bat delete mode 100644 exercises/5_OOP-and-Intents/MyPhone/settings.gradle delete mode 100644 exercises/5_OOP-and-Intents/oop/src/Clarinet.java delete mode 100644 exercises/5_OOP-and-Intents/oop/src/ClarinetPlayer.java delete mode 100644 exercises/5_OOP-and-Intents/oop/src/Instrument.java delete mode 100644 exercises/5_OOP-and-Intents/oop/src/Main.java delete mode 100644 exercises/5_OOP-and-Intents/oop/src/Musician.java delete mode 100644 exercises/5_OOP-and-Intents/oop/src/ReedInstrument.java delete mode 100644 exercises/5_OOP-and-Intents/oop/src/ReedPlayer.java diff --git a/HW_05-01/.idea/compiler.xml b/HW_05-01/.idea/compiler.xml new file mode 100644 index 00000000..a8523149 --- /dev/null +++ b/HW_05-01/.idea/compiler.xml @@ -0,0 +1,23 @@ + + + + + \ No newline at end of file diff --git a/HW_05-01/.idea/copyright/profiles_settings.xml b/HW_05-01/.idea/copyright/profiles_settings.xml new file mode 100644 index 00000000..e7bedf33 --- /dev/null +++ b/HW_05-01/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/HW_05-01/.idea/description.html b/HW_05-01/.idea/description.html new file mode 100644 index 00000000..db5f1295 --- /dev/null +++ b/HW_05-01/.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/HW_05-01/.idea/encodings.xml b/HW_05-01/.idea/encodings.xml new file mode 100644 index 00000000..d8210482 --- /dev/null +++ b/HW_05-01/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/HW_05-01/.idea/misc.xml b/HW_05-01/.idea/misc.xml new file mode 100644 index 00000000..ccf24ce4 --- /dev/null +++ b/HW_05-01/.idea/misc.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/HW_05-01/.idea/modules.xml b/HW_05-01/.idea/modules.xml new file mode 100644 index 00000000..d2dde6bf --- /dev/null +++ b/HW_05-01/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/HW_05-01/.idea/project-template.xml b/HW_05-01/.idea/project-template.xml new file mode 100644 index 00000000..1f08b887 --- /dev/null +++ b/HW_05-01/.idea/project-template.xml @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/HW_05-01/.idea/scopes/scope_settings.xml b/HW_05-01/.idea/scopes/scope_settings.xml new file mode 100644 index 00000000..922003b8 --- /dev/null +++ b/HW_05-01/.idea/scopes/scope_settings.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/HW_05-01/.idea/uiDesigner.xml b/HW_05-01/.idea/uiDesigner.xml new file mode 100644 index 00000000..e96534fb --- /dev/null +++ b/HW_05-01/.idea/uiDesigner.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/HW_05-01/.idea/vcs.xml b/HW_05-01/.idea/vcs.xml new file mode 100644 index 00000000..6564d52d --- /dev/null +++ b/HW_05-01/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/HW_05-01/.idea/workspace.xml b/HW_05-01/.idea/workspace.xml new file mode 100644 index 00000000..24be92bd --- /dev/null +++ b/HW_05-01/.idea/workspace.xml @@ -0,0 +1,861 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1430083781755 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/HW_05-01/HW_05-01.iml b/HW_05-01/HW_05-01.iml new file mode 100644 index 00000000..d5c07432 --- /dev/null +++ b/HW_05-01/HW_05-01.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/HW_05-01/out/production/HW_05-01/hw0501/Animal.class b/HW_05-01/out/production/HW_05-01/hw0501/Animal.class new file mode 100644 index 0000000000000000000000000000000000000000..29b274d8dd6570af0f0d6d4bb4ba9590c50a0c00 GIT binary patch literal 1818 zcmZ`)TXWlF5IvG5%W_q6ZOWxk(yMHTI4uNd;<$0r3!zRLa0sM*`s`|472igY0skR* z;Q<&(7&Vu4BXAaL@9%tChpG>9^~Sw;SX?sT$(vyE=MCp>3k5EjhaiBl48 z?vVmT@KVtw?!}FX+~IkU8<18$!$>u5in=}ZQ*tl%-N4ma|-kkUXvZqyyh{B zMd!(YO4hsNV1$rNo_w63s=ySUCk9pb(5F`6NqygK6)PuUYN(4|PbxoG9aDbLJ5fK9 zZM?8_ns+%lkcahWPQzc7jjKN_jW0&@j1+5bvm^YzM+&!Mpix3BvKb6Yu0<))s607a z>-N2dbI+B%oC!B%Q7)o|bC|O*gINpj;i7?u7OrBK(;M3+%37hUGW!Cx-H_VO1dBZ0 zxPdP$e2JQc_c3o^&%#&Omx$M-^)<&Z+WxQy1+$~jsEM)6@ICpTg{FQn(Awb8ciN=b z?T@DFc8j}w(|qDMqD?tM>f>Q9OHU@XxOtlWDA+T5E4Pn%zRFYJfcVp-Qv7$w(57&_ zo~KvjUEy8NA4B<-hKe_NO$Whic#F0bCg5$nLr)f8;8hlvnXU4kmBsnOA5fDB*8_yP zFe^e}en3SY{O%BIg`UJp=YNM453a&6)hdQw?TjT;o=<5->C0mr} zN6;j2oZ)f|*cvu!;d%gU!bUDad&!BWS$+38^n>a2F^p0dW)DE<)E5UvBKcB}^+W-In literal 0 HcmV?d00001 diff --git a/HW_05-01/out/production/HW_05-01/hw0501/Cards.class b/HW_05-01/out/production/HW_05-01/hw0501/Cards.class new file mode 100644 index 0000000000000000000000000000000000000000..e00e2576f0ae791c3a5ca9aa49c58043fb77cd0f GIT binary patch literal 961 zcmZuv-%Hz27(F*lTaBr8RXaDGwoak8usViM8@>nwp==Kw!r0So4fRS*Ax+&swTBIq z!5;Pp?2j5d-%VzM?L)r%Bi}jaJ16<`_t$R#Z*b_Lh{iHpG^Om9@v@8qh2nH(;y|I+ zyVke5JJ#W-+m9m?j@~MGLmgdynB5G5NI{(|l-`-p#HR{{*3pH6dp5Zww%RjckhFc$ zgRy0s4E6XzM@G)+r5j(FslsaS>g(~z@$2px$){AQx8}9ag??!o#QkKv%>_NSW%SUp z(K?#vQK*nal>XarTb8>*VE&qh=+C{;CX|W3%u`vzIvUZ!`hwR?t3R1V!{EJ<1U&2R zm4xcU!-|g*%08B`tl;MZP*}^7|2Vh~hB2D_LPdTyhYw+_5F~3Eq{a%X&r_GH;#zF~ zg!;jag9>ZOUe>Y7y`MCoiZz}D{Df7&pV?jDS`~1+a}TGzbB{tsQ{xoC7V9%=KPTO` zrEDayl#&E?Mwz2(r*tS#!+I)nN*U|JN@VPwz1^kHJbB11jv`g>Brm^n3pR|Bs2L literal 0 HcmV?d00001 diff --git a/HW_05-01/out/production/HW_05-01/hw0501/Character.class b/HW_05-01/out/production/HW_05-01/hw0501/Character.class new file mode 100644 index 0000000000000000000000000000000000000000..717de720b02350446a1cfc8a75b312bd048bb186 GIT binary patch literal 375 zcmZ8c%TB{E5S&fZ1VU-b`^*hEkXDEjh)X3TqzDd0F)yUK7e(W@wWVmL z!YG%o#L(92*M);%Yl*_oTmxXEh9Ow8SrH_$5w0s4%Q7h|LxyHYN|09(xLgE7F) EHw3|ztarA5i9ZkahiQ+QqSb5n~;GL!W{hA}emXOtV58W`%sgc%tG s5VrUyWu+#UurV?)GB5$1#lXPC!pOkPz{0=)q*)o*fFeNqLE;P?0L&LG6951J literal 0 HcmV?d00001 diff --git a/HW_05-01/out/production/HW_05-01/hw0501/DomesticCat.class b/HW_05-01/out/production/HW_05-01/hw0501/DomesticCat.class new file mode 100644 index 0000000000000000000000000000000000000000..1c3941a6b0da006e7a09225aebb18f6e2f0d01c6 GIT binary patch literal 1473 zcmaJ=T~8B16g|5wY`ZKJOIs2A0tHH2D5$6is0gBHMH2`K;c2Lwve*yOE-LT-9A7j7 zMx*iBA7wmuyL=R?X)-f==bm%VxpVvb&$pidZX#!*1EXOCk(Fi4z_`hMRKhn*Cfo{P zKq3<%42E$VcTC*Hq=|c&GB7PSGY0N!2$ogJ))38YskbUyROLc;*{wR|!juN1wr%Gf zyQZOa+9^9O(*w!jRf6U!uL+9eoU*;NQ`)erD{7m-eEY$myXlZ4mfL(c zHZeAyov)Pan(O4}l*=OViqtRazHZ_XW5)dID5HMwRp^2+7-yc8RU5 z?68&bI8FmAO>4oKquapy2@z8(b&y5RyiYE>B-0 zHEnH6p&|#NVHyuhhGBj zV>MCQ0f9jp2-8Lf!J_PH9d<+>@ySKGnAKT;li`=i@mti!z9YDHfRIPy*HDb8Jx*B!#q2FizKxLvZBh1mz0m3=&Wb*W)}+--Z}i5@3F*@KCu<7BvxCW0t@X2(jkl$|bWXo2 zyY;Nf?(4=C=Gq4PG^`#6VIKk!q4&>{FlsGIT`lEZzBYvyhv@JbAv)l1BjOx$C%F>W h=;$5v){Ya-aSQjc!|(pD04Xv+2=thM*`QVL{s6QfIxYYJ literal 0 HcmV?d00001 diff --git a/HW_05-01/out/production/HW_05-01/hw0501/Main.class b/HW_05-01/out/production/HW_05-01/hw0501/Main.class new file mode 100644 index 0000000000000000000000000000000000000000..c5fecc44138360c0e355f586f0010caa3395b637 GIT binary patch literal 369 zcmZutJx{|h5Pg^CgQSI)7QxI`Kq5s|ry>?4rT{}x7bYiIsjJkHObWk?35kIpz>h+l z4HA{WlJEK6-Fs*I+P|Z1FsrjLy<)q4bnZR*Z!G;eECgPa>^^F4I|KlrE=k zh%hC~2LF@^$*f+RLS895HMWkY)}#X;0inGyiO~DCzs;AjXmALRUuTyGz6b)2A!jKg wF$Tx4pchw;IEIdlu*K)jcLQQ1oW*E6#)?mPTk#*^!G@5(0Xwd-%h5yc3zc6%p#T5? literal 0 HcmV?d00001 diff --git a/HW_05-01/out/production/HW_05-01/hw0501/MyCharacter.class b/HW_05-01/out/production/HW_05-01/hw0501/MyCharacter.class new file mode 100644 index 0000000000000000000000000000000000000000..995a140350be03c9b87a434511240712f04be343 GIT binary patch literal 1331 zcma))O>fgc5Qg7P9Gkdqo2E$$l&?}KP6|yCaDbp*Dj_1Jy%e?QZED3vse@dXivPp` zBq}5h`~ZFwVrIShknKoZX1%jB?>zgi|NQ;+8^8Z3|B=JQFbA z24N8I2^8Jtv4F8ZI`agUdqLdWD=i~`>4q!IhUg+Q(6U+uoy zecnF!vhT}C_G2&V2-Mx)NBLQ{hcX?(L@Zd3c!=#sw>+ zktSe)_Zq@*6)(4pQ)D%fB~uc(L@@cbk4BeK-+LFZ?Uflzci1lnH&Av^!HR=b)Ev~& zaIl63p=Mu!1axxpFxa5yx9INx79d!SqD{Ltt%BB4>nFr_`Y2EVsF;&wI24_v0E<|n z9XBsiKq8ZB)fJO_i`YLX^7Qai2HbufmpwWk%p+vfna|bVgnCzAdIgmC+fKn boBs*Xm;=F2%Mg!pAxde8wOokD3U%ur#oDXx literal 0 HcmV?d00001 diff --git a/HW_05-01/out/production/HW_05-01/hw0501/MyWeapon.class b/HW_05-01/out/production/HW_05-01/hw0501/MyWeapon.class new file mode 100644 index 0000000000000000000000000000000000000000..119d7c90cfd7db6fad9c38aefb992a6c6c52823d GIT binary patch literal 730 zcmZuuT~FIU5S(*9OiWTpfRvWDK+8wM0|p_UijZ2QN=Tut6cnB>=@kw+HZl%~p9K#f z@xTw@MK=(m$thlgJU-0mObIu{L$q%qK^hI@Q+E`P$~%y1#dEpyWvua!S4N|Lk2e!TYOYmBMJS@kGst z22nh>BF06g`>g76@EdF6xO4@lmb*s&#gS)!R7tN{;d%;u7A~QV Mx0Df>rhtQYkFVB;w*UYD literal 0 HcmV?d00001 diff --git a/HW_05-01/out/production/HW_05-01/hw0501/PlayingCards.class b/HW_05-01/out/production/HW_05-01/hw0501/PlayingCards.class new file mode 100644 index 0000000000000000000000000000000000000000..1b96124a3e30c629bb968b13faaa6db52bac4d97 GIT binary patch literal 2114 zcmaJ?-%}e^6#h0W*(59hQo@hg0LppjLXr)eOa5Hk6FRWbe7>-t(PvzH`py_kVx>1;7lxh~O+1 zHQbIMfW4VwyrIbr9kmlVV^+v2fE)f}^!x?$U5FJo4n zc?IFDSttvqW*Z7dTir=#ww_F1nZB4>kVx~_X%kGFWz)H?pe-@Bu0UO|^0e;Cm}O(N zR@yY|dt$RlO)O*OL~&i%rri5VRYs&BdK^}PV)D17puJi%9oN_mxG2hnRMxT0a)F)$ z<^=`4O<^uMhAkY+=9%hjnN^vnAMaXG?9s{#+sEa3-|?XKDviL#nqZ$Zl=hU(QAh?l zvyRB^tcZ%66uD=GHRM=2GFmX4ifQBwI_pogL?uF`NdDLSYXgZ^zUL*mVIhkpFDpp2 zymq2MZcR$UEHl}}!;=ZP=fW;9zEdrZ6@+q@RlF@qtU@Gf)$E+HXv%u_G*dby%cJ8w zUL{P6-qJCIVbZ=(tZi0x_xhb{^Kl&Jli_%m&k3HyPMla&Y2&3z&zR0ZllVYH1|XUfGweI ziR!BHl!fM8(MB!1o8HF#W=silva(CEw9TyTRUM;5JgY`j{|PXy)EdXh;ZPZ(M86?6 zY}OmP||7R3(EYEYJv5rSf zqAD`}BK!Lo-F~=Z>o~{v?=0V6g+F#7*AYqq>Q%~YS$;3@IL&>KC$;1Ol;j}-8wY6n z0je)$#$)Yu1n-Z>G;axcOW0lNh^$QfgboE?VU~if;8%36sCgbV> zy5`!G-$NaA!M;?L{i8qkkAC}>j#Z5EJID7N(7EeC7dp|;{Sc*5bYp@q{0w4PMlb&v z^g-}+hw?5{bZ{E4(egTz5QyM)B+!mkrZIyH-LW-*Kk$&3+JB^N|6KNF-b_i-ZXL({f0uo z%`E6DhukQ2?}G0=EC-9XSO)Af!ZxmRNphMQ_c@)S;Bp#W`3~KO=wWeU6Lp-bqnAs( zj=nnj>loNS`r`$cG3E`Hc!0>WjNuwtksOWC!vI;890kbIWtR^b@*Lh|u0VqYPjikM z$wCJLf1{n*KVun2s0fhmFy6x3Oh*Qvp+?fm2nQMA>CAW?ul$HJG9-_LsGD38Ar_;H a<&fd@c{aF#o7{!?x4@!E4sW@3@B9bB-`D8? literal 0 HcmV?d00001 diff --git a/HW_05-01/out/production/HW_05-01/hw0501/Room.class b/HW_05-01/out/production/HW_05-01/hw0501/Room.class new file mode 100644 index 0000000000000000000000000000000000000000..1121fad7777541d7f20f3b5960a2172136ee7d82 GIT binary patch literal 306 zcmYk1K}*9x5QX2QX=Bq=YxNI!QxB#ho)j;FAOr;~y>H^uZb^1wP4#zq5 +{ + String speciesName; + public Animal(){} + public Animal(String speciesName){} + public void setSpeciesName (String speciesName){speciesName = this.speciesName;} + public String getSpeciesName(){return speciesName;} + + public static void putInAlphabetical (Animal a, Animal b) + { + ArrayListanimals = new ArrayList(); + animals.add(a); + animals.add(b); + Collections.sort(animals); + for(Animal animal:animals){ + System.out.println(animal); + } + } + @Override + public int compareTo(Animal animal) + { + return speciesName.compareTo(animal.getSpeciesName()); + + } + public static void main(String[] args) + { + Animal andy = new Animal("Andy"); + Animal bob = new Animal("Bob"); + Animal[] animals = {andy,bob}; + ArrayListarrayList = new ArrayList(); + System.out.println(bob.compareTo(andy)); + } +} \ No newline at end of file diff --git a/HW_05-01/src/hw0501/Cards.java b/HW_05-01/src/hw0501/Cards.java new file mode 100644 index 00000000..6841ab03 --- /dev/null +++ b/HW_05-01/src/hw0501/Cards.java @@ -0,0 +1,37 @@ +package hw0501; + +/** + * Access Code 2.1 + * Ray Acevedo + * PlayingCards.java + */ +//Create a class, Card, representing a playing card. +//In your constructor for PlayingCards,genereate a 52-deck hand of Cards. +//(Do not write 52 lines of code to do this). Decide an appropriate collection to store these in. +//Implement getpieces() which should return your collection of Cards. What should be the type +//signature for getpieces() in the abstract class? + +public class Cards +{ + String suite; + int cardNumber; + + public Cards(){} + public Cards(String suite, int cardNumber) + { + this.suite = suite; + this.cardNumber = cardNumber; + } + public void setSuite(String suite) + { + this.suite = suite; + } + public String getSuite() {return suite;} + public void setCardNumber(int cardNumber) {} + public int getCardNumber() + { + return cardNumber; + } + + public static void main(String[] args){} +} \ No newline at end of file diff --git a/HW_05-01/src/hw0501/Character.java b/HW_05-01/src/hw0501/Character.java new file mode 100644 index 00000000..70e788bd --- /dev/null +++ b/HW_05-01/src/hw0501/Character.java @@ -0,0 +1,14 @@ +package hw0501; +/** + * Access Code 2.1 + * Ray Acevedo + * Character.java + */ +public abstract class Character +{ + String name; + Weapon weapon; + int height; + int weight; +} + diff --git a/HW_05-01/src/hw0501/Domestic.java b/HW_05-01/src/hw0501/Domestic.java new file mode 100644 index 00000000..1c6a545c --- /dev/null +++ b/HW_05-01/src/hw0501/Domestic.java @@ -0,0 +1,13 @@ +package hw0501; +/** + * Access Code 2.1 + * Ray Acevedo + * Domestic.java + */ +public interface Domestic +{ + //Create the Domestic interface. This interface should include getters and setters for a name + // field, since pets tend to have their own names. + public void setName (String Name); + public String getName(); +} diff --git a/HW_05-01/src/hw0501/DomesticCat.java b/HW_05-01/src/hw0501/DomesticCat.java new file mode 100644 index 00000000..8571bd0f --- /dev/null +++ b/HW_05-01/src/hw0501/DomesticCat.java @@ -0,0 +1,45 @@ +package hw0501; +import java.util.ArrayList; +import java.util.Arrays; + +/** + * Access Code 2.1 + * Ray Acevedo + * DomesticCat.java + */ +public class DomesticCat extends Animal implements Domestic +{ + private String name; + private String species; + + public DomesticCat (){} + public DomesticCat (String name){} + public DomesticCat (String name, String species){ + this.name=name; + this.species=species; + } + @Override + public int compareTo(Animal animal) + { + animal = new DomesticCat(); + DomesticCat domesticCat = (DomesticCat) animal; + return name.compareTo(domesticCat.getName()); + } + public static void main(String[] args) + { + DomesticCat cat = new DomesticCat("cat"); + DomesticCat kat = new DomesticCat("kat"); + DomesticCat[] cats={cat,kat}; + System.out.println(Arrays.asList(cats)); + } + @Override + public void setName(String Name) + { + this.name=name; + } + @Override + public String getName() + { + return name; + } +} diff --git a/HW_05-01/src/hw0501/Game.java b/HW_05-01/src/hw0501/Game.java new file mode 100644 index 00000000..1f7d21b8 --- /dev/null +++ b/HW_05-01/src/hw0501/Game.java @@ -0,0 +1,22 @@ +package hw0501; +import java.util.ArrayList; + + +/** + * Access Code 2.1 + * Ray Acevedo + * Game.java + */ + +//Create an abstract class representing a game, which includes the method getpieces(). +//Create a class that extends your Game class, PlayingCards. +//Create a class, Card, representing a playing card. +//In your constructor for PlayingCards,genereate a 52-deck hand of Cards. +//(Do not write 52 lines of code to do this). Decide an appropriate collection to store these in. +//Implement getpieces() which should return your collection of Cards. What should be the type +//signature for getpieces() in the abstract class? + +public abstract class Game +{ + protected abstract ArrayList getpieces(); +} diff --git a/HW_05-01/src/hw0501/Main.java b/HW_05-01/src/hw0501/Main.java new file mode 100644 index 00000000..54c5b295 --- /dev/null +++ b/HW_05-01/src/hw0501/Main.java @@ -0,0 +1,26 @@ +package hw0501; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public class Main { + + public static void main(String[] args) { +// String[]random = {"a", "bb", "b", "ccc"}; +// ArrayList arrayList2 = new ArrayList(Arrays.asList(random)); +// System.out.println(arrayList2); +// System.out.println(wordsWithoutList(random, 1)); +// } +// public static List wordsWithoutList(String[] words, int len) { +// ArrayList arrayList = new ArrayList(Arrays.asList(words)); +// for (String string : words){ +// if (string.length()==len){ +// arrayList.remove(string); +// } +// } +// return arrayList; + } +} + + diff --git a/HW_05-01/src/hw0501/MyCharacter.java b/HW_05-01/src/hw0501/MyCharacter.java new file mode 100644 index 00000000..eceef881 --- /dev/null +++ b/HW_05-01/src/hw0501/MyCharacter.java @@ -0,0 +1,24 @@ +package hw0501; +/** + * Access Code 2.1 + * Ray Acevedo + * MyCharacter.java + */ +public class MyCharacter extends Character +{ + public MyCharacter (){} + public MyCharacter (String name){} + public MyCharacter (String name, Weapon weapon, int height, int weight){} + public void setName (String name){ + this.name=name; + } + public String getName(){ + return name; + } + public void setWeapon (Weapon weapon){this.weapon=weapon;} + public Weapon getWeapon(){return weapon;} + public void setHeight(int height){this.height=height;} + public int getHeight(){return height;} + public void setWeight(int weight){this.height=weight;} + public int getWeight(){return weight;} +} diff --git a/HW_05-01/src/hw0501/MyRoom.java b/HW_05-01/src/hw0501/MyRoom.java new file mode 100644 index 00000000..aa830c79 --- /dev/null +++ b/HW_05-01/src/hw0501/MyRoom.java @@ -0,0 +1,20 @@ +package hw0501; +/** + * Access Code 2.1 + * Ray Acevedo + * MyRoom.java + */ +public class MyRoom extends Room +{ + public MyRoom (){} + public MyRoom (String name){} + public MyRoom (String name,int area){} + public void setName (String name){ + this.name=name; + } + public String getName(){ + return name; + } + public void setArea (int area){this.area=area;} + public int getArea(){return area;} +} diff --git a/HW_05-01/src/hw0501/MyWeapon.java b/HW_05-01/src/hw0501/MyWeapon.java new file mode 100644 index 00000000..c9fc9632 --- /dev/null +++ b/HW_05-01/src/hw0501/MyWeapon.java @@ -0,0 +1,19 @@ +package hw0501; +/** + * Access Code 2.1 + * Ray Acevedo + * MyWeapon.java + */ +public class MyWeapon implements Weapon +{ + String name; + int bullets; + + public MyWeapon (){} + public MyWeapon (String name, int bullets){} + @Override + public void fireWeapon(Weapon weapon) + { + System.out.println("Bang!"); + } +} diff --git a/HW_05-01/src/hw0501/PlayingCards.java b/HW_05-01/src/hw0501/PlayingCards.java new file mode 100644 index 00000000..159d3394 --- /dev/null +++ b/HW_05-01/src/hw0501/PlayingCards.java @@ -0,0 +1,45 @@ +package hw0501; +import java.util.ArrayList; + +/** + * Access Code 2.1 + * Ray Acevedo + * PlayingCards.java + */ +public class PlayingCards extends Game +{ + ArrayList cards2 = new ArrayList(); + public PlayingCards (){ + ArrayList suits = new ArrayList(); + suits.add("Clubs"); + suits.add("Hearts"); + suits.add("Spades"); + suits.add("Diamonds"); + for (String suite : suits) + { + for(int i = 1; i < 14; i++) + { + Cards card = new Cards(suite, i); + this.cards2.add(card); + } + } + } + @Override + public ArrayList getpieces() + { + return cards2; + } + public static void listPieces(ArrayList arraylist) + { + for(Cards card : arraylist) + { + System.out.println(card.getSuite() + card.getCardNumber()); + } + + } + public static void main(String[] args) + { + PlayingCards coolGame = new PlayingCards(); + listPieces(coolGame.getpieces()); + } +} diff --git a/HW_05-01/src/hw0501/Room.java b/HW_05-01/src/hw0501/Room.java new file mode 100644 index 00000000..c00c1e42 --- /dev/null +++ b/HW_05-01/src/hw0501/Room.java @@ -0,0 +1,11 @@ +package hw0501; +/** + * Access Code 2.1 + * Ray Acevedo + * Room.java + */ +public class Room +{ + String name; + int area; +} diff --git a/HW_05-01/src/hw0501/UseWeapon.java b/HW_05-01/src/hw0501/UseWeapon.java new file mode 100644 index 00000000..d3bcd769 --- /dev/null +++ b/HW_05-01/src/hw0501/UseWeapon.java @@ -0,0 +1,14 @@ +package hw0501; +/** + * Access Code 2.1 + * Ray Acevedo + * UseWeapon.java + */ +public class UseWeapon implements Weapon +{ + @Override + public void fireWeapon(Weapon weapon) + { + System.out.println("Bang!"); + } +} diff --git a/HW_05-01/src/hw0501/Weapon.java b/HW_05-01/src/hw0501/Weapon.java new file mode 100644 index 00000000..f66d5c0d --- /dev/null +++ b/HW_05-01/src/hw0501/Weapon.java @@ -0,0 +1,11 @@ +package hw0501; +/** + * Access Code 2.1 + * Ray Acevedo + * Weapon.java + */ +public interface Weapon +{ + public void fireWeapon (Weapon weapon); + +} diff --git a/exercises/.DS_Store b/exercises/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 GIT binary patch literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0 + + + + \ No newline at end of file diff --git a/exercises/.idea/copyright/profiles_settings.xml b/exercises/.idea/copyright/profiles_settings.xml new file mode 100644 index 00000000..e7bedf33 --- /dev/null +++ b/exercises/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/exercises/.idea/encodings.xml b/exercises/.idea/encodings.xml new file mode 100644 index 00000000..d8210482 --- /dev/null +++ b/exercises/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/exercises/.idea/exercises.iml b/exercises/.idea/exercises.iml new file mode 100644 index 00000000..d6ebd480 --- /dev/null +++ b/exercises/.idea/exercises.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/exercises/.idea/misc.xml b/exercises/.idea/misc.xml new file mode 100644 index 00000000..7ca410e9 --- /dev/null +++ b/exercises/.idea/misc.xml @@ -0,0 +1,211 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.7 + + + + + + + + 1.7 + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/exercises/.idea/modules.xml b/exercises/.idea/modules.xml new file mode 100644 index 00000000..7d2682d1 --- /dev/null +++ b/exercises/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/exercises/.idea/scopes/scope_settings.xml b/exercises/.idea/scopes/scope_settings.xml new file mode 100644 index 00000000..922003b8 --- /dev/null +++ b/exercises/.idea/scopes/scope_settings.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/exercises/.idea/vcs.xml b/exercises/.idea/vcs.xml new file mode 100644 index 00000000..6564d52d --- /dev/null +++ b/exercises/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/exercises/.idea/workspace.xml b/exercises/.idea/workspace.xml new file mode 100644 index 00000000..2c9cfc80 --- /dev/null +++ b/exercises/.idea/workspace.xml @@ -0,0 +1,470 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1430439586493 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/exercises/5_OOP-and-Intents/MyPhone/app/build.gradle b/exercises/5_OOP-and-Intents/MyPhone/app/build.gradle deleted file mode 100644 index f2d962df..00000000 --- a/exercises/5_OOP-and-Intents/MyPhone/app/build.gradle +++ /dev/null @@ -1,25 +0,0 @@ -apply plugin: 'com.android.application' - -android { - compileSdkVersion 21 - buildToolsVersion "21.1.2" - - defaultConfig { - applicationId "com.example.accesscode.myphone" - minSdkVersion 15 - targetSdkVersion 21 - 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.0.0' -} diff --git a/exercises/5_OOP-and-Intents/MyPhone/app/proguard-rules.pro b/exercises/5_OOP-and-Intents/MyPhone/app/proguard-rules.pro deleted file mode 100644 index 1109d47e..00000000 --- a/exercises/5_OOP-and-Intents/MyPhone/app/proguard-rules.pro +++ /dev/null @@ -1,17 +0,0 @@ -# Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in /Users/amyquispe/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/exercises/5_OOP-and-Intents/MyPhone/app/src/androidTest/java/com/example/accesscode/myphone/ApplicationTest.java b/exercises/5_OOP-and-Intents/MyPhone/app/src/androidTest/java/com/example/accesscode/myphone/ApplicationTest.java deleted file mode 100644 index 1f9ab7ae..00000000 --- a/exercises/5_OOP-and-Intents/MyPhone/app/src/androidTest/java/com/example/accesscode/myphone/ApplicationTest.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.example.accesscode.myphone; - -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/exercises/5_OOP-and-Intents/MyPhone/app/src/main/AndroidManifest.xml b/exercises/5_OOP-and-Intents/MyPhone/app/src/main/AndroidManifest.xml deleted file mode 100644 index 832d95e8..00000000 --- a/exercises/5_OOP-and-Intents/MyPhone/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/exercises/5_OOP-and-Intents/MyPhone/app/src/main/java/com/example/accesscode/myphone/DialerActivity.java b/exercises/5_OOP-and-Intents/MyPhone/app/src/main/java/com/example/accesscode/myphone/DialerActivity.java deleted file mode 100644 index 09e62463..00000000 --- a/exercises/5_OOP-and-Intents/MyPhone/app/src/main/java/com/example/accesscode/myphone/DialerActivity.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.example.accesscode.myphone; - -import android.app.Activity; -import android.os.Bundle; -import android.view.View; -import android.widget.Button; -import android.widget.EditText; - -/** - * Created by amyquispe on 4/30/15. - */ -public class DialerActivity extends Activity { - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_dialer); - Button callButton = (Button) findViewById(R.id.call_button); - final EditText dialerText = (EditText) findViewById(R.id.dialer_text); - callButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - /* get text input */ - String phoneNumber = dialerText.getText().toString(); - - /* - Use an implicit intent to open the user's phone app to call this number. - http://developer.android.com/guide/components/intents-common.html#Phone - */ - } - }); - } -} diff --git a/exercises/5_OOP-and-Intents/MyPhone/app/src/main/java/com/example/accesscode/myphone/EmailActivity.java b/exercises/5_OOP-and-Intents/MyPhone/app/src/main/java/com/example/accesscode/myphone/EmailActivity.java deleted file mode 100644 index 24934ce9..00000000 --- a/exercises/5_OOP-and-Intents/MyPhone/app/src/main/java/com/example/accesscode/myphone/EmailActivity.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.example.accesscode.myphone; - -import android.app.Activity; -import android.os.Bundle; -import android.view.View; -import android.widget.Button; -import android.widget.EditText; - -/** - * Created by amyquispe on 4/30/15. - */ -public class EmailActivity extends Activity { - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_email); - final EditText emailSubject = (EditText) findViewById(R.id.email_subject); - final EditText emailBody = (EditText) findViewById(R.id.email_body); - Button mailButton = (Button) findViewById(R.id.mail_button); - mailButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - String myEmailAddress = ""; /* put your email address here */ - String subject = emailSubject.getText().toString(); - String body = emailBody.getText().toString(); - - /* - Use an implicit intent to open up the user's email program and send - and email with this subject and body to you. - - http://developer.android.com/guide/components/intents-common.html#Email - - */ - } - }); - } -} diff --git a/exercises/5_OOP-and-Intents/MyPhone/app/src/main/java/com/example/accesscode/myphone/MainActivity.java b/exercises/5_OOP-and-Intents/MyPhone/app/src/main/java/com/example/accesscode/myphone/MainActivity.java deleted file mode 100644 index 2e0460c9..00000000 --- a/exercises/5_OOP-and-Intents/MyPhone/app/src/main/java/com/example/accesscode/myphone/MainActivity.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.example.accesscode.myphone; - -import android.support.v7.app.ActionBarActivity; -import android.os.Bundle; -import android.view.Menu; -import android.view.MenuItem; -import android.view.View; -import android.widget.Button; -import android.widget.Toast; - - -public class MainActivity extends ActionBarActivity { - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - - /* DialerActivity */ - Button dialerButton = (Button) findViewById(R.id.dialer_button); - dialerButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - Toast.makeText(getApplicationContext(), "Dialer clicked", Toast.LENGTH_SHORT).show(); - /* - Use Explicit Intent to start DialerActivity here. - */ - } - }); - /* EmailActivity */ - Button emailButton = (Button) findViewById(R.id.email_button); - emailButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - Toast.makeText(getApplicationContext(), "Email clicked", Toast.LENGTH_SHORT).show(); - /* - Use Explicit Intent to start EmailActivity here. - */ - - } - }); - } - - - @Override - public boolean onCreateOptionsMenu(Menu menu) { - // Inflate the menu; this adds items to the action bar if it is present. - getMenuInflater().inflate(R.menu.menu_main, menu); - return true; - } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - // Handle action bar item clicks here. The action bar will - // automatically handle clicks on the Home/Up button, so long - // as you specify a parent activity in AndroidManifest.xml. - int id = item.getItemId(); - - //noinspection SimplifiableIfStatement - if (id == R.id.action_settings) { - return true; - } - - return super.onOptionsItemSelected(item); - } -} diff --git a/exercises/5_OOP-and-Intents/MyPhone/app/src/main/res/layout/activity_dialer.xml b/exercises/5_OOP-and-Intents/MyPhone/app/src/main/res/layout/activity_dialer.xml deleted file mode 100644 index d4bc14d3..00000000 --- a/exercises/5_OOP-and-Intents/MyPhone/app/src/main/res/layout/activity_dialer.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - -