Diary File for Problem B.7. format compact, % The compact format will reduce the "white space" on the % output. % Prior to executing the next command, I need to…