Advertisement
Spocoman

Cat Training Attendance

Sep 16th, 2023
687
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.94 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7.     int startHours, checkHours, checkMinutes;
  8.     cin >> startHours >> checkHours >> checkMinutes;
  9.  
  10.     string dayOfWeek;
  11.     cin >> dayOfWeek;
  12.  
  13.     double bonusPoints = 0;
  14.  
  15.     if (checkHours < startHours && checkHours <= (startHours - 1)) {
  16.         bonusPoints = 1.5;
  17.     }
  18.     else if (checkHours == startHours && checkMinutes <= 30) {
  19.         bonusPoints = 1;
  20.     }
  21.     else if ((checkHours == startHours && checkMinutes > 30) || checkHours <= (startHours + 4)) {
  22.         bonusPoints = 0.5;
  23.     }
  24.  
  25.     if (dayOfWeek == "Monday" || dayOfWeek == "Wednesday" || dayOfWeek == "Friday") {
  26.         bonusPoints += 0.6;
  27.     }
  28.     else if (dayOfWeek == "Tuesday" || dayOfWeek == "Thursday" || dayOfWeek == "Saturday") {
  29.         bonusPoints += 0.8;
  30.     }
  31.     else {
  32.         bonusPoints += 2;
  33.     }
  34.        
  35.     printf("%.2f\n", bonusPoints);
  36.  
  37.     return 0;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement