Question: Write two complete java programs to solve the following two problems. Make certain to document your code properly. 1)Combination Combinations in mathematics are the ways

Write two complete java programs to solve the following two problems. 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 Write two complete java programs to solve the following two problems. Make, nCk, or 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

Write a method named getNumberOfCombinations(int n, int k) for computing not matter. For example, there are 6 ways to pick 2 items 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 from a group of 4 items. In mathematics, the number of combinations 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=Ritgers State University

d10-20

OutputStringRitgers Stity

Input String=RitgersState University

d5-11

OutputStringRogete University

Append command just adds the string following the letter a to the end of the current string

Input String=Ritgers State University

as Hillcats

OutputStringRitgers State Universitys Hillcats

Input String=Ritgers State Universitya---Go Cats!

OutputStringRitgers 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=Ritgers State University

rer:XXXX

OutputStringRogXXXXs State UnivXXXXsity

Input String=Ritgers State University

rER:XXXXOutputStringRogers State University

Input String=Ritgers State UniversityrUniversity:College

OutputStringRitgers State College

n! Onk!n - k)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Sure Ill provide two Java programs for solving the given problems computing combinations and impleme... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!