Skip to content
Permalink
Browse files
Update Timetable application
  • Loading branch information
iosipm committed Jul 4, 2021
1 parent bcae99e commit 2dba3132daca22a309fe4944c2b6d9d52b97b7fa
Showing 1 changed file with 76 additions and 15 deletions.
@@ -3,9 +3,12 @@
#include <string>
using namespace std;

//I have chosen to use arrays in order to create the timetable and also for loops.
//I have chosen to use arrays in order to create the timetable, I have used for loops to go through each element of the array and
////if statements to check them. I have also used the break statement in order to stop the loop iteration where needed.
////The switch statement was used as well because I had multiple conditions and I wanted to perform a different action based o the condition
// The user needs to enter an hour and a day and the program will tell them the class that is
//taking place during that time and day.taking
//taking place during that time and day
//

//As tutorials, I have watched youtube videos which I found very useful. FreeCodeCamp and CodeBeauty helped me understand
//the importance of the arrays and how powerful they can be
@@ -19,12 +22,51 @@ using namespace std;
int Time[8] = { 8,9,10,11,12,14,15,16 };
string Day[6] = { "Monday","Tuesday","Wednesday","Thursday","Friday","Saturday" };

string Monday[8] = { "Computer architecture","Mathematics","Software design","Activity LED project","Programming and algorithms","Add-Vantage Module","Object oriented programming","Database Systems" };
string Tuesday[8] = { "Introduction in Artificial intelligence","Mathematics","Software engineering","Theory of computation","Advanced algorithms","Operating systems and security","Big data programming project","Programming and algorithms" };
string Wednesday[8] = { "Data science","Big Data programming projects","Mathematics","Add-vantage module","Programming and algorithms","Object oriented programming","Professional training","Big data programming project" };
string Thursday[8] = { "Software design","Computer architecture","Mathematics","Introduction in artifial intelligence","Programming and algorithms","Add-Vantage module","Security","Machine learning and related applications" };
string Friday[8] = { "Object oriented programming","Software design","Mathematics","Add-vantage module","Programming and algorithms","French","Mobile applications development","Individual project preparation" };
string Saturday[8] = { "Computer architecture","Programming and algorithms","Mathematics","Object oriented programming","Database systems","Activity LED project","Professional training","Add-vantage module" };
string Monday[8] = { "Computer architecture",
"Mathematics",
"Software design",
"Activity LED project",
"Programming and algorithms",
"Add-Vantage Module",
"Object oriented programming",
"Database Systems" };
string Tuesday[8] = { "Introduction in Artificial intelligence",
"Mathematics",
"Software engineering",
"Theory of computation",
"Advanced algorithms",
"Operating systems and security",
"Big data programming project",
"Programming and algorithms" };
string Wednesday[8] = { "Data science",
"Big Data programming projects",
"Mathematics","Add-vantage module",
"Programming and algorithms",
"Object oriented programming",
"Professional training",
"Big data programming project" };
string Thursday[8] = { "Software design",
"Computer architecture",
"Mathematics",
"Introduction in artifial intelligence",
"Programming and algorithms",
"Add-Vantage module",
"Security",
"Machine learning and related applications" };
string Friday[8] = { "Object oriented programming",
"Software design","Mathematics",
"Add-vantage module",
"Programming and algorithms",
"Computer architecture","Mobile applications development",
"Individual project preparation" };
string Saturday[8] = { "Computer architecture",
"Programming and algorithms",
"Mathematics",
"Object oriented programming",
"Database systems",
"Activity LED project",
"Professional training",
"Add-vantage module" };

int main()
{
@@ -73,13 +115,32 @@ int main()

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 = "We couldn't find the day you selected"; break;
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 = "We couldn't find the day you selected";
break;
}

cout << activity << " " << next << '\n';

0 comments on commit 2dba313

Please sign in to comment.