Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import "fmt"
- func main() {
- const paperPrice = 5.80
- const clothPrice = 7.20
- const gluePrice = 1.20
- var papers, cloths, glues, discount float64
- fmt.Scanln(&papers)
- fmt.Scanln(&cloths)
- fmt.Scanln(&glues)
- fmt.Scanln(&discount)
- totalPrice := (paperPrice * papers + clothPrice * cloths + gluePrice * glues) * (1.0 - discount / 100)
- fmt.Printf("%.3f\n", totalPrice)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement