Exercise: Design a Function

  1. Design a function show_name_box(const char* s) which takes a string as the parameter, and print a line of equal signs ("=") before and after it.
  2. Test your program with the main program:
    
    int main()
    {
        const char* name[] = { "Alice", "Bob", "Charlie", "Dvorak" };
        int i;
        for (i=0; i < sizeof(name) / sizeof(name[0]); i++)
            show_name_box(name[i]);
        return 0;
    }
    
    
  3. Combine your function and the above main() in a single .cpp file and submit it.
  4. The result may look like
    
    =====
    Alice
    =====
    
    ===
    Bob
    ===
    
    =======
    Charlie
    =======
    
    ======
    Dvorak
    ======