assign value to finalCost variable and print to console