Exercises & activities from the go workshop provided by Packt: https://courses.packtpub.com/courses/go
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

21 lines
301 B

package main
import "fmt"
func salesTax(cost float64, taxRate float64) float64 {
return cost * taxRate / 100
}
func main() {
taxTotal := 0.0
taxTotal = salesTax(0.99, 7.5)
taxTotal += salesTax(2.75, 1.5)
taxTotal += salesTax(0.87, 2.0)
fmt.Println("Sales Tax Total:", taxTotal)
}