1 - by the name, it appears that highCostMinutesUsed contains the number of high cost minutes that have been used by a caller over a number of calls. Other than that, I am sure the book must explain the purpose of this code.
2 - In the code, each time RecordCall is invoked with a call type of CallToCellPhone the highCostMinutesUsed variable increased by the number of minutes calculated for the purpose in the conditional block starting with "If (nMinutes > highCostMinutesToGo)"
3 - The initial value for highCostMinutesUsed is 0 when the class is instantiated.
4 - The line "(highCostMinutesUsed < 60) ? 60 - highCostMinutesUsed : 0;" uses a construct called a Conditional Operator, which is the question mark character: "?". It returns one of two values depending on the value of a Boolean expression. The Boolean expression is what comed before the question mark - and must resolve to true or false, the two values follow the question mark and are separated by the colon. If the boolean expression resolves to true, the first value is returned by the operator, and if it resolves to false, the second value is returned.expression of the following
5 - I don't know the purpose of the code beyond what the code is named: It changes some internal varialbs and returns a uint value as an operation named "RecordCall".
Woody Z
http://www.learntoprogramnow.com