[solved]-Write Program Calculate Permutations 98 Without 94 Repetition Repeats Combinations 95 With Q39068910
Java please

Write a program that will calculate permutations with (9.8) and without (9.4) repetition (repeats) and combinations with (9.5) and without (9.5) repetition (repeats) for user provided n and r values. Program Requirements: Prompt the user for the ‘n’ and ‘r’ values then calculate and display the four values using the following formulas: Permutations: • P(n,r) with repeats = n” . P(n,r) without repeats = (-)! Combinations: ·C(n,r) with repeats = – (ntr-1)! r!((n+r-1)-r)! C(n.r) without repeats = Sr!(n-1)! Output the answers for P(n,r) and C(n,r) with repeats and without repeats For example: Enter a value for n: 7 Enter a value for r: 4 Permutation: P(7,4) w/repeats: 2401 P(7,4) w/o repeats: 840 Combination: C(7,4) w/repeats: 210 C(7,4) w/o repeats: 35 Additional Requirements: • you can use built-in math functions like pow() or factorial but NOT functions like perm() or comb()<if they exist> . when entering n and r, care should be taken with values above 8. . Try to figure out why and how to work around it. . nr is acceptable but n<ris not possible. • Label each output answer so the user know what calculation it represents Show transcribed image text Write a program that will calculate permutations with (9.8) and without (9.4) repetition (repeats) and combinations with (9.5) and without (9.5) repetition (repeats) for user provided n and r values. Program Requirements: Prompt the user for the ‘n’ and ‘r’ values then calculate and display the four values using the following formulas: Permutations: • P(n,r) with repeats = n” . P(n,r) without repeats = (-)! Combinations: ·C(n,r) with repeats = – (ntr-1)! r!((n+r-1)-r)! C(n.r) without repeats = Sr!(n-1)! Output the answers for P(n,r) and C(n,r) with repeats and without repeats For example: Enter a value for n: 7 Enter a value for r: 4 Permutation: P(7,4) w/repeats: 2401 P(7,4) w/o repeats: 840 Combination: C(7,4) w/repeats: 210 C(7,4) w/o repeats: 35 Additional Requirements: • you can use built-in math functions like pow() or factorial but NOT functions like perm() or comb() . when entering n and r, care should be taken with values above 8. . Try to figure out why and how to work around it. . nr is acceptable but n
Expert Answer
Answer to Write a program that will calculate permutations with (9.8) and without (9.4) repetition (repeats) and combinations with… . . .
OR

