programming again cpp same

Question Description

Objective: Learn how to define structures, create and access a vector of structures


    Modify your lab1 to read a file containing a list of students' names followed by their test scores. Define a structure to store name and score. Instead of just a vector of scores, you will now need a vector of structures. Each element in the vector will have the student's name and the average of his or her score. Your program needs to be able to sort the vector by both name and score, so you need to implement two different compare functions to pass to sort:

    sort (students.begin(), students.end(), compareByName);

    sort (students.begin(), students.end(), compareByScore);

    sort will use the function that you provide to sort the data.

    This is how function compareByName should look like:

    bool compareByName(Student stu1, Student stu2) { return < }

    Display the scores sorted by name and score, the class average and median. No matter how the data is sorted, you should print both name and score. For example, students sorted by name:


    Ana 73

    Daniel 66


    Students sorted by score:


    Daniel 66

    Ana 73


    Final Answer

    Here's your program.
    Great working with yo...

    criss53 (2975)
    Boston College

    I was on a very tight deadline but thanks to Studypool I was able to deliver my assignment on time.

    The tutor was pretty knowledgeable, efficient and polite. Great service!

    I did not know how to approach this question, Studypool helped me a lot.


    Brown University

    1271 Tutors

    California Institute of Technology

    2131 Tutors

    Carnegie Mellon University

    982 Tutors

    Columbia University

    1256 Tutors

    Dartmouth University

    2113 Tutors

    Emory University

    2279 Tutors

    Harvard University

    599 Tutors

    Massachusetts Institute of Technology

    2319 Tutors

    New York University

    1645 Tutors

    Notre Dam University

    1911 Tutors

    Oklahoma University

    2122 Tutors

    Pennsylvania State University

    932 Tutors

    Princeton University

    1211 Tutors

    Stanford University

    983 Tutors

    University of California

    1282 Tutors

    Oxford University

    123 Tutors

    Yale University

    2325 Tutors