CS XXXXXXXXXXU03 HW Write two complete java programs to solve the following two problems. Zip up the .java files and submit them. Make certain to document your code properly. 1) Combination...

1 answer below »
I have uploaded it along


CS 2323 - U03 HW Write two complete java programs to solve the following two problems. Zip up the .java files and submit them. Make certain to document your code properly. 1) Combination Combinations in mathematics are the ways of picking several items from a large group, where order does not matter. For example, there are 6 ways to pick 2 items from a group of 4 items. In mathematics, the number of combinations of picking k items from a group of n items is denoted as k nC , knC , or       k n . )!(! ! knk n Ckn − = Write a method named getNumberOfCombinations(int n, int k) for computing k nC using following header: public static BigInteger getNumberOfCombinations(int n, int k) Write a test program that prompts the user to enter n and k and displays k nC as shown in the following sample run: Enter n: 4 Enter k: 2 The C(n, k) is 6 Enter n: 500 Enter k: 45 The C(n, k) is 30847877486165278042972675969000464272239600770627726467491808400 Line Editor Input a String from the user, then input a command to modify the line and finally output the resulting string after performing the command. The commands formats are Delete: d - Append: a Replace: r: The delete command removes all the characters from the start_index to the end_index (both integers) The first character in the string is start_index is 0. Verify that end_index is greater than the start_index. If the end_index is longer than the length of the string, use the length of the string, Examples Input String=”Rogers State University” d10-20 Output String→ Rogers Stity Input String=”Rogers State University” d5-11 Output String→ Rogete University Append command just adds the string following the letter a to the end of the current string Input String=”Rogers State University” a’s Hillcats Output String→ Rogers State University’s Hillcats Input String=”Rogers State University” a---Go Cats! Output String→ Rogers State University---Go Cats! The replace command matches every occurrence of the first string and replaces it with the second string. There may be multiple matches on one string. The string may contain a space so the separator between the strings is the colon (:) character. It is case sensitive Input String=”Rogers State University” rer:XXXX Output String→ RogXXXXs State UnivXXXXsity Input String=”Rogers State University” rER:XXXX Output String→ Rogers State University Input String=”Rogers State University” rUniversity:College Output String→ Rogers State College
Answered Same DayAug 31, 2021

Answer To: CS XXXXXXXXXXU03 HW Write two complete java programs to solve the following two problems. Zip up the...

Arun Shankar answered on Sep 04 2021
148 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here