Lab-11

Please download the attached Lab7_TODO.cpp and follows the instruction 

step by step to finish the lab. 

(There are two struct sample code added as attachment.  CountryTVWatch.cpp , Time.cpp. 

Feel free to refer to them to learn how to use struct in C language.)

You'll note that the code below may need to use arrays of structs.  You will be correcting this deficiency.

Follow my instruction step by step, so that you could get high score and learn knowledge.

Prerequisite

    I)Compile, run and play this program, get the general idea of what this program tries to do.

    II) Read through the code, get to know the structure, i.e. the function decomposition of this program. 

STEPS

1.(0 CREDIT) Search "TODO_1" in this code. Finish the definition of Person_struct. 

    Note: Please do use typedef together with struct. This allows you to use the definition "Person" 

    in place of "struct Person_struct" which you will use in other C programs.

      

2.(1 CREDIT)  Search "TODO_2" in this code. Change the original readInValues() function as readInValues_old()

    Refer to origial readInValues(), replace the corresponding parts using struct type, or struct data member. 

    Change the parameter of the function if necessary. Feel free to change the main() function. 

    The parameter of the function readInValues() could be:

      int readInValues(Person students[], int pCount) --> this is just suggestion, you could decide by yourself.

3. (1 CREDIT) Search "TODO_3" in this code. Change the original displayValues() function as displayValues_old()

    Refer to original displayValues(), replace the corresponding parts using struct type, or struct data member.

    The parameter of displayValues() could be:

             void displayValues(int numStudents, Person students[]) --> this is just suggestion, you could decide by yourself. 

    Change corresponding parts of the main() function, so that you could call the two function you created just 

    now correctly. 

4. Extra Credit:

    If you could use any sort algorithm to make displayValues() function to display in alphabetical order of the names, i.e. sort by name. (You 

    could search online for sample code you would like to use), you get 3 points for this lab. Gook Luck !!