computing the maximum value for number of specific base consisting of digits this algorithm computes the maximum value of number for given number of digitse using the base system the maximum number we can have made up of digits is the number similarly the maximum number that consists of digits for base number is which is the expression by which we can compute this maximum value for digits isb in the previous expression is the number baseand is the number of digits as an example if we wanted to determine the maximum value for hexadecimal number (base consisting of digits the expression would be as follows the maximum value of the previous example would be represented as which yields in the following algorithm numberbase should be considered restricted to the values of and for this reason in our actual implementation numberbase has an enumeration type the base enumeration type is defined asbase {binary octal decimal hexadecimal the reason we provide the definition of base is to give you an idea how this algorithm can be modelled in more readable manner rather than using various checks to determine the correct base to use for our implementation we cast the value of numberbase to an integeras such we extract the value associated with the relevant option in the base enumeration as an example if we were to cast the option octal to an integer we would get the value in the algorithm listed below the cast is implicit so we just use the actual argument numberbase algorithm maxvalue(numberbasen prenumberbase is the number system to usen is the number of digits postthe maximum value for numberbase consisting of digits is computed return power(numberbasen- end maxvalue factorial of number attaining the factorial of number is primitive mathematical operation many implementations of the factorial algorithm are recursive as the problem is recursive in naturehowever here we present an iterative solution the iterative solution is presented because it too is trivial to implement and doesn' suffer from the use of recursion (for more on recursion see sscthe factorial of and is the aforementioned acts as base case that we will build upon the factorial of is the factorial of similarly the factorial of is the factorial of and so on we can indicate that we are after the factorial of number using the form where is the number we wish to attain the factorial of our algorithm doesn' use such notation but it is handy to know