Advertisement
Spocoman

Cat Training Attendance

Oct 4th, 2024
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.86 KB | None | 0 0
  1. package main
  2.  
  3. import "fmt"
  4.  
  5. func main() {
  6.     var startHours, checkHours, bonusPoints int
  7.     fmt.Scanln(&startHours)
  8.     fmt.Scanln(&checkHours)
  9.     fmt.Scanln(&checkMinutes)
  10.    
  11.     var dayOfWeek string
  12.     fmt.Scanln(&)
  13.  
  14.     if checkHours < startHours && checkHours <= (startHours - 1) {
  15.         bonusPoints = 1.5
  16.     } else if checkHours == startHours && checkMinutes <= 30 {
  17.         bonusPoints = 1
  18.     } else if (checkHours == startHours && checkMinutes > 30) || checkHours <= (startHours + 4) {
  19.         bonusPoints = 0.5
  20.     }
  21.  
  22.     if dayOfWeek == "Monday" || dayOfWeek == "Wednesday" || dayOfWeek == "Friday" {
  23.         bonusPoints += 0.6
  24.     } else if dayOfWeek == "Tuesday" || dayOfWeek == "Thursday" || dayOfWeek == "Saturday" {
  25.         bonusPoints += 0.8
  26.     } else {
  27.         bonusPoints += 2
  28.     }
  29.  
  30.     fmt.Printf("%.2f\n", bonusPoints)
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement