Program a calculator function that allows you to calculate the four basic counting techniques. Your calculator function
Question:
Program a calculator function that allows you to calculate the four basic counting techniques.
Your calculator function should accept four inputs: the number of objects from which to choose (typically denoted n), the number of objects being chosen (typically denoted k), whether sampling is to be done with replacement, and whether the order of the sampling matters.
You may not use package functions that do the calculations directly, but you may use such things as a prebuilt factorial function.
Once you have built your calculator, run four test cases (one for each of the four counting techniques) and comment on whether the result is correct. (You need not make up a story. Just supply the numbers.)
Java An Introduction To Problem Solving And Programming
ISBN: 9780134462035
8th Edition
Authors: Walter Savitch