1

I'm beginner of c++, no knowledge on c++. I'm writing a code for student and module. The requirement is need to displayed the module and the student with final score, also the duplication. When I write the case 5 and case 6, after compile it show the error below.

error C2360: initialization of 'code' is skipped by 'case' label see declaration of 'code' error C2361: initialization of 'code' is skipped by 'default' label see declaration of 'code'

error C2039: 'getId' : is not a member of 'std::vector<_Ty>' with[_Ty=Student]

error C2039: 'getModule' : is not a member of 'std::vector<_Ty>' with[_Ty=Student]

Main.cpp

#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <sstream>
#include <algorithm>
#include <cmath>
#include <vector>
#include "Student.h"
#include "Module.h"
using namespace std;

void printMenu();
vector<Student> readFile();
void liststudentRecord(vector<Student>);
string trim(string);
bool isValidClasscode(string s);
bool isvalidStudentid(string s);
bool test1Ascending(Student s1, Student s2);
bool test1Desscending(Student s1, Student s2);
bool test1finalScoreAscending(Student s1, Student s2);
vector<Module> readFile2();
void listmoduleRecord(vector<Module>);
bool moduleName (Module m1, Module m2);
vector<Student> getStudentByModule(vector<Student>,string);
bool isDuplicateStudentRecord(vector<Student>, Student);


//gloval variable
vector<Student> duplicates;

int main() {

    int choice;
    vector<Student> students;//list of student
    vector<Module> modules;
    vector<Student> list;


    do {
        printMenu();
        cin >> choice;

        switch(choice) {
        case 1: 
            cout << "Read Student file ... " << endl; 
            students =readFile();
            cout<<"Number of records read: " <<students.size() <<endl;
            break;
        case 2:
             liststudentRecord(students);
             break;
        case 3: 
            cout << "Read Module file ... " << endl; 
            modules =readFile2();
            cout<<"Number of records read: " <<modules.size() <<endl;
            break;
        case 4:
            listmoduleRecord(modules);
            break;

        case 5:
            liststudentRecord(duplicates);
            break;
        case 6:
            cout << "Enter Module Code: ";
            string code;
            cin >> code;
            list = getStudentByModule(students, code);
            for (int i=0; i < list.size(); i++ ){
                Student s = list.at(i);
                cout << s.toString() << endl;
            }
            cout<<"List Student by Module Code"<<endl;
            break;
        case 7:
            //http://www.cplusplus.com/reference/algorithm/sort/
            //sort(students.begin(), students.end(), test1finalScoreAscending);
            sort(students.begin(), students.end(),test1finalScoreAscending); //finalScoreAcending
            break;
        case 8:
            break;
        case 9: cout << "Exiting program... " << endl; break;
        default: 
            cout << "Invalid option specified. Please try again" << endl;
        }
    } while(choice != 9);

    return 0;
}

void printMenu() {
    cout << "Menu" << endl;
    cout << "----" << endl;
    cout << "[1] Read student file" << endl;
    cout << "[2] List student records" << endl;
    cout << "[3] Read module file" << endl;
    cout << "[4] List module records" << endl;
    cout << "[5] List Duplicate Record" << endl;
    cout << "[6] Display Student by Module" << endl;
    cout << "[7] Sort by Final Score" <<endl;
    cout << "[8] Write to file" << endl;
    cout << "[9] Exit" << endl;
    cout << "Choice: ";
}

vector<Student>readFile(){
    vector<Student>students;
    string filename;
    ifstream inputFile;

    cout << "Enter filename: ";
    cin >> filename;

    inputFile.open(filename, ios::in);//open file, read only
    if(inputFile.is_open()){
        while (inputFile.good()){
            string line;
            getline(inputFile, line);

            Student s; //create a new student

            //extract id
            int i = line.find(",");
            string id = trim(line.substr(0, i));// extract id
            s.setId(id); // set student id
            line = line.substr(i+1);// remove id form line
            /*if(isvalidStudentid(id)){
                string s = id.substr(0,1);
                const char* s = id.substr(1,7);
            }*/

            //extract name
            i = line.find(","); 
            string name = trim(line.substr(0, i)); // extract name
            s.setName(name); //set student name
            line = line.substr(i+1); //remove name from line

            //extract classcode
            i = line.find(",");
            string classcode = trim(line.substr(0, i));
            s.setClasscode(classcode);
            line = line.substr(i+1);
            if(isValidClasscode(classcode)){
                string module = classcode.substr(0,6);
                s.setModule(module);
                string status =  classcode.substr(7,9);
                char *ft ="FT";
                if(status.compare(ft)==0){
                    s.setFulltime(true);
                }else{
                    s.setFulltime(false);
                }
                string classnumber = classcode.substr(9,11);
                s.setClassnumber(classnumber);
            }


            //to use a for-loop for attendance
            for (int j =0; j < 10 ; j++){
                i = line.find(",");
                string attendance = trim(line.substr(0, i));
                s.setAttendance(j, attendance);
                line = line.substr(i+1);
            }

            //to extreact test1
            i = line.find(",");
            int test1 = stoi(line.substr(0, i));
            s.setTest1(test1);
            line = line.substr(i+1);

            //to extreact test2
            i = line.find(",");
            int test2 = stoi(line.substr(0, i));
            s.setTest2(test2);
            line = line.substr(i+1);


            //to extreact tutorial
            i = line.find(",");
            int tutorial = stoi(line.substr(0, i));
            s.setTutorial(tutorial);
            line = line.substr(i+1);

            //to extreact exam
            i = line.find(",");
            int exam = stoi(line.substr(0, i));
            s.setExam(exam);
            line = line.substr(i+1);


            //need to do validationfirst
            //to only add the valid student

            if(isDuplicateStudentRecord(students, s) == false){
            students.push_back(s); //add student to list
            } else {
                duplicates.push_back(s);
            }
            //cout<< line << endl;
        }
        inputFile.close();
    }else{
        cout << "Invalid file" << endl;
    }

    return students;
}

void liststudentRecord(vector<Student> list){
    int numberStudents = list.size();

    if (numberStudents > 0){
        for (int i = 0; i < numberStudents; i++){
            Student s = list.at(i);
            cout << s.toString() << endl;
        }
    }else{
            cout << "Empty list" <<endl;

        }
}

bool test1Ascending(Student s1, Student s2){
    return s1.getTest1() < s2.getTest1();
}

bool test1Descending(Student s1, Student s2){
    return s1.getTest1() < s2.getTest1();
}

bool finalScoreAscending(Student s1, Student s2){
    return s1.getFinalScore() < s2.getFinalScore();
}

bool isvalidStudentid(string s){
    int i;

    if(s.length() !=8){
        return false;} //first check th length is 8

    if (s.at(i) != 'S') {
        return false;} //start with s

    for (i =1 ; i<8; i++){ //7 digit 
        if(isdigit(s.at(i))==0){

            return false;
        }
    }

    return false;
}

bool isValidClasscode(string s){
    int i;

    if(s.length() !=11){
    return false;} //first check th length is 8


    for (i =0 ; i<3; i++){ // first 3 char are letters
        if(isalpha(s.at(i))==0){
        return false;}
    }

    for (i =3 ; i<6; i++){ //next 3 char are number
        if(isdigit(s.at(i)) == 0){
        return false;}

    }
        if (s.at(6) != '-') {
        return false;} //has a hyphen

        if (s.at(7) != 'F' && s.at(7) != 'P') {
        return false;}

        if (s.at(8) != 'T' ) {
        return false;} // T

        if (isdigit(s.at(9)) == 0 || isdigit(s.at(10)) == 0){
        return false;}


    return false;
}

vector<Module> readFile2(){
    vector<Module>modules;
    string filename;
    ifstream inputFile;

    cout << "Enter filename: ";
    cin >> filename;

    inputFile.open(filename, ios::in);//open file, read only
    if(inputFile.is_open()){
        while (inputFile.good()){
            string line;
            getline(inputFile, line);

            Module m; //create a new student

            //extract name
            int i = line.find(",");
            string modulecode = trim(line.substr(0, i));// extract id
            m.setModulecode(modulecode); // set student id
            //cout << id<< endl;
            line = line.substr(i+1);// remove id form line
            //cout << line << endl;

            //extract id
            i = line.find(","); 
            string modulename = trim(line.substr(0, i)); // extract name
            m.setModulename(modulename); //set student name
            line = line.substr(i+1); //remove name from line



            //to extreact test1
            i = line.find(",");
            int test1 = stoi(line.substr(0, i));
            m.setTest1(test1);
            line = line.substr(i+1);

            //to extreact test2
            i = line.find(",");
            int test2 = stoi(line.substr(0, i));
            m.setTest2(test2);
            line = line.substr(i+1);


            //to extreact tutorial
            i = line.find(",");
            int tutorial = stoi(line.substr(0, i));
            m.setTutorial(tutorial);
            line = line.substr(i+1);

            //to extreact exam
            i = line.find(",");
            int exam = stoi(line.substr(0, i));
            m.setExam(exam);
            line = line.substr(i+1);

            modules.push_back(m); //add student to list

            //cout<< line << endl;
        }
        inputFile.close();
    }else{
        cout << "Invalid file" << endl;
    }

    return modules;

}

void listmoduleRecord(vector<Module> list){
    int numberModules = list.size();

    if (numberModules > 0){
        for (int i = 0; i < list.size(); i++){
            Module m = list.at(i);
            cout << m.toString() << endl;
        }
    }else{
            cout << "Empty list" <<endl;

        }
}

vector<Student> getStudentByModule(vector<Student> students,string code){
    vector<Student> list;
    for (int i=0; i< students.size(); i++){
        Student s = students.at(i);
        if (code.compare(current_module) == 0){
            list.push_back(s);
        }
    }
    return list;
}



bool isDuplicateStudentRecord(vector<Student> student, Student s){
    string id = student.getId();
    string name = student.getName();
    string module = student.getModule();
    for(int i=0; i< student.size(); i++){
        Student  s = student.at(i);
        string current_id = s.getId();
        string current_name =  s.getName();
        string current_module = s.getModule();
        if(id.compare)(current_id) == 0 &&
            name.compare(current_name) == 0 &&
            (module.compare(current_module) == 0);{
            return true;
        }
    }
    return false;
}


//http://stackoverflow.com/a/6500499/3839235
string trim(string s){
    s.erase(0, s.find_first_not_of(' ')); //prefixing spaces
    s.erase(s.find_last_not_of(' ')+1); //surfixing spaces
    return s;
}

Module.cpp

#include "Module.h"
#include <sstream>
using namespace std;

Module::Module(void){
}


    string Module:: getModulecode(){
        return modulecode;
    }

    void Module::setModulecode(string modulecode){
        this->modulecode = modulecode;
    }

    string Module:: getModulename(){
        return modulename;
    }

    void Module:: setModulename(string modulename){
        this->modulename = modulename;
    }

    int Module:: getTest1(){
        return test1;
    }
    void Module:: setTest1(int value1){
        test1 =  value1;
    }

    int Module:: getTest2(){
        return test2;
    }
    void Module:: setTest2(int value2){
        test2 =  value2;
    }

    int Module:: getTutorial(){
        return tutorial;
    }
    void Module:: setTutorial(int value3){
        tutorial = value3;
    }

    int Module:: getExam(){
        return exam;
    }
    void Module:: setExam(int value4){
        exam = value4;
    }


    string Module::toString(){
        stringstream ss;

        ss<<"Module Code: " << modulecode<< "-"<< modulename <<endl;
        ss << "Test 1: " << getTest1Percentage() << "%" << endl;
        ss << "Test 2: " << getTest2Percentage() << "%" << endl;
        ss << "Tutorial: " << getTutorialPercentage() << "%" << endl;
        ss << "Exam: " << getExamPercentage() << "%" << endl;
        //ss<< "Score percentage: " << getScorePercentage() << "%"<< endl;
        ss<< "Final score: " << getFinalScore() << "%" <<endl;
        return ss.str();
    }

    int Module::getTest1Percentage(){
        int result;
        result =  (getTest1() * 100) / 100;
        return result;
    }

    int Module::getTest2Percentage(){
        int result;
        result =  (getTest2() * 100) / 100;
        return result;
    }

    int Module::getTutorialPercentage(){
        int result;
        result =  (getTutorial() * 100) / 100;
        return result;
    }

    int Module::getExamPercentage(){
        int result;
        result =  (getExam() * 100) / 100;
        return result;
    }

    int  Module::getFinalScore(){
        int final = getTest1Percentage()+getTest2Percentage()+getTutorialPercentage()+getExamPercentage();
        return final;
    }


    /*int  Module::getFinalScore(){
        int final = test1+test2+tutorial+exam;
        return final;
    }*/

Student.cpp

#include "Student.h"
#include <sstream>
using namespace std;

Student::Student(void){
}


    string Student:: getId(){
        return id;
    }
    void Student:: setId(string newid){
        id = newid;
    }

    string Student:: getName(){
        return name;
    }
    void Student:: setName(string name){
        this->name = name;
    }

    string Student:: getClasscode(){
        return classcode;
    }
    void Student::setClasscode(string classcode){
        this->classcode = classcode;
    }

    string Student:: getAttendance(int i){
        return attendance[i];
    }
    void Student:: setAttendance(int i, string value){
        attendance[i] = value;
    }

    int Student:: getTest1(){
        return test1;
    }
    void Student:: setTest1(int value1){
        test1 =  value1;
    }

    int Student:: getTest2(){
        return test2;
    }
    void Student:: setTest2(int value2){
        test2 =  value2;
    }

    int Student:: getTutorial(){
        return tutorial;
    }
    void Student:: setTutorial(int value3){
        tutorial = value3;
    }

    int Student:: getExam(){
        return exam;
    }
    void Student:: setExam(int value4){
        exam = value4;
    }


    string Student::toString(){
        stringstream ss;

        ss << name << "(" <<id  << ")" << endl;
        ss << classcode << endl;
        for(int  i=0; i<10; i++){
            ss << getAttendance(i) << " ";
        }
        ss << endl;
        ss << "Test 1: " << test1 << endl;
        ss << "Test 2: " << test2 << endl;
        ss << "Tutorial: " << tutorial << endl;
        ss << "Exam: " << exam << endl;
        ss<< "Attendance percentage: " << getAttendancePercentage() << "%"<< endl;
        ss<< "Final score: " << getFinalScore() <<endl;
        return ss.str();
    }


    double Student::getAttendancePercentage(){
        int n =0 ; // n will be the total number of "yes"
        for (int i=1; i<10; i++){
            string s = getAttendance(i);
            char*yes = "yes";
            if(s.compare(yes)== 0){
                n++;
            }
        }
        double percentage = n/10.0 * 100; //avoud interger division
        return percentage;
    }


    int  Student::getFinalScore(){
        int final = test1+test2+tutorial+exam;
        return final;
    }

    /*string Student::getModule() { return module; }
    void Student::setModule(string m) { module = m;}
    bool Student::getFulltime() { return fulltime; }
    void Student::setFulltime(bool v) { fulltime = v;}
    string Student::getClassnumber() { return classnumber; }
    void Student::setClassnumber(string v) { classnumber = v;} */


    string Student:: getModule(){
        return module;
    }
    void Student:: setModule(string m){
        module =m;
    }

    bool Student:: getFulltime(){
        return fulltime;
    }
    void Student:: setFulltime(bool v){
        fulltime = v;
    }

    string Student:: getClassnumber(){
        return classnumber;
    }

    void Student:: setClassnumber(string c){
        classnumber = c;
    } 

Module.h

#ifndef MODULE_H
#define MODULE_H

#include <string>
using namespace std;

class Module {

public:
    Module();

    string getModulecode();
    void setModulecode(string);

    string getModulename();
    void setModulename(string);

    int getTest1();
    void setTest1(int);

    int getTest2();
    void setTest2(int);

    int getTutorial();
    void setTutorial(int);

    int getExam();
    void setExam(int);

    string toString(); //to displayed info
    int getTest1Percentage();
    int getTest2Percentage();
    int getTutorialPercentage();
    int getExamPercentage();

    int getFinalScore();

private:
    string modulecode;
    string modulename;
    int test1;
    int test2;
    int tutorial;
    int exam;

};


#endif //MODULE_H

Student.h

#ifndef STUDENT_H
#define STUDENT_H

#include <string>
using namespace std;

class Student {
//methods
public:
    Student();

    string getId();
    string getName();
    string getClasscode();
    string getAttendance(int);
    int getTest1();
    int getTest2();
    int getTutorial();
    int getExam();

    void setId(string);
    void setName(string);
    void setClasscode(string);
    void setAttendance(int, string);
    void setTest1(int);
    void setTest2(int);
    void setTutorial(int);
    void setExam(int);

    string toString(); //to displayed info
    double getAttendancePercentage();

    int getFinalScore();

    string getModule();
    void setModule(string);

    bool getFulltime();
    void setFulltime(bool);

    string getClassnumber();
    void setClassnumber(string);
    //to create the get and set methods for all the attributes


//attribute
private:
    string id;
    string name;
    string classcode;
    string module;
    bool fulltime;
    string classnumber;
    string attendance[10];
    int test1;
    int test2;
    int tutorial;
    int exam;
};

#endif //STUDENT_Hs

3 Answers3

2

It seems from the first error that you mentioned, that your compiler is complaining about the creation of your string variable 'code' inside of case 6. Try moving the creation of the variable to where you make the others above. This should fix the first error that you got.

As for the second and third error it is telling you that the functions 'getId' and 'getModule' are functions from your 'module' class, meaning that you can only call them on instances of the 'module' class. However, you are trying to call them on a vector of student objects.

CR7
  • 21
  • 2
  • Both of the last two error can be solved by removing the code. `id`, `module`, and `name` aren't used, so no point fixing the code that gets them. – user4581301 Dec 08 '16 at 02:24
1

It's a bad idea to declare a variable within a switch statement:

switch(i) {
case 1:
  int foo = 42;
  doSomething(foo);
  break;
case 2:
  // aargh `foo` is in scope but uninitialised if we jump to here
  ...
}

To fix this, either bring int foo outside the switch statement, or put it in a local scope within the switch statement:

switch(i) {
case 1:
  {
    int foo = 42;
    doSomething(foo);
  } // foo is destroyed
  break;
case 2:
  // there is no foo, there is no problem
  ...
}

With that change made, I've put your code through clang-format and an online Clang compiler, because Clang has lovely error messages. Here's what Clang has to say:

prog.cc:69:27: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare]
        for (int i = 0; i < list.size(); i++) {
                        ~ ^ ~~~~~~~~~~~
prog.cc:151:20: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
        char *ft = "FT";
                   ^
prog.cc:243:12: warning: variable 'i' is uninitialized when used here [-Wuninitialized]
  if (s.at(i) != 'S') {
           ^
prog.cc:237:8: note: initialize the variable 'i' to silence this warning
  int i;
       ^
        = 0
prog.cc:364:23: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare]
    for (int i = 0; i < list.size(); i++) {
                    ~ ^ ~~~~~~~~~~~
prog.cc:377:22: error: use of undeclared identifier 'current_module'
    if (code.compare(current_module) == 0) {
                     ^
prog.cc:375:21: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare]
  for (int i = 0; i < students.size(); i++) {
                  ~ ^ ~~~~~~~~~~~~~~~
prog.cc:385:23: error: no member named 'getId' in 'std::__1::vector<Student, std::__1::allocator<Student> >'
  string id = student.getId();
              ~~~~~~~ ^
prog.cc:386:25: error: no member named 'getName' in 'std::__1::vector<Student, std::__1::allocator<Student> >'
  string name = student.getName();
                ~~~~~~~ ^
prog.cc:387:27: error: no member named 'getModule' in 'std::__1::vector<Student, std::__1::allocator<Student> >'
  string module = student.getModule();
                  ~~~~~~~ ^
prog.cc:393:12: error: reference to non-static member function must be called
    if (id.compare)
        ~~~^~~~~~~

    ( snipped: a lot of suggestions for what you might have meant instead )

prog.cc:394:20: error: invalid operands to binary expression ('string' (aka 'basic_string<char, char_traits<char>, allocator<char> >') and 'int')
      (current_id) == 0 && name.compare(current_name) == 0 &&
      ~~~~~~~~~~~~ ^  ~
prog.cc:384:64: warning: unused parameter 's' [-Wunused-parameter]
bool isDuplicateStudentRecord(vector<Student> student, Student s) {
                                                               ^
prog.cc:388:21: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare]
  for (int i = 0; i < student.size(); i++) {
                  ~ ^ ~~~~~~~~~~~~~~
7 warnings and 6 errors generated.

Of these, some are minor (but worth fixing, e.g. for(size_t i = 0... instead of int), but the ones marked 'error' are more critical. It's generally good practice to set the compiler to warn about everything and then to make all the warnings go away.

You can see the code (with the extra braces in switch and all clang-formatted in LLVM style) in an online Clang compiler here: http://melpon.org/wandbox/permlink/qLnE80Hs6FJWl9Fy

The student.getID() errors arise because in this function:

bool isDuplicateStudentRecord(vector<Student> student, Student s) {
  string id = student.getId();
  string name = student.getName();
  string module = student.getModule();
  ...

you're trying to getID() on a vector<Student> not on a Student. Did you mean string id = s.getID();?

Jack Deeth
  • 3,062
  • 3
  • 24
  • 39
  • Hi Jack, I did make some changes here. Please help look into the error. http://melpon.org/wandbox/permlink/qLnE80Hs6FJWl9Fy – Ryan Choong Dec 08 '16 at 03:51
1

After the changes.

case 6:{
            cout << "Enter Module Code: ";
            string code;
            cin >> code;
            list = getStudentByModule(students, code);
            for (int i=0; i < list.size(); i++ ){
                Student s = list.at(i);
                cout << s.toString() << endl;
            }
            cout<<"List Student by Module Code"<<endl;
            break;
               }

vector<Student> getStudentByModule(vector<Student> students,string code){
    vector<Student> list;
    for (int i=0; i< students.size(); i++){
        Student s = students.at(i);
        if (code.compare(current_module) == 0){
            list.push_back(s);
        }
    }
    return list;
}

duplicates

bool isDuplicateStudentRecord(vector<Student> student, Student s){
    string id = s.getId();
    string name = s.getName();
    string module = s.getModule();
    for(int i=0; i< student.size(); i++){
        Student  s = student.at(i);
        string current_id = s.getId();
        string current_name =  s.getName();
        string current_module = s.getModule();
        if(id.compare)(current_id) == 0 &&
            name.compare(current_name) == 0 &&
            (module.compare(current_module) == 0);{
            return true;
        }

error show below.

1>c:\users\cry83\documents\visual studio 2010\projects\partb\partb\partb.cpp(378): error C2065: 'current_module' : undeclared identifier

1>c:\users\cry83\documents\visual studio 2010\projects\partb\partb\partb.cpp(391): warning C4018: '<' : signed/unsigned mismatch

1>c:\users\cry83\documents\visual studio 2010\projects\partb\partb\partb.cpp(396): error C3867: 'std::basic_string<_Elem,_Traits,_Ax>::compare': function call missing argument list; use '&std::basic_string<_Elem,_Traits,_Ax>::compare' to create a pointer to member with [_Elem=char,_Traits=std::char_traits,_Ax=std::allocator]

1>partb.cpp(396): error C2678: binary '==' : no operator found which takes a left-hand operand of type 'std::string' (or there is no acceptable conversion)

1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\exception(470): could be 'bool std::operator ==(const std::_Exception_ptr &,const std::_Exception_ptr &)'

1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\exception(475): or 'bool std::operator ==(std::_Null_type,const std::_Exception_ptr &)'

1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\exception(481): or 'bool std::operator ==(const std::_Exception_ptr &,std::_Null_type)'

1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\system_error(408): or 'bool std::operator ==(const std::error_code &,const std::error_condition &)'

1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\system_error(416): or 'bool std::operator ==(const std::error_condition &,const std::error_code &)'

1> while trying to match the argument list '(std::string, int)'

  • I can't debug this for you, but when you see `1>c:\...\partb.cpp(378): error C2065: 'current_module' : undeclared identifier`, it's telling you to look on line 378 of partb.cpp, where you're using something called `current_module` which the program doesn't know about. Do this for all the errors and warnings! – Jack Deeth Dec 08 '16 at 03:59
  • Noted. Let me find out the issue. Thank you. – Ryan Choong Dec 08 '16 at 05:08
  • I did a global variable for current_module.. the error gone. but Another error came out. – Ryan Choong Dec 08 '16 at 05:43