Advertisement
Spocoman

Savings

Oct 13th, 2024
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.38 KB | None | 0 0
  1. package main
  2.  
  3. import "fmt"
  4.  
  5. func main() {
  6.     var salary float64
  7.     fmt.Scanln(&salary)
  8.    
  9.     var months int
  10.     fmt.Scanln(&months)
  11.    
  12.     var minimalCosts float64
  13.     fmt.Scanln(&minimalCosts)
  14.    
  15.     monthlySavings := salary * 0.70 - minimalCosts
  16.  
  17.     fmt.Printf("She can save %.2f%%\n%.2f", monthlySavings / salary * 100, monthlySavings * float64(months))
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement