Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
#include <iostream>
#include <vector>
#include <string>
using namespace std;
//inherting the parent class and the child class as student and timetable in a tabular column
class SearchClass : student,timetable
{
String sname,stime,day;
public :
void search()
{
int i,j,k=0,q=0;
cout << "Enter your name:";
cin >> sname;
//using for loop condition to find the name as a search method
for(i=0;i<7;i++)
{
if(name[i]==sname)
{
k=1;
break;
}
}
if(k==1)
{
cout << "Enter the day :";
cin >> day;
if(day=="monday"||day=="Monday")
{
cout << "Enter the time in this format <hour><AM or PM>:";
cin >> stime;
for(j=0;j<7;j++)
{
if(stime==time[j])
{
q=1;
break;
}
}
if(q==1)
{
cout << "\n Subject | class | Room No. | time | faculty | Day ";
cout << "\n" << monday[class[i]][j] << "\t" << cl[class[i]] << "\t" << room_no[class[i]][j] << "\t" << time[j] << "\t" << faculty[class[i]][j] << "\t Monday";
}
else
cout << "\nTime Not Found ";
}
else if(day=="tuesday||day=="Tuesday")
{
cout << "Enter the time in this format <hour><AM or PM>:";
cin >> stime;
for(j=0;j<7;j++)
{
if(stime==time[j])
{
q=1;
break;
}
}
if(q==1)
{
cout << "\n Subject | class | Room No. | time | faculty | Day ";
cout << "\n" << tuesday[class[i]][j] << "\t" << cl[class[i]] << "\t" << room_no[class[i]][j] << "\t" << time[j] << "\t" << faculty[class[i]][j] << "\t Tuesday";
}
else
cout << "\nTime Not Found ";
}
else if(day=="wednesday||day=="Wednesday")
{
cout << "Enter the time in this format <hour><AM or PM>:";
cin >> stime;
for(j=0;j<7;j++)
{
if(stime==time[j])
{
q=1;
break;
}
}
if(q==1)
{
cout << "\n Subject | class | Room No. | time | faculty | Day ";
cout << "\n" << wednesday[class[i]][j] << "\t" << cl[class[i]] << "\t" << room_no[class[i]][j] << "\t" << time[j] << "\t" << faculty[class[i]][j] << "\t Wednesday";
}
else
cout << "\nTime Not Found ";
}
else if(day=="thursday"||day=="Thursday")
{
cout << "Enter the time in this format <hour><AM or PM>:";
cin >> stime;
for(j=0;j<7;j++)
{
if(stime==time[j])
{
q=1;
break;
}
}
if(q==1)
{
cout << "\n Subject | class | Room No. | time | faculty | Day ";
cout << "\n" << thursday[class[i]][j] << "\t" << cl[class[i]] << "\t" << room_no[class[i]][j] << "\t" << time[j] << "\t" << faculty[class[i]][j] << "\t thursday";
}
else
cout << "\nTime Not Found ";
}
else if(day=="friday"||day=="Friday")
{
cout << "Enter the time in this format <hour><AM or PM>:";
cin >> stime;
for(j=0;j<7;j++)
{
if(stime==time[j])
{
q=1;
break;
}
}
if(q==1)
{
cout << "\n Subject | class | Room No. | time | faculty | Day ";
cout << "\n" << friday[class[i]][j] << "\t" << cl[class[i]] << "\t" << room_no[class[i]][j] << "\t" << time[j] << "\t" << faculty[class[i]][j] << "\t Friday";
}
else
cout << "\nTime Not Found ";
}
else
cout << "\nTime Not Found ";
}
else
cout << "\nDay Not Found";
}
else
cout << "\nName Not Found";
}
};
//tabular datastructure to represent the class ,room no,faculty and the day
int main()
{
SeaarchClass a;
a.search();
return 0;
}