{"id":7191,"date":"2018-02-20T23:50:30","date_gmt":"2018-02-20T23:50:30","guid":{"rendered":"http:\/\/essaysparlor.com\/recursive-programprogramming-assignment-2\/"},"modified":"2017-02-20T20:05:02","modified_gmt":"2017-02-20T20:05:02","slug":"recursive-programprogramming-assignment-2","status":"publish","type":"post","link":"https:\/\/www.benedictsol.com\/blogs\/recursive-programprogramming-assignment-2\/","title":{"rendered":"Recursive Program:Programming Assignment 2"},"content":{"rendered":"<p>Recursive Program:Programming Assignment 2<\/p>\n<p>You will implement and test 4 short recursive methods. With the proper<\/p>\n<p>use of recursion, none of these methods should require more than a dozen<\/p>\n<p>lines of code. Non-recursive methods receives 0 credit!!!<\/p>\n<p>Purposes:<\/p>\n<p>Ensure that you can write and test small recursive methods.<\/p>\n<p>Your program file name must be AssignmentTwo.java. This program should<\/p>\n<p>contain 4 recursive methods and your main method to test the four recursive<\/p>\n<p>methods.<\/p>\n<p>You may ask general questions from other students, tutors and your instructor, and<\/p>\n<p>those students may answer questions with pencil and paper. But do not look at<\/p>\n<p>program files or other students&#8217; solutions to any homework problems. Do not write<\/p>\n<p>any code in Canvas discussion threads.<\/p>\n<p>1. Triangle Pattern<\/p>\n<p>public void triangle(int m, int n)<\/p>\n<p>\/* Precondition: m <= n\n\n* Postcondition: The method should print a pattern of 2*(n-m+1) lines\n\n* to the standard output. The first line contains m asterisks, the next\n\n* line contains m+1 asterisks, and so on up to a line with n asterisks.\n\n* Then the pattern is repeated backwards, going n back down to m.\n\n* Example output: triangle(3, 5) will print this:\n\n***\n\n****\n\n*****\n\n*****\n\n****\n\n***\n\n*\/\n\nHint: Only one of the arguments changes in the recursive call. Which one?\n\nTest your program with following inputs:\n\ntriangle(4, 8)\n\ntriangle(5,5)\n\ntriangle(3,6)\n\ntriangle(6, 8)\n\n2. Section Numbers\n\npublic void numbers(String prefix, int levels)\n\nThe method prints output consisting of the String prefix followed by \"section\n\nnumbers\" of the form 1.1., 1.2., 1.3., and so on. The levels argument determines how\n\nmay levels the section numbers have. For example, if levels is 2, then the section\n\nnumbers have the form x.y. If levels is 3, then section numbers have the form x.y.z.\n\nThe digits permitted in each level are always '1' through '9'. As an example, if prefix\n\nis the string \"THERBLIG\" and levels is 2, then the method would start by printing:\n\nTHERBLIG1.1.\n\nTHERBLIG1.2.\n\nTHERBLIG1.3.\n\nand end by printing:\n\nTHERBLIG9.7.\n\nTHERBLIG9.8.\n\nTHERBLIG9.9.\n\nThe stopping case occurs when levels reaches zero (in which case the prefix is\n\nprinted once by itself followed by nothing else).\n\nThe Java String class has many manipulation methods, but you'll need only the\n\nability to make a new string which consists of prefix followed by another character\n\n(such as '1') and a period ('.'). If s is the String that you want to create and c is the\n\ndigit character (such as '1'), then the following statement will correctly form s:\n\ns = prefix + c + '.';\n\nThis new String s can be passed as a parameter to recursive calls of the method.\n\nTest your method with following inputs:\n\nnumbers(\ufffd\ufffd\ufffdEPISODE\ufffd\ufffd\ufffd , 3)\n\nnumbers(\ufffd\ufffd\ufffdERA\ufffd\ufffd\ufffd, 4)\n\nnumbers(\ufffd\ufffd\ufffdPassage\ufffd\ufffd\ufffd, 1)\n\n3. A Teddy Bear Picnic\n\nThis question involves a game with teddy bears. The game starts when I give you\n\nsome bears. You can then give back some bears, but you must follow these rules\n\n(where n is the number of bears that you have):\n\n1. If n is even, then you may give back exactly n\/2 bears.\n\n2. If n is divisible by 3 or 4, then you may multiply the last two digits of n and\n\ngive back this many bears. (By the way, the last digit of n is n%10, and the\n\nnext-to-last digit is ((n%100)\/10).\n\n3. If n is divisible by 5, then you may give back exactly 42 bears.\n\nThe goal of the game is to end up with EXACTLY 42 bears.\n\nFor example, suppose that you start with 250 bears. Then you could make these\n\nmoves:\n\n\ufffd\ufffd --Start with 250 bears.\n\n\ufffd\ufffd --Since 250 is divisible by 5, you may return 42 of the bears, leaving you with 208\n\nbears.\n\n\ufffd\ufffd --Since 208 is even, you may return half of the bears, leaving you with 104 bears.\n\n\ufffd\ufffd --Since 104 is even, you may return half of the bears, leaving you with 52 bears.\n\n\ufffd\ufffd --Since 52 is divisible by 4, you may multiply the last two digits (resulting in 10)\n\nand return these 10 bears. This leaves you with 42 bears.\n\n\ufffd\ufffd --You have reached the goal!\n\nWrite a recursive method to meet this specification:\n\npublic boolean bears(int n)\n\n\/\/ Precondition: n>0<\/p>\n<p>\/\/ Postcondition: A true return value means that it is possible to win \/\/ the bear<\/p>\n<p>game by starting with n bears. A false return value means that<\/p>\n<p>\/\/ it is not possible to win the bear game by starting with n bears. \/\/ Examples:<\/p>\n<p>\/\/ bear(250) is true (as shown above)<\/p>\n<p>\/\/ bear(42) is true<\/p>\n<p>\/\/ bear(84) is true<\/p>\n<p>\/\/ bear(53) is false<\/p>\n<p>\/\/ bear(41) is false<\/p>\n<p>\/\/ bear(854) is ?<\/p>\n<p>\/\/ bear( 1011) is ?<\/p>\n<p>Hint: To test whether n is even, use the expression ((n % 2) == 0).<\/p>\n<p>4. Find Longest Repeated Pattern<\/p>\n<p>public int findLongest(char c, String s, int length)<\/p>\n<p>Given a String, find the longest sequence of matching characters in that String and<\/p>\n<p>return that int length. For instance, \ufffd\ufffd\ufffdaaabbccccccdde\ufffd\ufffd\ufffd has 6 c\ufffd\ufffd\ufffds so the method would<\/p>\n<p>return 6<\/p>\n<p>Call this method passing it the first character in the String, the rest of the String and<\/p>\n<p>1, as in<\/p>\n<p>findLongest(\ufffd\ufffd\ufffda\ufffd\ufffd\ufffd, s, 1)<\/p>\n<p>length represents the longest matching sequence found so far, which is 1 because<\/p>\n<p>we found \ufffd\ufffd\ufffda\ufffd\ufffd\ufffd<\/p>\n<p>Base case: if length==0 or length==1 return the length of s<\/p>\n<p>Recursive cases: if c matches the 0th character of s, then we extend the sequence,<\/p>\n<p>return the value of the recursive call with c, the rest of s after the 0th character, and<\/p>\n<p>length+1<\/p>\n<p>else no match, return whichever is larger, length (the length we found of char c up to<\/p>\n<p>this point in s), or the value returned by recursively calling the method with the 0th<\/p>\n<p>character of s, the rest of s, and 1 as we are starting over<\/p>\n<p>Example: \ufffd\ufffd\ufffdaaabbccccccdde\ufffd\ufffd\ufffd<\/p>\n<p>Call the method with \ufffd\ufffd\ufffda\ufffd\ufffd\ufffd, \ufffd\ufffd\ufffdaabbccccccdde\ufffd\ufffd\ufffd, 1<\/p>\n<p>First character matches, so call with \ufffd\ufffd\ufffda\ufffd\ufffd\ufffd, \ufffd\ufffd\ufffdabbccccccdde\ufffd\ufffd\ufffd, 2<\/p>\n<p>First character matches, so call with \ufffd\ufffd\ufffda\ufffd\ufffd\ufffd, \ufffd\ufffd\ufffdbbccccccdde, 3<\/p>\n<p>No match, so return max(3, call with \ufffd\ufffd\ufffdb\ufffd\ufffd\ufffd, \ufffd\ufffd\ufffdbccccccdde\ufffd\ufffd\ufffd, 1)<\/p>\n<p>First character matches, so call with \ufffd\ufffd\ufffdb\ufffd\ufffd\ufffd, \ufffd\ufffd\ufffdccccccdde, 2<\/p>\n<p>No match, so return max(2, call with \ufffd\ufffd\ufffdc\ufffd\ufffd\ufffd, \ufffd\ufffd\ufffdcccccdde\ufffd\ufffd\ufffd, 1)<\/p>\n<p>First character matches, so call with \ufffd\ufffd\ufffdc\ufffd\ufffd\ufffd, \ufffd\ufffd\ufffdccccdde\ufffd\ufffd\ufffd, 2<\/p>\n<p>\ufffd\ufffd\ufffd<\/p>\n<p>Eventually these calls return 6 (6 c\ufffd\ufffd\ufffds found)<\/p>\n<p>Return max(2, 6)<\/p>\n<p>Return max(3, 6)<\/p>\n<p>Run your program on the following inputs.<\/p>\n<p>\ufffd\ufffd\ufffdaabbbcddddddeefffghiii\ufffd\ufffd\ufffd, \ufffd\ufffd\ufffd19855aa00000cc24443bbb\ufffd\ufffd\ufffd ,<\/p>\n<p>\ufffd\ufffd\ufffd33335557i322k555554p\ufffd\ufffd\ufffd,<\/p>\n<p>\ufffd\ufffd\ufffd2oo88rrrrr55ttyuuuuuuuuuuuuuuu44uuuuuuuuu4u444uuuuuuuuuuuuuuu\ufffd\ufffd\ufffd<\/p>\n<p>Turn in the following<\/p>\n<p>Cover page (page 1): Your name, assignment number, assignment title, and due<\/p>\n<p>date.<\/p>\n<p>One page abstract (page 2): Describe the four problems in your own words<\/p>\n<p>(descriptions are given in the lab document), explain your recursive algorithm<\/p>\n<p>design, and observations. Make sure to check spellings and grammar. The<\/p>\n<p>abstract should be typed in Times New Roman style font with single spacing and<\/p>\n<p>the font size of 12.<\/p>\n<p>Source Program(s): Turn in Java source code AssignmentTwo.java. Your<\/p>\n<p>program should be properly indented and commented with each method with<\/p>\n<p>JavaDoc pre\/post conditions.<\/p>\n<p>Outputs: Outputs of all test cases in a PDF. Test cases are given to you in the<\/p>\n<p>lab document. All outputs should be properly labeled identifying different<\/p>\n<p>methods and their inputs.<\/p>\n<p>Programming\tAssignment\t2\tYou\twill\timplement\tand\ttest\t4\tshort\trecursive\tmethods.\tWith\tthe\tproper\tuse<\/p>\n<p>of\trecursion,\tnone\tof\tthese\tmethods\tshould\trequire\tmore\tthan\ta\tdozen\tlines\tof\tcode.\tNon-recursive\tmethods\treceives<\/p>\n<p>0\tcredit!!!\t\tPurposes:\tEnsure\tthat\tyou\tcan\twrite\tand\ttest\tsmall\trecursive\tmethods.\t\tYour\tprogram<\/p>\n<p>file\tname\tmust\tbe\tAssignmentTwo.java.\tThis\tprogram\tshould\tcontain\t4\trecursive\tmethods\tand\tyour\tmain\tmethod\tto\ttest<\/p>\n<p>the\tfour\trecursive\tmethods.\tYou\tmay\task\tgeneral\tquestions\tfrom\tother\tstudents,\ttutors\tand\tyour\tinstructor,<\/p>\n<p>and\tthose\tstudents\tmay\tanswer\tquestions\twith\tpencil\tand\tpaper.\tBut\tdo\tnot\tlook\tat\tprogram\tfiles\tor\tother<\/p>\n<p>students&#8217;\tsolutions\tto\tany\thomework\tproblems.\tDo\tnot\twrite\tany\tcode\tin\tCanvas\tdiscussion\tthreads.<\/p>\n<p>\t\t1.\tTriangle\tPattern\t\t\tpublic\tvoid\ttriangle(int\tm,\tint\tn)\t\t\t\t\t\/*<\/p>\n<p>Precondition:\tm\t<=\tn\t\t\t\t\t*\tPostcondition:\tThe\tmethod\tshould\tprint\ta\tpattern\tof\t2*(n-m+1)\n\nlines\t\t\t\t\t*\tto\tthe\tstandard\toutput.\tThe\tfirst\tline\tcontains\tm\tasterisks,\tthe\tnext\n\n\t\t\t\t*\tline\tcontains\tm+1\tasterisks,\tand\tso\ton\tup\tto\ta\tline\twith\tn\n\nasterisks.\t\t\t\t*\tThen\tthe\tpattern\tis\trepeated\tbackwards,\tgoing\tn\tback\tdown\tto\tm.\n\n\t\t*\tExample\toutput:\t\t\t\t\t\ttriangle(3,\t5)\twill\tprint\tthis:\n\n\t\t***\t\t\t\t\t\t\t****\t\t\t\t\t\t\t*****\n\n\t\t*****\t\t\t\t\t\t\t****\t\t\t\t\t\t\t***\n\n*\/\t\tHint:\tOnly\tone\tof\tthe\targuments\tchanges\tin\tthe\trecursive\tcall.\tWhich\tone?\tTest\tyour\tprogram\twith\n\nfollowing\tinputs:\ttriangle(4,\t8)\ttriangle(5,5)\ttriangle(3,6)\ttriangle(6,\t8)\n2.\tSection\tNumbers\t\t\tpublic\tvoid\tnumbers(String\tprefix,\tint\tlevels)\t\t\tThe\tmethod\tprints\toutput\tconsisting\tof\n\nthe\tString\tprefix\tfollowed\tby\t\"section\tnumbers\"\tof\tthe\tform\t1.1.,\t1.2.,\t1.3.,\tand\tso\ton.\tThe\tlevels\n\nargument\tdetermines\thow\tmay\tlevels\tthe\tsection\tnumbers\thave.\tFor\texample,\tif\tlevels\tis\t2,\tthen\tthe\tsection\n\nnumbers\thave\tthe\tform\tx.y.\tIf\tlevels\tis\t3,\tthen\tsection\tnumbers\thave\tthe\tform\tx.y.z.\tThe\tdigits\tpermitted\tin\n\neach\tlevel\tare\talways\t'1'\tthrough\t'9'.\tAs\tan\texample,\tif\tprefix\tis\tthe\tstring\t\"THERBLIG\"\tand\tlevels\tis\n\n2,\tthen\tthe\tmethod\twould\tstart\tby\tprinting:\t\tTHERBLIG1.1.\t\tTHERBLIG1.2.\t\tTHERBLIG1.3.\t\t\tand\n\nend\tby\tprinting:\t\tTHERBLIG9.7.\t\tTHERBLIG9.8.\t\tTHERBLIG9.9.\t\tThe\tstopping\tcase\toccurs\twhen\tlevels\n\nreaches\tzero\t(in\twhich\tcase\tthe\tprefix\tis\tprinted\tonce\tby\titself\tfollowed\tby\tnothing\telse).\tThe\tJava\tString\tclass\n\nhas\tmany\tmanipulation\tmethods,\tbut\tyou'll\tneed\tonly\tthe\tability\tto\tmake\ta\tnew\tstring\twhich\tconsists\tof\n\nprefix\tfollowed\tby\tanother\tcharacter\t(such\tas\t'1')\tand\ta\tperiod\t('.').\tIf\ts\tis\tthe\tString\tthat\tyou\n\nwant\tto\tcreate\tand\tc\tis\tthe\tdigit\tcharacter\t(such\tas\t'1'),\tthen\tthe\tfollowing\tstatement\twill\n\ncorrectly\tform\ts:\t\t\ts\t=\tprefix\t+\tc\t+\t'.';\t\tThis\tnew\tString\ts\tcan\tbe\tpassed\n\nas\ta\tparameter\tto\trecursive\tcalls\tof\tthe\tmethod.\tTest\tyour\tmethod\twith\tfollowing\tinputs:\tnumbers(\ufffd\ufffd\ufffdEPISODE\ufffd\ufffd\ufffd\n\n,\t3)\tnumbers(\ufffd\ufffd\ufffdERA\ufffd\ufffd\ufffd,\t4)\tnumbers(\ufffd\ufffd\ufffdPassage\ufffd\ufffd\ufffd,\t1)\t3.\tA\tTeddy\tBear\tPicnic\tThis\tquestion\tinvolves\ta\tgame\n\nwith\tteddy\tbears.\tThe\tgame\tstarts\twhen\tI\tgive\tyou\tsome\tbears.\tYou\tcan\tthen\tgive\tback\tsome\tbears,\tbut\tyou\n\nmust\tfollow\tthese\trules\t(where\tn\tis\tthe\tnumber\tof\tbears\tthat\tyou\thave):\t1. If\tn\tis\teven,\tthen\tyou\tmay\n\ngive\tback\texactly\tn\/2\tbears.\t2. If\tn\tis\tdivisible\tby\t3\tor\t4,\tthen\tyou\tmay\tmultiply\tthe\tlast\n\ntwo\tdigits\tof\tn\tand\tgive\tback\tthis\tmany\tbears.\t(By\tthe\tway,\tthe\tlast\tdigit\tof\tn\tis\tn%10,\tand\n\nthe\tnext-to-last\tdigit\tis\t((n%100)\/10).\t3. If\tn\tis\tdivisible\tby\t5,\tthen\tyou\tmay\tgive\tback\texactly\t42\n\nbears.\nThe\tgoal\tof\tthe\tgame\tis\tto\tend\tup\twith\tEXACTLY\t42\tbears.\tFor\texample,\tsuppose\tthat\tyou\tstart\twith\n\n250\tbears.\tThen\tyou\tcould\tmake\tthese\tmoves:\t\ufffd\ufffd\t\t--Start\twith\t250\tbears.\t\ufffd\ufffd\t\t--Since\t250\tis\tdivisible\n\nby\t5,\tyou\tmay\treturn\t42\tof\tthe\tbears,\tleaving\tyou\twith\t208\tbears.\t\ufffd\ufffd\t\t--Since\t208\tis\teven,\tyou\n\nmay\treturn\thalf\tof\tthe\tbears,\tleaving\tyou\twith\t104\tbears.\t\ufffd\ufffd\t\t--Since\t104\tis\teven,\tyou\tmay\treturn\thalf\n\nof\tthe\tbears,\tleaving\tyou\twith\t52\tbears.\t\ufffd\ufffd\t\t--Since\t52\tis\tdivisible\tby\t4,\tyou\tmay\tmultiply\n\nthe\tlast\ttwo\tdigits\t(resulting\tin\t10)\tand\treturn\tthese\t10\tbears.\tThis\tleaves\tyou\twith\t42\tbears.\t\ufffd\ufffd\n\n--You\thave\treached\tthe\tgoal!\tWrite\ta\trecursive\tmethod\tto\tmeet\tthis\tspecification:\t\t\t\tpublic\tboolean\tbears\n\n(int\tn)\t\t\t\t\t\/\/\tPrecondition:\tn>0\t\/\/\tPostcondition:\tA\ttrue\treturn\tvalue\tmeans\tthat\tit\tis<\/p>\n<p>possible\tto\twin\t\t\t\t\/\/\tthe\tbear\tgame\tby\tstarting\twith\tn\tbears.\tA\tfalse\treturn\tvalue<\/p>\n<p>means\tthat\t\t\t\t\t\/\/\tit\tis\tnot\tpossible\tto\twin\tthe\tbear\tgame\tby\tstarting\twith<\/p>\n<p>n\tbears.\t\t\t\t\/\/\tExamples:\t\t\t\t\t\/\/\t\t\tbear(250)\tis\ttrue\t(as\tshown<\/p>\n<p>above)\t\t\t\t\t\/\/\t\t\tbear(42)\tis\ttrue\t\t\t\t\t\/\/\t\t\tbear(84)<\/p>\n<p>is\ttrue\t\t\t\t\t\/\/\t\t\tbear(53)\tis\tfalse\t\t\t\t\t\/\/\t\t\tbear<\/p>\n<p>(41)\tis\tfalse\t\t\/\/\t\tbear(854)\tis\t?\t\/\/\tbear(\t1011)\tis\t?\tHint:\tTo\ttest\twhether\tn\tis<\/p>\n<p>even,\tuse\tthe\texpression\t((n\t%\t2)\t==\t0).\t\t4.\tFind\tLongest\tRepeated\tPattern<\/p>\n<p>public\tint\tfindLongest(char\tc,\tString\ts,\tint\tlength)\t\t\t\tGiven\ta\tString,\tfind\tthe\tlongest\tsequence<\/p>\n<p>of\tmatching\tcharacters\tin\tthat\tString\tand\treturn\tthat\tint\tlength.\tFor\tinstance,\t\ufffd\ufffd\ufffdaaabbccccccdde\ufffd\ufffd\ufffd\thas\t6<\/p>\n<p>c\ufffd\ufffd\ufffds\tso\tthe\tmethod\twould\treturn\t6\t\tCall\tthis\tmethod\tpassing\tit\tthe\tfirst\tcharacter\tin\tthe\tString,\tthe<\/p>\n<p>rest\tof\tthe\tString\tand\t1,\tas\tin\t\tfindLongest(\ufffd\ufffd\ufffda\ufffd\ufffd\ufffd,\t\ts,\t1)\t\tlength\trepresents\tthe\tlongest<\/p>\n<p>matching\tsequence\tfound\tso\tfar,\twhich\tis\t1\tbecause\twe\tfound\t\ufffd\ufffd\ufffda\ufffd\ufffd\ufffd\tBase\tcase:\tif\tlength==0\tor<\/p>\n<p>length==1\treturn\tthe\tlength\tof\ts\t\tRecursive\tcases:\tif\tc\tmatches\tthe\t0th\tcharacter\tof\ts,\tthen<\/p>\n<p>we\textend\tthe\tsequence,\t\treturn\tthe\tvalue\tof\tthe\trecursive\tcall\twith\tc,\tthe\trest\tof\ts\tafter<\/p>\n<p>the\t0th\tcharacter,\tand<br \/>\nlength+1\t\telse\tno\tmatch,\treturn\twhichever\tis\tlarger,\tlength\t(the\tlength\twe\tfound\tof\tchar\tc\tup\tto<\/p>\n<p>this\tpoint\tin\ts),\tor\tthe\tvalue\treturned\tby\trecursively\tcalling\tthe\tmethod\twith\tthe\t0th\tcharacter\tof<\/p>\n<p>s,\tthe\trest\tof\ts,\tand\t1\tas\twe\tare\tstarting\tover\t\t\tExample:\t\ufffd\ufffd\ufffdaaabbccccccdde\ufffd\ufffd\ufffd<\/p>\n<p>Call\tthe\tmethod\twith\t\ufffd\ufffd\ufffda\ufffd\ufffd\ufffd,\t\ufffd\ufffd\ufffdaabbccccccdde\ufffd\ufffd\ufffd,\t1\t\tFirst\tcharacter\tmatches,\tso\tcall\twith\t\ufffd\ufffd\ufffda\ufffd\ufffd\ufffd,\t\ufffd\ufffd\ufffdabbccccccdde\ufffd\ufffd\ufffd,<\/p>\n<p>2\t\tFirst\tcharacter\tmatches,\tso\tcall\twith\t\ufffd\ufffd\ufffda\ufffd\ufffd\ufffd,\t\ufffd\ufffd\ufffdbbccccccdde,\t3\t\tNo\tmatch,\tso\treturn\tmax(3,\tcall<\/p>\n<p>with\t\ufffd\ufffd\ufffdb\ufffd\ufffd\ufffd,\t\ufffd\ufffd\ufffdbccccccdde\ufffd\ufffd\ufffd,\t1)\t\tFirst\tcharacter\tmatches,\tso\tcall\twith\t\ufffd\ufffd\ufffdb\ufffd\ufffd\ufffd,\t\ufffd\ufffd\ufffdccccccdde,\t2\t\tNo\tmatch,<\/p>\n<p>so\treturn\tmax(2,\tcall\twith\t\ufffd\ufffd\ufffdc\ufffd\ufffd\ufffd,\t\ufffd\ufffd\ufffdcccccdde\ufffd\ufffd\ufffd,\t1)\t\tFirst\tcharacter\tmatches,\tso\tcall\twith\t\ufffd\ufffd\ufffdc\ufffd\ufffd\ufffd,\t\ufffd\ufffd\ufffdccccdde\ufffd\ufffd\ufffd,<\/p>\n<p>2\t\t\ufffd\ufffd\ufffd\t\tEventually\tthese\tcalls\treturn\t6\t(6\tc\ufffd\ufffd\ufffds\tfound)\t\tReturn\tmax(2,\t6)\t\tReturn\tmax(3,\t6)<\/p>\n<p>\t\tRun\tyour\tprogram\ton\tthe\tfollowing\tinputs.\t\t\t\ufffd\ufffd\ufffdaabbbcddddddeefffghiii\ufffd\ufffd\ufffd,\t\ufffd\ufffd\ufffd19855aa00000cc24443bbb\ufffd\ufffd\ufffd\t,<\/p>\n<p>\ufffd\ufffd\ufffd33335557i322k555554p\ufffd\ufffd\ufffd,\t\ufffd\ufffd\ufffd2oo88rrrrr55ttyuuuuuuuuuuuuuuu44uuuuuuuuu4u444uuuuuuuuuuuuuuu\ufffd\ufffd\ufffd\t\t\tTurn\tin\tthe\tfollowing<br \/>\nCover page (page 1): Your name, assignment number, assignment title, and due date.   One page abstract (page 2): Describe the four problems in your own words<\/p>\n<p>(descriptions are given in the lab document), explain your recursive algorithm design, and observations. Make sure to check spellings and grammar. The abstract should<\/p>\n<p>be typed in Times New Roman style font with single spacing and the font size of 12.   Source Program(s): Turn in Java source code AssignmentTwo.java. Your program<\/p>\n<p>should be properly indented and commented with each method with JavaDoc pre\/post conditions.  Outputs:  Outputs of all test cases in a PDF. Test cases are given to you<\/p>\n<p>in the lab document.  All outputs should be properly labeled identifying different methods and their inputs.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recursive Program:Programming Assignment 2 You will implement and test 4 short recursive methods. With the proper use of recursion, none of these methods should require more than a dozen lines of code. Non-recursive methods receives 0 credit!!! Purposes: Ensure that <a href=\"https:\/\/www.benedictsol.com\/blogs\/recursive-programprogramming-assignment-2\/\" class=\"read-more\">Read More &#8230;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-7191","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/www.benedictsol.com\/blogs\/wp-json\/wp\/v2\/posts\/7191","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.benedictsol.com\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.benedictsol.com\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.benedictsol.com\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.benedictsol.com\/blogs\/wp-json\/wp\/v2\/comments?post=7191"}],"version-history":[{"count":0,"href":"https:\/\/www.benedictsol.com\/blogs\/wp-json\/wp\/v2\/posts\/7191\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.benedictsol.com\/blogs\/wp-json\/wp\/v2\/media?parent=7191"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.benedictsol.com\/blogs\/wp-json\/wp\/v2\/categories?post=7191"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.benedictsol.com\/blogs\/wp-json\/wp\/v2\/tags?post=7191"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}