Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import "fmt"
- func main() {
- var flourKg, flourPrice, sugarKg float64
- fmt.Scanln(&flourKg)
- fmt.Scanln(&flourPrice)
- fmt.Scanln(&sugarKg)
- var eggPack, yeast int
- fmt.Scanln(&eggPack)
- fmt.Scanln(&yeast)
- flourTotal := flourKg * flourPrice
- sugarTotal := flourKg * sugarKg * 0.75
- eggPackTotal := flourKg * float64(eggPack) * 1.10
- yeastTotal := flourKg * 0.75 * float64(yeast) * 0.20
- totalSum := flourTotal + sugarTotal + eggPackTotal + yeastTotal
- fmt.Printf("%.2f\n", totalSum)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement