From 34c25222e3076fcdff46fe67ef0e0853b9e36e9a Mon Sep 17 00:00:00 2001 From: Ajah Dailey Date: Tue, 5 Feb 2019 13:46:12 -0500 Subject: [PATCH 1/2] Dan Lab --- MathUtilities.class | Bin 2416 -> 2880 bytes MathUtilities.java | 48 +++++++++++++++++++-------------------- PredicateUtilities.class | Bin 872 -> 1082 bytes PredicateUtilities.ctxt | 2 +- PredicateUtilities.java | 33 ++++++++++++++++++++------- StringUtilities.class | Bin 1405 -> 2342 bytes StringUtilities.java | 32 ++++++++++++++++++-------- 7 files changed, 72 insertions(+), 43 deletions(-) diff --git a/MathUtilities.class b/MathUtilities.class index 4ea9860039adf0b48df42a9745fced00444b82a2..8f0b7d4444b4885f5f7e221aa4ebb7154ac71220 100644 GIT binary patch literal 2880 zcmaKt%TE(g6o-GqYsy#wK|}?mrKPmK@cqJPsZAgtiz-{4wgVj;I@(T2h+DTVjEP&f zF4c{VCazo=w{HDYjOR{ohwJ1FEau+1_neP2=gUcd{{8wLz-2rzFo>LiQ#ftl49*%j zhj|0%alybvTrw!+ijJ!~u4x#!W!G)*j)vZBZe2s)qFc2z46oRA>tSoVY&9O4Wrt2i zSKNx}teXv6yvxHruVyzz^s4FA9(%T9d$!eFAedRLYM96_E#+3W%pG&yG3%T2OLfoM zv>J3jST>v1y6LottSxCUs`kc))v)RnIyjtNURKjq-1;WvXv-SLv!#-HRjRoSPu!J6 zT0XDd<##}rV1tz9uijM06yD9k9itwzNv+I~y_>)JWdr#K88&~ZJE z8@Q=sL9DlQ+!pH{9e2fgPse?+=5;KJmC8K$A4$W=UeDLcTb3yQ(B6^MK;`cU18WA^vI4)})y7@~c=6M$ii&>QsfQ)1aqE}bDrd!yNvS>k;ty|6gqRB=A73U=bs~xvw`!Bbe`s%+l=#X zk;ty|jC7vnoYy$#KNP0wd^T{NkqKPL@#;aHV6yuwAirt0@!(lozZ{Cmg{rdXz@7M1Da35~xU=40$;ARGH5lBDa zHuoM9SgX|s1d@-PF(XjuahpAvpA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F-#cI31`v7>l8g9T?=W z{xTp(k)oKUtVKJcJ+=D*_D%ESkdG&%CxA#-gKN{=0oOo z)SWOjB9E0&%|L-p2AzvB)M~NSR%57b#a1iDP;10iE2Bd5YTx!~*Z$7?b`YvXjvIfD PS7R`b7BXw$yVQRHtZR7~ diff --git a/PredicateUtilities.ctxt b/PredicateUtilities.ctxt index d46571c..e59f256 100644 --- a/PredicateUtilities.ctxt +++ b/PredicateUtilities.ctxt @@ -9,7 +9,7 @@ comment2.target=java.lang.Boolean\ isLessThan(int,\ int) comment2.text=\n\ @param\ x\n\ @param\ y\n\ @return\ true\ if\ `x`\ is\ less\ than\ `y`\n comment3.params=x\ y comment3.target=java.lang.Boolean\ isGreaterThanOrEqualTo(int,\ int) -comment3.text=\n\ @param\ x\n\ @param\ y\n\ @return\ true\ if\ `x`\ is\ greater\ than\ or\ equal\ to\ `y`\n +comment3.text=\n\ @param\ x\n\ @param\n\ @return\ true\ if\ `x`\ is\ greater\ than\ or\ equal\ to\ `y`\n comment4.params=x\ y comment4.target=java.lang.Boolean\ isLessThanOrEqualTo(int,\ int) comment4.text=\n\ @param\ x\n\ @param\ y\n\ @return\ true\ if\ `x`\ is\ less\ than\ or\ equal\ to\ `y`\n diff --git a/PredicateUtilities.java b/PredicateUtilities.java index 4b83a87..d1c1eb3 100644 --- a/PredicateUtilities.java +++ b/PredicateUtilities.java @@ -1,4 +1,4 @@ - + /** * Created by dan on 6/14/17. @@ -10,25 +10,38 @@ public class PredicateUtilities { * @return true if `x` is greater than `y` */ public Boolean isGreaterThan(int x, int y) { - return null; + if(x > y) { + return true; + }else { + return false; + } } + /** * @param x * @param y * @return true if `x` is less than `y` */ public Boolean isLessThan(int x, int y) { - return null; + if(x < y) { + return true; + }else { + return false; + } } /** * @param x - * @param y + * @param * @return true if `x` is greater than or equal to `y` */ public Boolean isGreaterThanOrEqualTo(int x, int y) { - return null; + if( x >= y) { + return true; + }else { + return false; + } } /** @@ -37,7 +50,11 @@ public Boolean isGreaterThanOrEqualTo(int x, int y) { * @return true if `x` is less than or equal to `y` */ public Boolean isLessThanOrEqualTo(int x, int y) { - return null; + if( x <= y) { + return true; + }else { + return false; + } } @@ -45,13 +62,13 @@ public Boolean isLessThanOrEqualTo(int x, int y) { * @return true */ public Boolean returnTrue() { - return null; + return true; } /** * @return false */ public Boolean returnFalse() { - return null; + return false; } } \ No newline at end of file diff --git a/StringUtilities.class b/StringUtilities.class index 71bb6fd8e995b386ae53529bbb1ff3712a34ed87..63bf3786b3890cfd71c1c63f378b761eee0a7e6c 100644 GIT binary patch literal 2342 zcmai0?N%FA6x}yplY{|EiWCdl)Q>hFrAXDb6k08z*wg^Ep4wJ0Og!%yf z^$Gm1f9s!=rEB>BK8BCsT3Yv=nI?fmo3(O3&)MgkefCW9$3MUR4&WnHlSpAPj+;r` z!Y3L&O(KFtHQZLiQXBlkU=9ZHAh@oN2`!lIe##Z0l^cVI|S6iBep`;Oc(zZ1AH zAp3!iQPXa;7*#o!TRWcf7&B-Xj@)=w_vs@~^<(HzMpHCcu*SxVCr+eZC?f2!d=i!Ik% zPF1d$N~`03n2sDTD<$YSjd6h?Pn2m-mGso{1s({TIjNPUmTA?bqoa%s9S<=jFx{)K zbUuAdN;)>NrQ=IH((qV;KGE?NzSi)K+B{|EX&u{O7G+de!-)(9PIWU_uk6bz#nE&0 ziZ|_0wR3&vgw%YGh2GBi9&Ag@Xf&kFR?NJnm%c|(I343|phL>E*{U=>)&(Xq#p2*V zmb7=>J?~Az=VGi|P@qZW`?%M&tJPSQn!C-KBbj2hKwWg5I}#I^%oKXvJ2y-=+HCOE zqn_Px7&k&dn#yP&h-7IIpIhuO`@e3CrOmK{OhcTStTK5ew zi8r}R;4G$iqMX&NKH*g8IVbYL(RUr9;WXX~4EG5e;oaHX5yGp#A@b-2qLV`?8SXIh04MN1E(9QR1XXovxiE80oCM1Dkfh z=!{ET@zL?TM3Q7(_9URXc`t~NQW-{SQEM?b)rNkA;cm%EFNbCN-RTLC3IZf}{sEcf z1BST{0fhi}D3=;(^OrauzH$<975w?`0UW{=FJp~;|B(L@6yV4I4H)SI+$7-EYXGly z0DmBbN^~=+k&<8h&FLSJ4s@zCnwusQZJeT3OW%iH{`~UKe3$tNat=Ht#5P7?P&(Tr sq~e87^E63~UL!54eKWZ3RTgGruXcK&BlI_t8s^1c6rjKjT86OjFO3oA`Tzg` literal 1405 zcma)4O>Yx15FMxaAZbdQ5DF9uw9qy|KrW~PfqI}QqEaY`g!Js}PEuFSI`TS&p9Lo* z4*URq6k@zyLOxa`dsy4!_ujnm%&*@+egeQVs1{%a_HwYFg98THS0WJRh`~y=)?tu7 zRz5OVZ;AjlqvN);rkMg&$;HFLCv6+kZ-bpF_iR+B+#(0 zOU<;s42RsqHz>tG81!8UuH~)heH|>P@e*}tErrp1wAIJIkwQz2w1*90XRG2A#^dwU zcCH9%$Pjhrj={#izP|5Xpl4tQQZ&-`TLl_n$k0Dar#h{S*36^tz`oHY1v&a>qhJ=U z(7xyZkcR@D@+4p*mb?|+5QlxG6PsYJ5^fEy#<)XTQ-pB1$qbb!!=}51b=V-3^-!W6 z%>!wa7iw(JXk44osKE7D<1wwa*m)m&6P2c5GxCv#8%r>sBrW5PZOCtOE5cA%-tv_g9lN^AN~QSYyNBi diff --git a/StringUtilities.java b/StringUtilities.java index b791a2a..12e5cf1 100644 --- a/StringUtilities.java +++ b/StringUtilities.java @@ -8,7 +8,7 @@ public class StringUtilities { * @return `Hello World` as a string */ public static String getHelloWorld() { - return null; + return "Hello World"; } /** @@ -17,7 +17,9 @@ public static String getHelloWorld() { * @return the concatenation of two strings, `firstSegment`, and `secondSegment` */ public static String concatenation(String firstSegment, String secondSegment){ - return null; + String convert = String.valueOf(firstSegment); + String combined = convert + secondSegment; + return combined; } /** @@ -26,7 +28,7 @@ public static String concatenation(String firstSegment, String secondSegment){ * @return the concatenation of an integer, `firstSegment`, and a String, `secondSegment` */ public static String concatenation(int firstSegment, String secondSegment){ - return null; + return "firstSegment + secondSegment"; } /** @@ -34,7 +36,9 @@ public static String concatenation(int firstSegment, String secondSegment){ * @return the first 3 characters of `input` */ public static String getPrefix(String input){ - return null; + + + return input.substring(0,3); } /** @@ -42,7 +46,7 @@ public static String getPrefix(String input){ * @return the last 3 characters of `input` */ public static String getSuffix(String input){ - return null; + return input.substring(input.length() - 3, input.length()); } /** @@ -51,7 +55,9 @@ public static String getSuffix(String input){ * @return the equivalence of two strings, `inputValue` and `comparableValue` */ public static Boolean compareTwoStrings(String inputValue, String comparableValue){ - return null; + if (inputValue==comparableValue) { + return true; + }else {return false;} } /** @@ -59,7 +65,8 @@ public static Boolean compareTwoStrings(String inputValue, String comparableValu * @return the middle character of `inputValue` */ public static Character getMiddleCharacter(String inputValue){ - return null; + int mid = (inputValue.length()-1)/2; + return inputValue.charAt(mid); } /** @@ -67,7 +74,8 @@ public static Character getMiddleCharacter(String inputValue){ * @return the first sequence of characters */ public static String getFirstWord(String spaceDelimitedString){ - return null; + String[] words = spaceDelimitedString.split(" "); + return words[0]; } /** @@ -75,7 +83,8 @@ public static String getFirstWord(String spaceDelimitedString){ * @return the second word of a string delimited by spaces. */ public static String getSecondWord(String spaceDelimitedString){ - return null; + String[] words = spaceDelimitedString.split(" "); + return words [1]; } /** @@ -83,6 +92,9 @@ public static String getSecondWord(String spaceDelimitedString){ * @return an identical string with characters in reverse order. */ public static String reverse(String stringToReverse){ - return null; + String reverse = " "; + for (int i = stringToReverse.length() - 1; i >=0; i --) { + reverse += stringToReverse.charAt(i); + } return reverse; } } From 2271121d4dddf87be59c21b81fabb63ce7bf6f35 Mon Sep 17 00:00:00 2001 From: Ajah Dailey Date: Tue, 5 Feb 2019 19:49:16 -0500 Subject: [PATCH 2/2] DanDoBetter Lab Changes --- package.bluej | 91 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 53 insertions(+), 38 deletions(-) diff --git a/package.bluej b/package.bluej index 5ded697..0a01f12 100644 --- a/package.bluej +++ b/package.bluej @@ -1,20 +1,20 @@ #BlueJ package file -editor.fx.0.height=0 -editor.fx.0.width=0 -editor.fx.0.x=0 -editor.fx.0.y=0 -objectbench.height=129 -objectbench.width=531 +editor.fx.0.height=721 +editor.fx.0.width=800 +editor.fx.0.x=240 +editor.fx.0.y=23 +objectbench.height=164 +objectbench.width=837 package.divider.horizontal=0.6397146254458977 -package.divider.vertical=0.8697318007662835 -package.editor.height=901 -package.editor.width=727 -package.editor.x=1440 -package.editor.y=0 -package.frame.height=1080 +package.divider.vertical=0.6138763197586727 +package.editor.height=400 +package.editor.width=735 +package.editor.x=100 +package.editor.y=23 +package.frame.height=721 package.frame.width=861 package.numDependencies=0 -package.numTargets=6 +package.numTargets=9 package.showExtends=true package.showUses=true project.charset=UTF-8 @@ -27,7 +27,6 @@ target1.height=50 target1.name=PredicateUtilities target1.showInterface=false target1.type=ClassTarget -target1.typeParameters= target1.width=130 target1.x=280 target1.y=120 @@ -35,39 +34,55 @@ target2.height=50 target2.name=StringUtilitiesTest target2.showInterface=false target2.type=UnitTestTargetJunit4 -target2.typeParameters= target2.width=140 target2.x=490 target2.y=70 target3.height=50 -target3.name=MathUtilities +target3.name=TestMultiplication target3.showInterface=false -target3.type=ClassTarget -target3.typeParameters= -target3.width=100 -target3.x=60 -target3.y=150 +target3.type=UnitTestTargetJunit4 +target3.width=140 +target3.x=70 +target3.y=60 target4.height=50 -target4.name=PredicateUtilitiesTest +target4.name=TestDivision target4.showInterface=false target4.type=UnitTestTargetJunit4 -target4.typeParameters= -target4.width=160 -target4.x=260 -target4.y=50 +target4.width=100 +target4.x=170 +target4.y=120 target5.height=50 -target5.name=StringUtilities +target5.name=TestSubtraction target5.showInterface=false -target5.type=ClassTarget -target5.typeParameters= -target5.width=110 -target5.x=500 -target5.y=130 +target5.type=UnitTestTargetJunit4 +target5.width=120 +target5.x=10 +target5.y=210 target6.height=50 -target6.name=MathUtilitiesTest +target6.name=MathUtilities target6.showInterface=false -target6.type=UnitTestTargetJunit4 -target6.typeParameters= -target6.width=130 -target6.x=50 -target6.y=90 +target6.type=ClassTarget +target6.width=100 +target6.x=60 +target6.y=150 +target7.height=50 +target7.name=StringUtilities +target7.showInterface=false +target7.type=ClassTarget +target7.width=110 +target7.x=500 +target7.y=130 +target8.height=50 +target8.name=PredicateUtilitiesTest +target8.showInterface=false +target8.type=UnitTestTargetJunit4 +target8.width=160 +target8.x=260 +target8.y=50 +target9.height=50 +target9.name=TestAddition +target9.showInterface=false +target9.type=UnitTestTargetJunit4 +target9.width=100 +target9.x=170 +target9.y=180