Home Segments Index Top Previous Next

614: Practice

Revise the program shown in Segment 596 such that it accepts an additional flag, v, for verbose. If v is provided as a flag, the program is to perform as it does now. Otherwise, it is to suppress the full-sentence output and return numbers only: It returns a floating-point price if the p flag is provided, an integer number of shares if the n flag is provided, both numbers if both flags are provided, and nothing if neither flag is provided.