1. Configure PuTTY to make sure Chinese characters can be displayed and inputed correctly.
    1. In the PuTTY window, click the PuTTY icon at the left-upper corner of the title bar to open the system menu:
    2. Choose "Change Settings...".
    3. In the pop-up "PuTTY Reconfiguration" window, choose the item "Translation" in the left pane of "Category". Then in the drop-down list of "Received data assumed to be in which character set", choose "UTF-8".
    4. Click the button "Apply".
  2. Consider the following code:
    
    #include <iostream>
    using std::cout;
    using std::endl;
    
    class CStudent
    {
    public:
        CStudent(const char* firstname, const char* surname, const char* lang)
        {
            strcpy(fn, firstname);
            strcpy(sn, surname);
            strcpy(language, lang);
        }
    
        void Print()
        {
            if (strcmp(language, "Chinese") == 0)
                cout << sn << fn << endl;
            else
                cout << fn << ' ' << sn << endl;
        }
    
    private:
        char fn[20];
        char sn[20];
        char language[10];
    };
    
    int main()
    {
        CStudent group[] = {
            CStudent("東坡", "蘇", "Chinese"),
            CStudent("宗元", "柳", "Chinese"),
            CStudent("Sandra", "Bullock", "English"),
            CStudent("Julia", "Roberts", "English")
            };
        for (int i=0; i < sizeof(group) / sizeof(CStudent); i++)
            group[i].Print();
    }
    
    
  3. Note that this program is smart enough that it knows the different rules in displaying people's names. For Chinese names, it displays surnames (family names) before the given names (first names). For English names, it displays given names before surnames.
  4. However, the program is NOT smart enough, because you still need a data member to identify whether this is a Chinese name or an English name.
  5. Now we want you to modify the member function Print() of the class CStudent, so that it will automatically determine whether the student's name is Chinese or English. (A simple rule: If the first character of the first name is between 'a' to 'z', or 'A' to 'Z', we regard this as an English name. You may argue that this rule does not apply to "A妹". That's true, but let's keep it simple now.)
  6. The statements to initialize the array will then be simplified accordingly as
    
        CStudent group[] = {
            CStudent("東坡", "蘇"),
            CStudent("宗元", "柳"),
            CStudent("Sandra", "Bullock"),
            CStudent("Julia", "Roberts")
            };
    
    
  7. Note the constructor also needs to be modified.