Permalink
Cannot retrieve contributors at this time
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?
Resit/something.cpp
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
51 lines (41 sloc)
1.13 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "database.h" | |
using namespace std; | |
int main(){ | |
int Lect_id,stu_id; | |
string Lect_name,name,class1,b; | |
cout<< "enter lecturer name"<<endl; | |
cin>>Lect_name; | |
Lect_id: cout<< "enter lecturer id"<<endl; | |
Lect_id=0; | |
cin>>Lect_id; | |
if (Lect_id>9999999){ | |
cout<<"Enter valid Lecturer ID"<<endl; | |
goto Lect_id; | |
} | |
else{ | |
cout<<"Lecturer ID accepted"<<endl; | |
UploadLecturer(Lect_id, Lect_name); | |
} | |
lect:cout<<"Do you want have a look at the lecturers' list? (y/n)"<<endl; | |
cin>>b; | |
if (b=="y" || b== "Y"){ | |
printLecturers(); | |
} | |
else if (b=="n" || b=="N"){ | |
cout<< "okay"<<endl; | |
cout<< "enter student name"<<endl; | |
cin>>name; | |
cout<< "enter student id"<<endl; | |
cin>>stu_id; | |
cout<< "enter class code"<<endl; | |
cin>> class1; | |
UploadStudent(stu_id, name, class1); | |
printStudents(); | |
} | |
else{ | |
cout<< "enter a valid input"<<endl; | |
goto lect; | |
} | |
return 1; | |
// I tried writing in more code, but it isnt working perfectly | |
} |