Advertisement
Spocoman

Easter Bakery

Oct 7th, 2024
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.57 KB | None | 0 0
  1. package main
  2.  
  3. import "fmt"
  4.  
  5. func main() {
  6.     var flourKg, flourPrice, sugarKg float64
  7.     fmt.Scanln(&flourKg)
  8.     fmt.Scanln(&flourPrice)
  9.     fmt.Scanln(&sugarKg)
  10.    
  11.     var eggPack, yeast int
  12.     fmt.Scanln(&eggPack)
  13.     fmt.Scanln(&yeast)
  14.                
  15.     flourTotal := flourKg * flourPrice
  16.     sugarTotal := flourKg * sugarKg * 0.75
  17.     eggPackTotal := flourKg * float64(eggPack) * 1.10
  18.     yeastTotal := flourKg * 0.75 * float64(yeast) * 0.20
  19.     totalSum := flourTotal + sugarTotal + eggPackTotal + yeastTotal
  20.  
  21.     fmt.Printf("%.2f\n", totalSum)
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement