[cs13001] Lab help

Mikhail Nesterenko mikhail at cs.kent.edu
Sun Oct 14 23:56:11 EDT 2012


> Professor,
> When doing Lab 7 check, how do you have the space
> 
> William Schmidt                       2/23/2010
> pay to:  Office Max                   $23.30
> twenty three and 30/100               dollars
> 
>                             above this
> 
> 
> to be perfectly in line? What would you use? How would you use it?

You compute the size of the longest string that goes on the
left. size() is the function to use. You then pad the three left
strings with appropriate numbero whitespace characters ' ' so that the
right strings line up. Padding can be done with insert() or append()

Thanks,
--
Mikhail


More information about the cs13001 mailing list