Advertisement
Spocoman

Christmas Preparation

Oct 4th, 2024
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.43 KB | None | 0 0
  1. package main
  2.  
  3. import "fmt"
  4.  
  5. func main() {
  6.     const paperPrice = 5.80
  7.     const clothPrice = 7.20
  8.     const gluePrice = 1.20
  9.    
  10.     var papers, cloths, glues, discount float64
  11.     fmt.Scanln(&papers)
  12.     fmt.Scanln(&cloths)
  13.     fmt.Scanln(&glues)
  14.     fmt.Scanln(&discount)
  15.    
  16.     totalPrice := (paperPrice * papers + clothPrice * cloths + gluePrice * glues) * (1.0 - discount / 100)
  17.  
  18.     fmt.Printf("%.3f\n", totalPrice)
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement