Advertisement
Spocoman

04. Supplies for School

Sep 15th, 2024
24
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.47 KB | None | 0 0
  1. package main
  2. import "fmt"
  3.  
  4. func main() {
  5.     var penPrice = 5.80
  6.     var markerPrice = 7.20
  7.     var detergentPrice = 1.20
  8.    
  9.     var penCount, markerCount, detergentCount, discount float64
  10.     fmt.Scanln(&penCount)
  11.     fmt.Scanln(&markerCount)
  12.     fmt.Scanln(&detergentCount)
  13.     fmt.Scanln(&discount)
  14.  
  15.     var totalPrice = (1 - discount / 100) * (penCount * penPrice + markerCount * markerPrice + detergentCount * detergentPrice)
  16.    
  17.     fmt.Println(totalPrice)
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement