PPT Slide
Solution with Separate Class for Partition Elements
public class PartitionInteger
/* The class PartitionInteger has no data elements and one method. It is intended
to extend the set of available operations on ints to include partitioning of one
integer into factors of another integer and a balance. The method of this class,
factor_and_balance, would naturally be defined as a method of the Class Integer. */
/* The method factor_and_balance of class PartitionInteger partitions any
positive one or two digit integer into two integers, the number instances of
another integer and the integer remaining after subtraction of the instances
of contained integer. The inputs are the integer to be partially factored and the
factor.The number of instances of the factor is returned in int result[0] and
the remainer is returned in int result[1]. */