4 * 3 * 2 * 1 = 24 This is called factorial.
Explanation
This is in preparation for writing a program to calculate the factorial of a user-provided number.
2 because if Abigail is first in line, then the 2nd student can be either Brent or Candy. Once a student is in the first spot, there are only 2 students left to choose from for the second spot.
1 because there is only 1 student left.
All 6 different ways are shown above.
All 24 different ways are shown above.
In 4! = 2 * 3 * 4 = 24, the 24 is a specific kind of product called a factorial.
3 because the student could be Abigail, Brent, or Candy.
The fundamental counting principal of probability tells us to multiply the numbers of ways for each spot. Let's look at another situation in which multiplication is the only one that will work.
In 4! = 2 * 3 * 4 = 24, the 2, 3, and 4 are called factors.
Sum = Sum + Number is used for accumulating a sum. The value in memory has the new number added to it and the new sum replaces the old sum in memory.
All of these are acceptable ways to show that 4! = 24.
You might have the concept correct but made a mispelling. I am not telling you the correct answer now though, because you will be putting this in your program.
Quiz Review Timeline (Updated): Jan 11, 2013 +
Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.