Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main() {
- int startHours, checkHours, checkMinutes;
- cin >> startHours >> checkHours >> checkMinutes;
- string dayOfWeek;
- cin >> dayOfWeek;
- double bonusPoints = 0;
- if (checkHours < startHours && checkHours <= (startHours - 1)) {
- bonusPoints = 1.5;
- }
- else if (checkHours == startHours && checkMinutes <= 30) {
- bonusPoints = 1;
- }
- else if ((checkHours == startHours && checkMinutes > 30) || checkHours <= (startHours + 4)) {
- bonusPoints = 0.5;
- }
- if (dayOfWeek == "Monday" || dayOfWeek == "Wednesday" || dayOfWeek == "Friday") {
- bonusPoints += 0.6;
- }
- else if (dayOfWeek == "Tuesday" || dayOfWeek == "Thursday" || dayOfWeek == "Saturday") {
- bonusPoints += 0.8;
- }
- else {
- bonusPoints += 2;
- }
- printf("%.2f\n", bonusPoints);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement