print-data
;;; computes, generates and displays the table
(defun print-data (list-of-counts)
(format t "digit frequency percent of total")
(let ((total (apply #'+ list-of-counts))
(write-to-string ; calculate field width
(reduce #'max list-of-counts)))))
;; generate and display the table
(let ((count (nth i list-of-counts)))
(format t "~% ~d ~vd ~5,2f%"
(* 100 (/ count total)))))))