#include <iostream>
#include <string>
using namespace std;
int Time[8] = { 8,9,10,11,12,2,3,4 };
string Day[6] = { "Monday","Tuesday","Wednesday","Thursday","Friday","Saturday" };
string Monday[8] = { "Physics","Chemistry","Maths","English","Programming","French","ECA","Reference" };
string Tuesday[8] = { "English","Maths","Chemistry","Physics","Reference","French","ECA","Programming" };
string Wednesday[8] = { "Physics","ECA","Maths","English","Programming","French","Chemistry","Reference" };
string Thursday[8] = { "Chemistry","Physics","Maths","English","Programming","Reference","ECA","French" };
string Friday[8] = { "Reference","Chemistry","Maths","English","Programming","French","ECA","Physics" };
string Saturday[8] = { "Physics","Programming","Maths","English","Chemistry","French","ECA","Reference" };
int time(int var1);
int main()
{
int time;
string day;
cout << "Enter the Time" << endl;
cin >> time;
cout << "Enter the day";
cin >> day;
bool foundday = false;
bool foundtime = false;
int timesub = 0;
int daysub = 0;
for (timesub = 0; timesub < 8; timesub++)
{
if (Time[timesub] == time)
{
foundtime = true;
break;
}
}
for (daysub = 0; daysub < 6; daysub++)
{
if (Day[daysub] == day)
{
foundday = true;
break;
}
}
if (!foundday || !foundtime)
{
cout << "no activity found for that time and day\n";
return 0;
}
string activity;
string next;
switch (daysub)
{
case 0: activity = Monday [timesub]; if (timesub < 7) next = Monday [timesub+1]; break;
case 1: activity = Tuesday [timesub]; if (timesub < 7) next = Tuesday [timesub+1]; break;
case 2: activity = Wednesday[timesub]; if (timesub < 7) next = Wednesday[timesub+1]; break;
case 3: activity = Thursday [timesub]; if (timesub < 7) next = Thursday [timesub+1]; break;
case 4: activity = Friday [timesub]; if (timesub < 7) next = Friday [timesub+1]; break;
case 5: activity = Saturday [timesub]; if (timesub < 7) next = Saturday [timesub+1]; break;
default: activity = "Day Not found"; break;
}
cout << activity << " " << next << '\n';
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IFRpbWVbOF0gPSB7IDgsOSwxMCwxMSwxMiw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GRheTsKCiAgICBjb3V0IDw8ICJFbnRlciB0aGUgVGltZSIgPDwgZW5kbDsKICAgIGNpbiAgPj4gdGltZTsKCiAgICBjb3V0IDw8ICJFbnRlciB0aGUgZGF5IjsKICAgIGNpbiAgPj4gZGF5OwoKCiAgICBib29sIGZvdW5kZGF5ID0gZmFsc2U7CiAgICBib29sIGZvdW5kdGltZSA9IGZhbHNlOwogICAgaW50IHRpbWVzdWIgPSAwOwogICAgaW50IGRheXN1YiAgPSAwOwoKICAgIGZvciAodGltZXN1YiA9IDA7IHRpbWVzdWIgPCA4OyB0aW1lc3ViKyspCiAgICB7CiAgICAgICAgaWYgKFRpbWVbdGltZXN1Yl0gPT0gdGltZSkKICAgICAgICB7CiAgICAgICAgICAgIGZvdW5kdGltZSA9IHRydWU7CiAgICAgICAgICAgIGJyZWFrOwogICAgICAgIH0KICAgIH0KCiAgICBmb3IgKGRheXN1YiA9IDA7IGRheXN1YiA8IDY7IGRheXN1YisrKQogICAgewogICAgICAgIGlmIChEYXlbZGF5c3ViXSA9PSBkYXkpCiAgICAgICAgewogICAgICAgICAgICBmb3VuZGRheSA9IHRydWU7CiAgICAgICAgICAgIGJyZWFrOwogICAgICAgIH0KICAgIH0KCiAgICBpZiAoIWZvdW5kZGF5IHx8ICFmb3VuZHRpbWUpCiAgICB7CiAgICAgICAgY291dCA8PCAibm8gYWN0aXZpdHkgZm91bmQgZm9yIHRoYXQgdGltZSBhbmQgZGF5XG4iOwogICAgICAgIHJldHVybiAwOwogICAgfQoKICAgIHN0cmluZyBhY3Rpdml0eTsKICAgIHN0cmluZyBuZXh0OwoKICAgIHN3aXRjaCAoZGF5c3ViKQogICAgewogICAgICAgIGNhc2UgMDogYWN0aXZpdHkgPSBNb25kYXkgICBbdGltZXN1Yl07IGlmICh0aW1lc3ViIDwgNykgbmV4dCA9IE1vbmRheSAgIFt0aW1lc3ViKzFdOyBicmVhazsKICAgICAgICBjYXNlIDE6IGFjdGl2aXR5ID0gVHVlc2RheSAgW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