Computer Science homework help

See attachment and please show detail of the caluclations.