Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import "fmt"
- func main() {
- var strawberriesPrice, bananasKg, orangesKg, raspberriesKg, strawberriesKg float64
- fmt.Scanln(&strawberriesPrice)
- fmt.Scanln(&bananasKg)
- fmt.Scanln(&orangesKg)
- fmt.Scanln(&raspberriesKg)
- fmt.Scanln(&strawberriesKg)
- raspberriesPrice := strawberriesPrice / 2
- orangesPrice := raspberriesPrice * 0.60
- bananasPrice := raspberriesPrice / 5
- totalSum := strawberriesPrice * strawberriesKg + bananasPrice * bananasKg + orangesPrice * orangesKg + raspberriesPrice * raspberriesKg
- fmt.Printf("%.2f", totalSum)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement