module vat_module contains real function vat(rate,x) implicit none real, intent(in)::rate, x vat = rate/100*x end function vat end module vat_module program ch1207a use vat_module implicit none real:: cost, total_cost, vat_rate print*,'input current vat rate' read*,vat_rate print*,'input base cost of item' read*,cost total_cost = cost + vat(vat_rate,cost) write(*,100)total_cost 100 format('total cost inc. vat = ',f6.2,' pounds') end program ch1207a